Page 2 of 2

Re: Check_temp.pl No sensors found on Nagios

Posted: Tue Oct 29, 2019 12:55 pm
by vkodanam
Sorry for the confusion - here is my setup: Physical server running CentOS is a remote machine to Nagios which is running on the Ubuntu. I've the NRPE agent installed on the CentOS. It does the SSH, load, root partition, ping and the other checks. One of the thing I also want to monitor is the core temperature of this physical machine and then there are other physical machines which I'd like to be monitored remotely by Nagios Core.

In this process I've the plugin in the /usr/local/nagios/libexec directory named as "Check_temp.pl" I've then installed the Lm-sensors been thorough their questionnaire and got the core temp output when I type in the command "sensors". Now that I see the output, I check if Nagios server would fetch the results for me automatically without me logging in to the physical machine to check the core temp all the time. This is where I get the "no sensors detected" message.

As far as the command which sensor goes, I've run the command on the Nagios and the physical machine. I get the same output of /bin/usr if I run as root. If i run it as Nagios usr on the Nagios server I obviously get /usr/bin/sensors.

Re: Check_temp.pl No sensors found on Nagios

Posted: Tue Oct 29, 2019 12:58 pm
by vkodanam
No, the plugin is not on the physical machine. It's on the Nagios server. Where do I import the plugin to the physical server?

Re: Check_temp.pl No sensors found on Nagios

Posted: Tue Oct 29, 2019 1:36 pm
by lmiltchev
Again - this plugin is meant to be run locally (on the machine with the sensor that you would like to monitor). You can download the plugin directly on the CentOS box, or copy it over from the Ubuntu machine using FileZilla (or a similar FTP transfer program) or from the command line (via scp).

You have to run the plugin locally on the CentOS box. Once you determine it runs successfully from the CLI, you can call the plugin via check-by-ssh from your Nagios server or use check_nrpe.

Example:
command in nrpe.cfg on the centos box

Code: Select all

command[check_sensor]=/usr/local/nagios/libexec/check_temp.pl -c 85 -w 75 -s 'Core .'
testing from the nagios server

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <ip address of the centos server> -c check_sensor

Re: Check_temp.pl No sensors found on Nagios

Posted: Wed Oct 30, 2019 9:57 am
by vkodanam
Thanks for your help! I've downloaded the perl script locally on the CentOS machine ran the command on Nagios server and it says the "NRPE: Unable to read the output"

Code: Select all

root@Nagios:~# /usr/local/nagios/libexec/check_nrpe -H 192.168.xx.xx -c check_sensor
NRPE: Unable to read output

Re: Check_temp.pl No sensors found on Nagios

Posted: Wed Oct 30, 2019 11:00 am
by lmiltchev
You don't need to use check_nrpe when you are testing the plugin locally. Just run the plugin itself:

Code: Select all

/usr/local/nagios/libexec/check_temp.pl -c 85 -w 75 -s 'Core .'
Note: Make sure that the path to sensors that is defined in the plugin matches the actual path, obtained by running "which sensors".