Check_temp.pl No sensors found on Nagios

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.
vkodanam
Posts: 15
Joined: Thu Oct 10, 2019 10:16 am

Re: Check_temp.pl No sensors found on Nagios

Post 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.
vkodanam
Posts: 15
Joined: Thu Oct 10, 2019 10:16 am

Re: Check_temp.pl No sensors found on Nagios

Post 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?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_temp.pl No sensors found on Nagios

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
vkodanam
Posts: 15
Joined: Thu Oct 10, 2019 10:16 am

Re: Check_temp.pl No sensors found on Nagios

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_temp.pl No sensors found on Nagios

Post 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".
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked