Reverse or customized check

Hello friends.

I am checking several resources with snmp correctly, the Icinga check is always the same, you set the critical to 1 for example and the value is equal or higher the alarm goes off.

But when checking the ipsec fortigate tunnels, I am encountering a problem that I have not managed to solve, the command returns 2 if the tunnel is OK and 1 if the tunnel is down, if it were the other way around there would be no problem, because I set 1 OK and 2 Critical, but being the other way around I do not know how to configure it. Has anyone encountered this same problem? Where can I configure to set the critical < 2?

Best regards.

Quick and dirty solution could be the negate check.

Hello.

Thank you very much for the answer, and how could I do this in Icinga Director? Because I have tried to enter =! directly on the web and it doesn’t recognize the symbol, only the number.

Best regards.

With negate I meant to chain the check commands negate and your check of choice.

https://icinga.com/docs/icinga-2/latest/doc/10-icinga-template-library/#negate

“-c2:” should result in a critical if below 2.

No, I thought it would be that simple, but -c=2 gives me OK, unless the value is 3, but it has to be 1 Critical and 2 OK.
But thanks for the answer.

Not just “2”, “2:” should result in “everything below 2” is critical.

1 Like

Hello

Sorry for the confusion, I had not seen the :
It works perfectly!!! thank you very much.

Regards