check_snmp with multi OID and conditional?
Posted: Tue Jun 05, 2018 8:57 am
Im checking a LACP interface where I have NIC1 and NIC2
To make things simple: Lets say 1 is up and 0 is down. Also lets make up the OIDs…
1.2.3.4.5.6.7.8.9.9.9.1 is interface one with it returning a 1 or 0
1.2.3.4.5.6.7.8.9.9.9.2 is interface two with it returning a 1 or 0
Ideally:
./check_snmp -H myfqdn.host.com -o 1.2.3.4.5.6.7.8.9.9.9.1 -o 1.2.3.4.5.6.7.8.9.9.9.2 -P 3 --seclevel=authPriv --secname=user --authproto=SHA --authpasswd='blahblah' --privpasswd='blahblah' --privproto=AES -n
Up till that, everything is understandable.
Here is my thing: I want to return a warning, crit, ok, depending on a conditional: If one interface (either one) is down, it should return a warning. if both are down, it should return a crit and if both are up, it should return a ok. anything else: unknown.
How do I do this?
To make things simple: Lets say 1 is up and 0 is down. Also lets make up the OIDs…
1.2.3.4.5.6.7.8.9.9.9.1 is interface one with it returning a 1 or 0
1.2.3.4.5.6.7.8.9.9.9.2 is interface two with it returning a 1 or 0
Ideally:
./check_snmp -H myfqdn.host.com -o 1.2.3.4.5.6.7.8.9.9.9.1 -o 1.2.3.4.5.6.7.8.9.9.9.2 -P 3 --seclevel=authPriv --secname=user --authproto=SHA --authpasswd='blahblah' --privpasswd='blahblah' --privproto=AES -n
Up till that, everything is understandable.
Here is my thing: I want to return a warning, crit, ok, depending on a conditional: If one interface (either one) is down, it should return a warning. if both are down, it should return a crit and if both are up, it should return a ok. anything else: unknown.
How do I do this?