SNMP String Value "Abnormal" still stays at ok

(Andre) #1

Hi community,

I think that is a noob-question, but I hope someone can help me. I check the S.M.A.R.T State of some HDD’s. I want that the state becomes critical when the value is “Abnormal”. But it doesn’t work.


I also tried STRING: “Abnormal” and SNMP OK - “Abnormal”


I know there is a QNAP-Plugin, but I wan’t to make it with SNMP by hand.



Looking at the documentation you’ll find that snmp_warn / snmp_crit are threshold values, meaning they have to be numerical.
Please check whether there is another OID containing a numerical value representing the equivalent to the string value.

1 Like
(Andre) #3

Thx Wolfgang for that info.

I find OID’s with INTEGER Values. If the S.M.A.R.T is good there is a 0 but if S.M.A.R.T is bad there comes a -9 . If I define -9 as critical I get error from Icinga2 :frowning:


Normally states are getting worse the higher the values are. In this case you want critical if the value is lower than normal. Please take a look here for examples (that might help; I haven’t checked whether the director accepts such format).

1 Like
(Andre) #5

Pefect it works with the definition 0:



You could also use one of these options, to check for the desired string:

-s, --string=STRING
    Return OK state (for that OID) if STRING is an exact match
 -r, --ereg=REGEX
    Return OK state (for that OID) if extended regular expression REGEX matches
 -R, --eregi=REGEX
    Return OK state (for that OID) if case-insensitive extended REGEX matches

And then use

    Invert search result (CRITICAL if found)

in case the state should be critical, if the string matches.