Page 2 of 4
Re: Error: Could not read host and service status informatio
Posted: Thu Jan 23, 2020 8:42 am
by buee
Box293 wrote:So the doc is created with multiple sections for different OS's to remove confusion.
It might be that the doc is now outdated if Ubuntu has updated PHP to 7 and the doc is built around older PHP versions.
Yeah, I saw that section was for CentOS, but I figured I'd check anyway. So what are the next steps?
Re: Error: Could not read host and service status informatio
Posted: Thu Jan 23, 2020 6:38 pm
by Box293
What do the apache logs say?
Code: Select all
tail -n 20 /var/log/apache2/error.log
tail -n 20 /var/log/apache2/access.log
Re: Error: Could not read host and service status informatio
Posted: Fri Jan 24, 2020 10:32 am
by buee
Box293 wrote:What do the apache logs say?
Code: Select all
tail -n 20 /var/log/apache2/error.log
tail -n 20 /var/log/apache2/access.log
Just did a page refresh prior to grabbing the logs:
Code: Select all
tail -20 /var/log/apache2/error.log
[Fri Jan 24 06:25:03.714439 2020] [mpm_prefork:notice] [pid 19323] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Jan 24 06:25:03.714472 2020] [core:notice] [pid 19323] AH00094: Command line: '/usr/sbin/apache2'
Code: Select all
tail -20 /var/log/apache2/access.log
127.0.0.1 - - [24/Jan/2020:07:51:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:07:56:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:01:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:06:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:11:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:16:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:21:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:26:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:31:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:36:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:41:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:46:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:51:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:08:56:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:01:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:06:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:11:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:16:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:21:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
127.0.0.1 - - [24/Jan/2020:09:26:56 -0600] "GET / HTTP/1.1" 200 11595 "-" "check_http/v2.1.2 (monitoring-plugins 2.1.2)"
Re: Error: Could not read host and service status informatio
Posted: Fri Jan 24, 2020 3:53 pm
by scottwilkerson
Can we see the permissions of the following dirs to verify the www-data user or nagios group has access to read all
Code: Select all
ls -l /var/cache/nagios3
ls -l /var/cache
ls -l /var
Re: Error: Could not read host and service status informatio
Posted: Fri Jan 24, 2020 6:12 pm
by buee
scottwilkerson wrote:Can we see the permissions of the following dirs to verify the www-data user or nagios group has access to read all
Code: Select all
ls -l /var/cache/nagios3
ls -l /var/cache
ls -l /var
Code: Select all
ls -l /var/cache/nagios3
total 204
-rw-r--r-- 1 nagios www-data 69939 Jan 20 17:31 objects.cache
-rw-rw-r-- 1 nagios www-data 66516 Jan 24 17:07 status.dat
-rw-rw-r-- 1 nagios www-data 63308 Jan 20 16:51 status.dat.back
Code: Select all
ls -l /var/cache
total 48
drwxr-xr-x 3 root root 4096 Jun 12 2019 apache2
drwxr-xr-x 2 root root 4096 Apr 12 2016 apparmor
drwxr-xr-x 3 root root 4096 Jan 24 06:28 apt
drwxr-xr-x 3 root root 4096 Jun 12 2019 dbconfig-common
drwxr-xr-x 2 root root 4096 Jan 22 06:25 debconf
drwxr-xr-x 2 root root 4096 Jun 12 2019 fontconfig
drwx------ 2 root root 4096 Jan 24 06:07 ldconfig
drwxr-sr-x 27 man root 4096 Jan 24 06:25 man
-rw-r--r-- 1 root root 0 Jan 24 07:18 motd-news
drwxr-s--- 2 nagios www-data 4096 Jan 24 17:08 nagios3
drwxr-xr-x 2 root root 4096 May 23 2019 samba
drwxr-xr-x 2 root root 4096 Jan 20 15:28 snapd
drwxr-xr-x 2 www-data www-data 4096 Apr 4 2016 tcpdf
Code: Select all
ls -l /var
total 52
drwx------ 2 root root 4096 Jan 20 15:28 agentx
drwxr-xr-x 2 root root 4096 Jan 24 06:25 backups
drwxr-xr-x 14 root root 4096 Oct 23 12:55 cache
drwxrwxrwt 2 root root 4096 Jun 22 2019 crash
drwxr-xr-x 55 root root 4096 Nov 7 12:43 lib
drwxrwsr-x 2 root staff 4096 Apr 12 2016 local
lrwxrwxrwx 1 root root 9 Jun 12 2019 lock -> /run/lock
drwxrwxr-x 14 root syslog 4096 Jan 24 06:25 log
drwxrwsr-x 2 root mail 4096 Apr 20 2016 mail
drwxr-xr-x 2 root root 4096 Apr 20 2016 opt
lrwxrwxrwx 1 root root 4 Jun 12 2019 run -> /run
drwxr-xr-x 2 root root 4096 Apr 19 2016 snap
drwxr-xr-x 5 root root 4096 Jun 12 2019 spool
drwxrwxrwt 6 root root 4096 Jan 24 16:39 tmp
drwxr-xr-x 3 root root 4096 Jun 12 2019 www
Additionally, I did sudo su - nagios then touch /var/cache/nagios3/text.txt then checked permissions:
Code: Select all
total 212K
drwxr-s--- 2 nagios www-data 4.0K Jan 24 17:11 .
drwxr-xr-x 14 root root 4.0K Oct 23 12:55 ..
-rw-r--r-- 1 nagios www-data 69K Jan 20 17:31 objects.cache
-rw-rw-r-- 1 nagios www-data 65K Jan 24 17:11 status.dat
-rw-rw-r-- 1 nagios www-data 62K Jan 20 16:51 status.dat.back
-rw-rw-r-- 1 nagios www-data 0 Jan 24 17:10 test.txt
Re: Error: Could not read host and service status informatio
Posted: Tue Jan 28, 2020 8:53 am
by buee
Any other suggestions, ideas, or things to check?
Re: Error: Could not read host and service status informatio
Posted: Tue Jan 28, 2020 9:41 am
by tgriep
Make sure that the nagios user account is still active and not expired.
Run this to check it.
What is the user account you are using to login to the web interface?
Is it setup in the cgi.cfg to access the system status data?
Try editing the /etc/groups file and add the nagios user account to www-data group.
Restart Nagios and Apache.
Re: Error: Could not read host and service status informatio
Posted: Tue Jan 28, 2020 10:40 am
by buee
tgriep wrote:Make sure that the nagios user account is still active and not expired.
Run this to check it.
What is the user account you are using to login to the web interface?
Is it setup in the cgi.cfg to access the system status data?
Try editing the /etc/groups file and add the nagios user account to www-data group.
Restart Nagios and Apache.
chage -l nagios output:
Code: Select all
Last password change : Jun 12, 2019
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
The user for HTML basicauth, "buee", appears to be authorized for everything in the cgi.cfg file. The readonly section is completely commented out, other than that, every line that begins with "auth" ends with "=buee".
The nagios user is already part of the www-data group:
IIRC, I had to do this so I could ack, schedule downtime, and/or trigger a forced check through the web interface.
Re: Error: Could not read host and service status informatio
Posted: Tue Jan 28, 2020 2:00 pm
by tgriep
Actually, what you have shown, these users www-data,nagios are part of the nagios group, not the other way around.
If you login as the nagiosadmin, does the system display the same error?
Re: Error: Could not read host and service status informatio
Posted: Tue Jan 28, 2020 3:35 pm
by buee
tgriep wrote:Actually, what you have shown, these users www-data,nagios are part of the nagios group, not the other way around.
If you login as the nagiosadmin, does the system display the same error?
Good point! The nagios user was not in the www-data group. I added it, but no difference, sadly. Here is my current /etc/group file:
Code: Select all
cat /etc/group | grep www
www-data:x:33:nagios
nagios:x:1001:www-data,nagios
nagcmd:x:1002:nagios,www-data
From a Linux standpoint, the only user as far as Nagios is concerned is 'nagios' and 'nagcmd' as shown above. For the web interface, 'buee' is it, there is no 'nagiosadmin' user. Do you want me to create a new user in the htpasswd.users file and see if I get the error?