Check_temp.pl No sensors found on Nagios
Check_temp.pl No sensors found on Nagios
Hey guys, I was testing one of the physical servers to be monitored with the Nagios Core. I’ve used the check_temp.pl plugin to do this. Installed the lm-sensors on the physical server that I was testing and then ran a detect-sensors where it did a couple of tests and detected Intel Digital Thermal Sensor. After all of this, I ran sensors command and was able to see the temperature for each core. Made changes to localhost.cfg on the Nagios server with the command to be used, added the physical server to the hosts.cfg and Nagios started monitoring everything that I scheduled the checks for, expect the check_temp. It throws the following error:
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
I’ve researched on the Internet, but couldn’t find the exact reason for this. The physical server has CentOS and Nagios is running on Ubuntu. Please let me know what you think of the error above. Also, could you please share if there’s any knowledge base article for temp monitoring that Nagios recommends?
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
I’ve researched on the Internet, but couldn’t find the exact reason for this. The physical server has CentOS and Nagios is running on Ubuntu. Please let me know what you think of the error above. Also, could you please share if there’s any knowledge base article for temp monitoring that Nagios recommends?
Last edited by vkodanam on Tue Oct 29, 2019 1:23 pm, edited 1 time in total.
Re: Check_temp.pl No sensors found on Nagios
When you tested the command, did you test it as the nagios user? It's best to do su - nagios when switching to the nagios user, that way you get its environment exactly.vkodanam wrote:After all of this, I ran sensors command and was able to see the temperature for each core.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Check_temp.pl No sensors found on Nagios
Hi Mbellerue, Yes, I tested asmbellerue wrote:When you tested the command, did you test it as the nagios user? It's best to do su - nagios when switching to the nagios user, that way you get its environment exactly.vkodanam wrote:After all of this, I ran sensors command and was able to see the temperature for each core.
Code: Select all
su - nagios
Code: Select all
su - nagios
[nagios@XXXXXXX]$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 0: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 1: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 2: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 3: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 4: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 5: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 6: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 7: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 8: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 9: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 10: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 11: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 12: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 13: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 14: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 15: +25.0°C (high = +95.0°C, crit = +105.0°C)
Re: Check_temp.pl No sensors found on Nagios
Can you post your host, service, and command definitions (plus any relevant templates that are used, if any)?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Check_temp.pl No sensors found on Nagios
/etc/nagios/objects/commands.cfg
define command {
command_name check_temp
command_line $USER1$/check_temp.pl -w $ARG1$ -c $ARG2$ -s $ARG3$
}
/etc/nagios/objects/host.cfg
define service{
use local-service
host_name name of the host
service_description CPU Temp
check_command check_temp!75!85!"CPU ., Core ."
}
define host {
use linux-server
host_name XXXXXXX
alias XXXXXXX
address XX.XXX.XXXX
register 1
contact_groups admins
}
I removed the service and host config for temp monitoring for now, but the above config is what I've used. And the plugin I used is check_temp.pl from exchange.nagios.org
define command {
command_name check_temp
command_line $USER1$/check_temp.pl -w $ARG1$ -c $ARG2$ -s $ARG3$
}
/etc/nagios/objects/host.cfg
define service{
use local-service
host_name name of the host
service_description CPU Temp
check_command check_temp!75!85!"CPU ., Core ."
}
define host {
use linux-server
host_name XXXXXXX
alias XXXXXXX
address XX.XXX.XXXX
register 1
contact_groups admins
}
I removed the service and host config for temp monitoring for now, but the above config is what I've used. And the plugin I used is check_temp.pl from exchange.nagios.org
Re: Check_temp.pl No sensors found on Nagios
I don't see "CPU" in the sensor's output. Try changing your command from this:[nagios@XXXXXXX]$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 0: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 1: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 2: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 3: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 4: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 5: +23.0°C (high = +95.0°C, crit = +105.0°C)
Core 6: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 7: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 8: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 9: +26.0°C (high = +95.0°C, crit = +105.0°C)
Core 10: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 11: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 12: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 13: +25.0°C (high = +95.0°C, crit = +105.0°C)
Core 14: +24.0°C (high = +95.0°C, crit = +105.0°C)
Core 15: +25.0°C (high = +95.0°C, crit = +105.0°C)
Code: Select all
check_command check_temp!75!85!"CPU ., Core ."
Code: Select all
check_command check_temp!75!85!'Core .'
You can also try the following check from the command line:
Code: Select all
/usr/local/nagios/libexec/check_temp.pl -c 85 -w 75 -s 'Core .'
Code: Select all
# Sensor program
my $SENSORPROG = "/usr/bin/sensors";
Code: Select all
which sensors
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Check_temp.pl No sensors found on Nagios
I've tried the suggested changes and it still says I don't have sensors installed in /bin/sensors as that's the path I've got from command on the machine. Do you know of any other plugins that I can try ?
E-mail from Nagios:
***** Nagios *****nnNotification Type: PROBLEMnnService:Core TempnHost: yXXXXXs: 192.168.XX.XXnState: UNKNOWNnnDate/Time: Mon Oct 28 12:55:47 CDT 2019nnAdditional Info:nn(No output returned from plugin)
Code: Select all
which sensors
E-mail from Nagios:
***** Nagios *****nnNotification Type: PROBLEMnnService:Core TempnHost: yXXXXXs: 192.168.XX.XXnState: UNKNOWNnnDate/Time: Mon Oct 28 12:55:47 CDT 2019nnAdditional Info:nn(No output returned from plugin)
Re: Check_temp.pl No sensors found on Nagios
Can you run:
and show the output?
Also, upload the "check_temp.pl" plugin on the forum. You can rename it to "check_temp.txt" prior to uploading it.
Code: Select all
which sensors
Also, upload the "check_temp.pl" plugin on the forum. You can rename it to "check_temp.txt" prior to uploading it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Check_temp.pl No sensors found on Nagios
When I run as root, I see .
Check_temp file. I've changed the sensors location to /bin/sensors as that's what was showing under root. But, it'd still say no sensors
Code: Select all
which sensors
Code: Select all
/bin/sensors
Code: Select all
[root@xxxxxxxx ~]# which sensors
/bin/sensors
Check_temp file. I've changed the sensors location to /bin/sensors as that's what was showing under root. But, it'd still say no sensors
- Attachments
-
- Check_temp.rtf
- (7.28 KiB) Downloaded 127 times
Re: Check_temp.pl No sensors found on Nagios
Let's step back for a minute. You said:
The "check_temp.pl" plugin is meant to be run locally, so if you sensor is on the CentOS machine, are you running the plugin on the same box too? Did you run the "which sensors" command on the CentOS or on the Ubuntu machine? Do you get the path if you run the same command as nagios user?Hey guys, I was testing one of the physical servers to be monitored with the Nagios Core.
...
The physical server has CentOS and Nagios is running on Ubuntu.
Be sure to check out our Knowledgebase for helpful articles and solutions!