check_snmp plugin timeout error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
csptra
Posts: 10
Joined: Mon Feb 13, 2017 10:58 am

Re: check_snmp plugin timeout error

Post by csptra »

Thanks!

I will try that if my script doesn't work. I'm testing it now.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp plugin timeout error

Post by rkennedy »

Np. You should be able to cut the text out of that spot from the parsing I did in the past. Take a look at https://github.com/rcknag/nagios-plugin ... rocurve.sh as a reference point if needed. Just parsing OID -> data to text with warning / critical thresholds added.
Former Nagios Employee
csptra
Posts: 10
Joined: Mon Feb 13, 2017 10:58 am

Re: check_snmp plugin timeout error

Post by csptra »

Hello,

One last question,it would seem to me that -l "text" wouldn't dynamically change for the various exit codes.

examples: Message queue OK: Message Count
Message Queue Warning: Message Count
Message Queue Critical: Message count

I think I would have to write a shell script or perl script nagios command for that.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp plugin timeout error

Post by rkennedy »

It would not. What exactly are you looking to do at this point? Can you explain your use case?

We might be able to help further.

On a second thought here - if you're just trying to define warning / critical thresholds with SNMP, you can do so using -w/-c -

Code: Select all

[root@xi libexec]# ./check_snmp
check_snmp: Could not parse arguments
Usage:
check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]
[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]
[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]
[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]
[-A authpasswd] [-x privproto] [-X privpasswd]
Former Nagios Employee
csptra
Posts: 10
Joined: Mon Feb 13, 2017 10:58 am

Re: check_snmp plugin timeout error

Post by csptra »

Hello,

I am needing to write a script, (I wrote it in bourne shell but need to re-write it in perl) to check to use mailq to see the message count and if it is over the warning or critcal thresh hold, then print a custom error or warning message depending on if it is a warning or critical or unknown.


everything is working, but have to re-write my script in perl and make it modular to be used against any server.


I just was curious if using the -l on check_snmp could have dynamic messages -l "text" based on the exit code, but I would guess not.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp plugin timeout error

Post by rkennedy »

Got it.

Ah - no dynamic text like that with -l. You are correct here - this could change with a wrapper script if you added further logic on top of it, though.
Former Nagios Employee
csptra
Posts: 10
Joined: Mon Feb 13, 2017 10:58 am

Re: check_snmp plugin timeout error

Post by csptra »

Thank you rkennedy.

I appreciate all your help. I consider this thread closed and will open another one if I need any additional help.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp plugin timeout error

Post by rkennedy »

No problem! Sounds good - closing this one out!
Former Nagios Employee
Locked