Page 1 of 1

Check_SNMP 1 OK - 0 CRITICAL

Posted: Tue Mar 06, 2018 5:30 am
by Boune
Hi,

I'm trying to use the check_snmp command but with 2 OIDs.

the first one is to get the VPN Name.
the seconde is to get the VPN State.

Here my command :

Code: Select all

 ./check_snmp -H x.x.x.x -C public -P 2c -o SNMPv2-SMI::enterprises.890.1.6.22.2.4.1.2.1 -l "VPN Name:" -o SNMPv2-SMI::enterprises.890.1.6.22.2.4.1.6.1  -l "STATE:" -r "1"

Code: Select all

SNMP CRITICAL - VPN Name: *"VPN-XXX"* STATE: 1 | ETAT:=1
i try to use the -r option but with 2 oids i cant make it work.

any suggestion ? the 1 state = OK and the 0 state = CRITICAL.

thanks for help

Re: Check_SNMP 1 OK - 0 CRITICAL

Posted: Tue Mar 06, 2018 4:31 pm
by scottwilkerson
Most people would put this in a wrapper plugin.

You would create a plugin that gets the information you want and returns the info you need.

Currently you are trying to manipulate multiple calls into one result and that's not possible in the plugin how it is

Re: Check_SNMP 1 OK - 0 CRITICAL

Posted: Tue Mar 13, 2018 10:56 am
by Boune
hi,

what do you mean with "wrapper pluggins"?

Re: Check_SNMP 1 OK - 0 CRITICAL

Posted: Tue Mar 13, 2018 11:14 am
by scottwilkerson
Boune wrote:hi,

what do you mean with "wrapper pluggins"?
I mean you can create a plugin withing any programming language that calls other plugins such as check_snmp and manipulated to output to be what you are looking for.

Here are the plugin development guidelines
https://nagios-plugins.org/doc/guidelines.html