Hi everyone,
I want to check the humidity and temperature of a room with a dht22 sensor.
So I installed the nessecary plugins wiringPi and lol_dht22. So now I'am able to check the Humidity/Temperature in the commandline.
But i want so see also the stats in the webinterface,that's why i create a humidity.sh and temerature.sh with the query in usr/lib/nagios/plugins and the commands in /etc/nagios/nrpe.cfg. And at least i assigned the query to the device.
But I get following error:
Return code of 13 for service 'Temperatur' on host 'raspberrypi' was out of bounds
(same Error for Humidity)
check indoor climate with a sensor
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check indoor climate with a sensor
Most likely when you are executing from the command line you are doing this as the root user.
I suggest you sudo as the nagios user and then execute the command again and see what error it reports.
I suggest you sudo as the nagios user and then execute the command again and see what error it reports.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check indoor climate with a sensor
Oh your right, thanks dude.
I guess Iam on the right way now, but i have still an error message.
(No output on stdout) stderr: sudo: /usr/lib/nagios/plugins/dht22-temperature.sh: command not found
But i created the commands in the commands.cfg and in the plugins directory
And also
I guess Iam on the right way now, but i have still an error message.
(No output on stdout) stderr: sudo: /usr/lib/nagios/plugins/dht22-temperature.sh: command not found
But i created the commands in the commands.cfg and in the plugins directory
Code: Select all
define command {
command_name check_hum
command_line sudo /usr/lib/nagios/plugins/dht22-humidity.sh
}Code: Select all
define command {
command_name check_temp
command_line sudo /usr/lib/nagios/plugins/dht22-temperature.sh
}-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check indoor climate with a sensor
You need to mark these executable
Code: Select all
chmod +x /usr/lib/nagios/plugins/dht22-temperature.sh
chmod +x /usr/lib/nagios/plugins/dht22-humidity.shRe: check indoor climate with a sensor
Thank you, it works!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check indoor climate with a sensor
Great!C.Appl wrote:Thank you, it works!
Locking thread