Temperature sensor plugin help

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.
Locked
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Temperature sensor plugin help

Post by smgatses »

Hello, I purchased temperature sensors from a company called serverscheck and I wanted to integrate them into nagios. They have thier own plugin to do this however I am not sure exactly how to set it up. Any help would be much appreciated. The link to the plugin is here: http://www.serverscheck.com/sensors/nagios.asp
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Temperature sensor plugin help

Post by mguthrie »

The rough outline is that you'll need to copy the plugin to your nagios plugins directory, on a source install this is /usr/local/nagios/libexec.

Create a new command definition:
http://nagios.sourceforge.net/docs/3_0/ ... ml#command

Create a new service definition:
http://nagios.sourceforge.net/docs/3_0/ ... ml#service

Make sure these new configs are seen by the main nagios.cfg file, verify the config, and restart nagios.
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Re: Temperature sensor plugin help

Post by smgatses »

Thank you very much for your help however do I need to define a host as well? Also, when defining the service, what would I put for use, service_description, and check_command?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Temperature sensor plugin help

Post by agriffin »

The service should belong to a host, yes. You can assign it to an existing host or define a new one. For check_command you would put the name of your command definition, as well as any arguments it might take, separated by exclamation marks. The service_description is a human-readable name for the service, it can be anything.
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Re: Temperature sensor plugin help

Post by smgatses »

Guys I am still having trouble getting this to work, I am getting an error of (Return code of 126 is out of bounds - plugin may not be executable) . I pasted the config file (from Serverscheck) in /usr/local/nagios/etc/objects, which contains a defined host and services. I then pasted the perl plugin file in /usr/local/nagios/libexec folder. I also made a command in the command.cfg file stating this:
define command{
command_name check_sensor
command_line $USER1$/check_sensor.pl -h $HOSTADDRESS$ $ARG1$
}

I enabled snmp on the device but disable the snmp trap.


Any ideas on what I am doing wrong?
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Re: Temperature sensor plugin help

Post by smgatses »

I have not recieved any response to this inquiry, is there anyone that can help me out with this issue? It would be greatly appreciated. Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Temperature sensor plugin help

Post by slansing »

Does the plugin have the correct execution policies for your user?

Code: Select all

ls -l check_sensor.pl
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Re: Temperature sensor plugin help

Post by smgatses »

-rwxrwxrwx 1 nagios nagios 967 2012-09-19 11:36 check_sensor.pl
smgatses
Posts: 6
Joined: Fri Jul 06, 2012 1:16 pm

Re: Temperature sensor plugin help

Post by smgatses »

Can anyone please help?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Temperature sensor plugin help

Post by mguthrie »

What do you get from running this from the command-line as the nagios user?

Code: Select all

cd /usr/local/nagios/libexec
su nagios -c './check_sensor.pl'
Locked