Ad Widget

Collapse

Discard broken item data

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Discard broken item data

    Hello,

    i have some devices (thermometer) which are going sometimes to an
    undefined state.
    In this state i get a value of -999 which breaks my graphs badly.
    Is there a possibility to filter out such values at data acquisition?

    Kind Regards
    Thomas

    #2
    what is the item key used ? can you post item conf ?

    Comment


      #3
      Here is my item data.
      I think there is everything ok with zabbix.

      The sensor sometimes sends an invalid value e.g. -999 or -999.9.
      I want zabbix to ignore such values.

      Perhaps it is a feature request: define a range of valid
      values, e.g. -273 to infinite for temperatures in °C and
      let the system throw away invalid values.

      Code:
      </item>
      <item>
          <name>Sensor 1 Value</name>
          <type>4</type>
          <snmp_community>public</snmp_community>
          <multiplier>1</multiplier>
          <snmp_oid>.1.3.6.1.4.1.21796.4.1.3.1.5.1</snmp_oid>
          <key>hwgSensor1Value</key>
          <delay>100</delay>
          <history>120</history>
          <trends>730</trends>
          <status>0</status>
          <value_type>0</value_type>
          <allowed_hosts/>
          <units>°C</units>
          <delta>0</delta>
          <snmpv3_contextname/>
          <snmpv3_securityname/>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authprotocol>0</snmpv3_authprotocol>
          <snmpv3_authpassphrase/>
          <snmpv3_privprotocol>0</snmpv3_privprotocol>
          <snmpv3_privpassphrase/>
          <formula>0.1</formula>
          <delay_flex/>
          <params/>
          <ipmi_sensor/>
          <data_type>0</data_type>
          <authtype>0</authtype>
          <username/>
          <password/>
          <publickey/>
          <privatekey/>
          <port>161</port>
          <description/>
          <inventory_link>0</inventory_link>
          <applications>
              <application>
                  <name>Environment</name>
              </application>
          </applications>
          <valuemap/>
          <logtimefmt/>
      </item>

      Comment


        #4
        Originally posted by thooge View Post
        In this state i get a value of -999 which breaks my graphs badly.
        Hi, thooge.
        Just correct the graph - set "Y axis MIN value" fixed and equal to your minimal temperature value.

        Comment


          #5
          Your fix works for visualization.
          But i don't want that value in the database.
          E.g. it will be used for calculation on avg, trends etc. which
          leads to wrong values.

          Comment


            #6
            Originally posted by thooge View Post
            Hello,

            i have some devices (thermometer) which are going sometimes to an
            undefined state.
            In this state i get a value of -999 which breaks my graphs badly.
            Is there a possibility to filter out such values at data acquisition?

            Kind Regards
            Thomas
            I have the same situation, did you find a solution ?

            Comment


              #7
              If you use the latest version 4.2 yes its possible.
              Here you can read this: https://www.zabbix.com/documentation.../whatsnew420?s[]=validation#validation_and_throttling_rules
              Debian-User

              Sorry for my bad english

              Comment


                #8
                Originally posted by Colttt View Post
                If you use the latest version 4.2 yes its possible.
                Here you can read this: https://www.zabbix.com/documentation.../whatsnew420?s[]=validation#validation_and_throttling_rules
                That's great news, unfortunately I Am in Zabbix 3.4 version and in my business they have no plans yet to upgrade the version. Is there another solution for this ?

                Comment


                  #9
                  In 3.4 you may use preprocessing with regexp.
                  To replace -999 with 0:
                  (-.*)|([\d.]*) 0\2
                  To discard -999 would be better to create a dependent item with preprocessing:
                  ([\d.]*) \1
                  In case of value -999 this dependent item becomes unsupported, but unlike master item unsupported dependent item doesn't require refresh interval for restoration.

                  Comment


                    #10
                    Originally posted by Semiadmin View Post
                    In 3.4 you may use preprocessing with regexp.
                    To replace -999 with 0:
                    (-.*)|([\d.]*) 0\2
                    To discard -999 would be better to create a dependent item with preprocessing:
                    ([\d.]*) \1
                    In case of value -999 this dependent item becomes unsupported, but unlike master item unsupported dependent item doesn't require refresh interval for restoration.
                    Hey thanks a lot! thats what I was looking for ! Using preprocessing with regex, how can I tell to discard values below -10C and above +40C ?

                    Comment


                      #11
                      Maybe, something like this one:
                      ^(-[\d]\..*)|^(-[\d])$|(^[1-3]\d\..*)|(^[1-3]\d)0$|(^[\d]\..*)|(^[\d])$|^(-10)$|^(40)$
                      \1\2\3\4\5\6\7\8

                      Comment


                        #12
                        Hi there, I am using this regex to get only values in the range 0 to 9999
                        Code:
                        ^([0-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|1000)$                   \1
                        It's works fine but discards the value, I want to transform the value discarted in 0, how can I do that?

                        Comment


                          #13
                          Originally posted by joseperes View Post
                          Hi there, I am using this regex to get only values in the range 0 to 9999
                          Code:
                          ^([0-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|1000)$ \1
                          It's works fine but discards the value, I want to transform the value discarted in 0, how can I do that?
                          Code:
                           
                           ^([0-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|1000)$|.*                    0\1

                          Comment


                          • joseperes
                            joseperes commented
                            Editing a comment
                            Thank you ! It worked

                          #14
                          I have another situation that I need to get values in the range 0 to 100 and if the value goes above 100 should stay on 100. How can I do it ?

                          Comment


                            #15
                            Originally posted by joseperes View Post
                            I have another situation that I need to get values in the range 0 to 100 and if the value goes above 100 should stay on 100. How can I do it ?
                            For example:
                            Code:
                            (^(\d){1,2}$)|.*                                    -\1-100
                            -(\d+)                                                \1

                            Comment


                            • joseperes
                              joseperes commented
                              Editing a comment
                              This is only working for the range 0 to 99 ...

                            • joseperes
                              joseperes commented
                              Editing a comment
                              I got working the range 0 to 100 with this regex: ^(100|[1-9]?[0-9])$ \1

                              Now I just need to transform on 100 when the number is over 100. How can I do it ?
                          Working...
                          X