Page 1 of 1

Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 10:58 am
by jasonlehman
We have an X-300 http://www.controlbyweb.com/x300/ temperature sensor.
I would like to create a Nagios check via check_snmp to this devices sensor 1.
I can get this device to work w/ a third party MibBrowser & get the temperature of sensor 1 returned to me.

Before I attempt to create the command and service, I tried to just run check_snmp to test my snytax.

I think I am using the correct syntax...

Code: Select all

[root@nagios plugins]# ./check_snmp -H 10.25.102.247 -p 161 -P 1 -C webrelay -o .1.3.6.1.4.1.30586.10.1 -w 80 -c 90
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
But, as you can see I get an error.
I even emailed X-300 support & they verified that I am using the correct OID & since it works w/ a third part GUI tool; dont think they'll be much help.
Any suggestions / see this before?
Thanks.

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 11:06 am
by jasonlehman
I just found that appending a .0 to the end of the OID it what was missing.

Code: Select all

[root@nagios plugins]# ./check_snmp -H 10.25.102.247 -p 161 -P 1 -C webrelay -o .1.3.6.1.4.1.30586.10.1.0 -w 80 -c 90
SNMP OK - 76.7 | iso.3.6.1.4.1.30586.10.1.0=76.7
I guess I'm just new to this, as it seems to a normal thing to do w/ snmp requests.

Anyways, now onto creating the command & service.

Any suggestions based off of what i provided?

Thanks.

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 12:30 pm
by hsmith
What version of core are you running? I don't think the commands.cfg file has changed a lot over time, but I want to make sure I am referencing the same one when we set this up.

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 1:20 pm
by jasonlehman
Using core 4.0.7

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 1:34 pm
by hsmith
All right so....

Here is a more customized command definition for check_snmp:

Code: Select all

# 'check_snmp' command definition
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -p 161 $ARG1$ 
        }

So we could write up a service that looks something like this:

Code: Select all

define service{
        host_name          yourhostname
        service_description          description here.  temperature check or something.
        check_command                   check_snmp!-P 1 -C webrelay -o .1.3.6.1.4.1.30586.10.1.0 -w 80 -c 90
        max_check_attempts          5
        check_interval                    1
        retry_interval                     1
        check_period                    24x7
        contacts                           yourcontact
        notification_interval          30
         notification_period           24x7
        }
It's kind of messy, could be cleaned up with more $ARGx$'s, but hopefully you get the idea. In the check_command service definition !'s separate the arguments.

I also have not tested this as I do not have the device here :) but it should be pretty close to what you need.

This is a good read: https://assets.nagios.com/downloads/nag ... ml#service

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 2:37 pm
by jasonlehman
Thank you, it is working.
I haven't tested/triggered high heat on the sensor yet, to see if the warnings/alerts work.
That wasn't my concern; just getting it setup was.
Thanks again for helping me to get this to work.
I will also give the website a good read that you recommended.

Jason

Re: Help with check_snmp to get a temperature sensor...

Posted: Wed Oct 21, 2015 2:46 pm
by hsmith
Glad to hear we could help. Feel free to post if you need anything else!

I'll close this topic and mark it resolved.