check indoor climate with a sensor

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
C.Appl
Posts: 14
Joined: Wed Feb 26, 2020 8:03 am

check indoor climate with a sensor

Post by C.Appl »

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)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check indoor climate with a sensor

Post by Box293 »

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
C.Appl
Posts: 14
Joined: Wed Feb 26, 2020 8:03 am

Re: check indoor climate with a sensor

Post by C.Appl »

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

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
}
And also
Attachments
x.PNG
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check indoor climate with a sensor

Post by scottwilkerson »

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.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
C.Appl
Posts: 14
Joined: Wed Feb 26, 2020 8:03 am

Re: check indoor climate with a sensor

Post by C.Appl »

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

Post by scottwilkerson »

C.Appl wrote:Thank you, it works!
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked