Ad Widget

Collapse

Value "2,14" of type "string" is not suitable for value type "Numeric (float)"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JSERRAHIMA
    Junior Member
    • May 2021
    • 16

    #1

    Value "2,14" of type "string" is not suitable for value type "Numeric (float)"

    Hello,

    I'm monitoring Oracle DB and aplying Template DB Oracle by ODBC.
    DB is conifigured like

    Code:
    select * from sys.nls_database_parameters where parameter = 'NLS_NUMERIC_CHARACTERS';
    
    | NLS_NUMERIC_CHARACTERS | ., |
    Template is not modified but still getting that error :/

    What else can i try? Sql query is returnning values and them are rigth formated so ...

    Regards.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Can you use a preprosessing rule and replace comma with a dot?

    Markku

    Comment

    • JSERRAHIMA
      Junior Member
      • May 2021
      • 16

      #3
      Hi ,

      I am almost but not entirely sure, that Zabbix is not doing lookup into DB settings to decide, how to interpret numbers... with . or , or both. So, try to insert 2.14 instead of 2,14.
      Is there a way to test or forcing to do it?

      Can you use a preprosessing rule and replace comma with a dot?
      I'm trying but, because i'm using an ODBC template, acccesing monitor does not allow me to modify or add any preprocessing.

      Regards.

      Comment

      • Markku
        Senior Member
        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
        • Sep 2018
        • 1781

        #4
        Originally posted by JSERRAHIMA
        Hi ,
        I'm trying but, because i'm using an ODBC template, acccesing monitor does not allow me to modify or add any preprocessing.
        Do you mean that you cannot change the items because they are created by the discovery rules? In that case change the item prototype in the discovery rule.

        Markku

        Comment

        • JSERRAHIMA
          Junior Member
          • May 2021
          • 16

          #5
          Hi Markku,

          Thank you so much. It works!!!


          Regards.
          Last edited by JSERRAHIMA; 22-06-2021, 07:58.

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            I am almost but not entirely sure, that Zabbix is not doing lookup into DB settings to decide, how to interpret numbers... with . or , or both.So, try to insert 2.14 instead of 2,14.

            Comment

            • JollyJumper
              Junior Member
              • Mar 2023
              • 12

              #7
              Originally posted by Markku

              Do you mean that you cannot change the items because they are created by the discovery rules? In that case change the item prototype in the discovery rule.

              Markku
              hello @Markku,
              where in the template I have to change "," to "." ?

              Click image for larger version  Name:	obraz.png Views:	0 Size:	47.9 KB ID:	461478
              Click image for larger version  Name:	obraz.png Views:	0 Size:	23.0 KB ID:	461479
              Click image for larger version  Name:	obraz.png Views:	0 Size:	27.3 KB ID:	461480
              Last edited by JollyJumper; 21-03-2023, 15:38. Reason: Markku

              Comment

              • guille.rodriguez
                Senior Member
                • Jun 2022
                • 114

                #8
                Add another step on preprocessing (2nd) , select Javascript and add this code

                return value.replace(',','.');

                Save, execute Discovery again (to force changes on device item) and test
                Last edited by guille.rodriguez; 21-03-2023, 18:46.

                Comment

                • JollyJumper
                  Junior Member
                  • Mar 2023
                  • 12

                  #9
                  Originally posted by guille.rodriguez
                  Add another step on preprocessing (2nd) , select Javascript and add this code

                  return value.replace(',','.');

                  Save, execute Discovery again (to force changes on device item) and test
                  thx !
                  • now it works

                  Comment

                  • JollyJumper
                    Junior Member
                    • Mar 2023
                    • 12

                    #10
                    I have another problem:

                    Database discovery : Cannot execute ODBC query: [SQL_ERROR]:[42S22][904][[Oracle][ODBC][Ora]ORA-00904: "CDB":invalid identifier


                    PDB discovery: Cannot execute ODBC query: [SQL_ERROR]:[42S02][942][[Oracle][ODBC][Ora]ORA-00942: table or perspective does not exist

                    ​​
                    Last edited by JollyJumper; 22-03-2023, 12:31.

                    Comment

                    • JollyJumper
                      Junior Member
                      • Mar 2023
                      • 12

                      #11
                      Originally posted by guille.rodriguez
                      Add another step on preprocessing (2nd) , select Javascript and add this code

                      return value.replace(',','.');

                      Save, execute Discovery again (to force changes on device item) and test
                      hello,
                      what can i do when i get this message "empty" or "minus" data?
                      Value "" of type "string" is not suitable for value type "Numeric (unsigned)"
                      Value "-68693237760" of type "string" is not suitable for value type "Numeric (unsigned)"

                      Comment

                      • guille.rodriguez
                        Senior Member
                        • Jun 2022
                        • 114

                        #12
                        If the output its empty ... you can't do anything.. there's no data... maybe you can set to 0 , but you need to know the real values of all the outputs that you check.


                        Code:
                        if ( value === "" )
                        return 0
                        
                        return value.replace(',','.');
                        Change the type of data to Float (to allow negative numbers and decimal numbers)

                        Comment

                        • JollyJumper
                          Junior Member
                          • Mar 2023
                          • 12

                          #13
                          Originally posted by guille.rodriguez
                          If the output its empty ... you can't do anything.. there's no data... maybe you can set to 0 , but you need to know the real values of all the outputs that you check.


                          Code:
                          if ( value === "" )
                          return 0
                          
                          return value.replace(',','.');
                          Change the type of data to Float (to allow negative numbers and decimal numbers)
                          i have Float data type.

                          why in the Name of the "Tablespace used, bytes" author ot this template use "numeric unsigned"
                          and
                          why in the Name of the "Tablespace used, percent" authot ot this template use "numeric float"

                          ​​

                          Comment

                          • cyber
                            Senior Member
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Dec 2006
                            • 4807

                            #14
                            Originally posted by JollyJumper
                            why in the Name of the "Tablespace used, bytes" author ot this template use "numeric unsigned"
                            and
                            why in the Name of the "Tablespace used, percent" authot ot this template use "numeric float"
                            ​​
                            because you cannot have half a byte or 1.34 byte or negative amount of bytes... you have whole number always... that's what unsigned means.
                            and same goes to percent.. it is usually a floating point number... you can have 15.78%.

                            Comment

                            • JollyJumper
                              Junior Member
                              • Mar 2023
                              • 12

                              #15
                              Originally posted by cyber
                              because you cannot have half a byte or 1.34 byte or negative amount of bytes... you have whole number always... that's what unsigned means.
                              and same goes to percent.. it is usually a floating point number... you can have 15.78%.
                              • thanks for explaining

                              Last edited by JollyJumper; 22-03-2023, 15:54.

                              Comment

                              Working...