Page 1 of 1

Unable to get process status/Could not read program status

Posted: Wed Mar 25, 2020 6:25 am
by C.Appl
Hi everyone,

I have a really big problem and I hope someone can help me quickly.
First of all, I use a raspberrypi with raspbian and nagios core, with the lastest version.

I tried to fix a problem with a dht22 sensor, because a service to check the temperature and return code of 13.
The service was out of bounds.. so i guessed its a problem with the permissions.

So i tried to change the permissions and to give the right ones for the service.

Now i think, because of trying to fix that problem, i crashed my nagios or something else.
The webinterface of nagios core is unable to get process status.
For the hosts, there is an Error: Could not read host and service status information!
And in the current event log: Warning: Could not read program status information!

BUT.. if i run
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
it says: Things look okay - No serious problems were detected during the pre-flight check

and when i run
systemctl status nagios.service
i got several errors.. i took a screenshot of this output.

So can someone tell me, what i have to do?
Do i have just to set some more permissions?
I don't have any ideas and I'm desperate, because Iam new to nagios..

Thanks all!

Re: Unable to get process status/Could not read program stat

Posted: Wed Mar 25, 2020 9:10 pm
by Box293
I would review the steps here in the following documentation and repeat any step that is permission related.

https://support.nagios.com/kb/article.p ... 6#Raspbian

Re: Unable to get process status/Could not read program stat

Posted: Thu Mar 26, 2020 3:41 am
by C.Appl
I checked all the steps for Raspbian, but it hasn't changed anything. I got still the same error. :(

Re: Unable to get process status/Could not read program stat

Posted: Thu Mar 26, 2020 3:37 pm
by lmiltchev
Can you run the following commands and show the output?

Code: Select all

ls -lad /usr/local/nagios
ls -lad /usr/local/nagios/var
ls -lad /usr/local/nagios/var/rw
ls -la /usr/local/nagios/var/rw

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 4:31 am
by C.Appl
Yes sure, here is the output.

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 9:00 am
by lmiltchev
Run the following commands to change the permissions of the nagios and var folders to nagios:

Code: Select all

chmod nagios.nagios /usr/local/nagios
chmod nagios.nagios /usr/local/nagios/var
and restart nagios to see if the issue has been fixed.

Do you have a nagcmd group on your system or just nagios? Can you run the following command and show the output?

Code: Select all

grep nag /etc/group

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 11:16 am
by C.Appl
I try to run the following commands in the commandline, then i get the message:
"chmod: invalid mode: 'nagios.nagios'"

Or do i have to run the command in the directory?
because then i got the message, that is a missing operand after nagios.nagios

Sorry, if it's a stupid questions, but Iam new to this..
Don't i have to write chmod 777 for example?


And i have just the nagios group
My Output is: nagios:x:995:www-data

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 11:56 am
by lmiltchev
Oh, my bad. I am sorry! I meant "chown"... :oops:

Code: Select all

chown nagios.nagios /usr/local/nagios
chown nagios.nagios /usr/local/nagios/var
I must be Friday... :)

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 12:51 pm
by C.Appl
Oh my god, it works!! You saved me, haha. Thank you so much! :D :D
It may just be a little thing for you, but iam so happy now. You really deserver your weekend now, haha.
_____________________________________________________________________________________________
Can i ask you something else or do i have to make a new post for this?
Because before i had this issue, i tried to fix another problem.
I want to check the humidity and temperature of a room with a dht22 sensor.
Also I installed the nessecary plugins wiringPi and lol_dht22. So i can check the Humidity/Temperature in the commandline.
But i want so see the stats in the webinterface, so i also create a humidity.sh and temerature.sh with the query in usr/lib/nagios/plugins and the commands in /etc/nagios/nrpe.cfg. I followed a manual.
At least i assigned the query to the device.

I have following error:
(Return code of 13 for service 'Temperatur' on host 'raspberrypi' was out of bounds)

Can you help me here too?

Re: Unable to get process status/Could not read program stat

Posted: Fri Mar 27, 2020 1:04 pm
by lmiltchev
Oh my god, it works!! You saved me, haha. Thank you so much! :D :D
It may just be a little thing for you, but iam so happy now. You really deserver your weekend now, haha.
I am glad I was able to help! :)

I will be closing this topic now.
_____________________________________________________________________________________________
Can i ask you something else or do i have to make a new post for this?
Because before i had this issue, i tried to fix another problem.
I want to check the humidity and temperature of a room with a dht22 sensor.
Also I installed the nessecary plugins wiringPi and lol_dht22. So i can check the Humidity/Temperature in the commandline.
But i want so see the stats in the webinterface, so i also create a humidity.sh and temerature.sh with the query in usr/lib/nagios/plugins and the commands in /etc/nagios/nrpe.cfg. I followed a manual.
At least i assigned the query to the device.

I have following error:
(Return code of 13 for service 'Temperatur' on host 'raspberrypi' was out of bounds)

Can you help me here too?
Please start a new thread. This way, we will keep things organized. Thanks!