upgrade to 4.0.8, cgis not working

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
labrador
Posts: 4
Joined: Fri May 08, 2015 1:53 pm

upgrade to 4.0.8, cgis not working

Post by labrador »

I'm getting the common error
Whoops!

Error: Could not read host and service status information!
after upgrade from 3.5.1 to 4.0.8

The config test runs clean. The service starts up, and I see it logging some soft warnings on a few hosts, which is usual.

I'm not seeing errors in the apache log about permissions. Googling and checking things others have run into has not produced
a good lead into resolving the error.

Here is the tail of my nagios.log:

Code: Select all

[1431110979] Event broker module 'NERD' deinitialized successfully.
[1431110982] Nagios 4.0.8 starting... (PID=17302)
[1431110982] Local time is Fri May 08 15:49:42 ADT 2015
[1431110982] LOG VERSION: 2.0
[1431110982] qh: Socket '/usr/local/nagios/var/rw/query.sh' successfully initialized
[1431110982] qh: core query handler registered
[1431110982] nerd: Channel hostchecks registered successfully
[1431110982] nerd: Channel servicechecks registered successfully
[1431110982] nerd: Channel opathchecks registered successfully
[1431110982] nerd: Fully initialized and ready to rock!
[1431110982] wproc: Successfully registered manager as @wproc with query handler
[1431110982] wproc: Registry request: name=Core Worker 17304;pid=17304
[1431110982] wproc: Registry request: name=Core Worker 17305;pid=17305
[1431110982] wproc: Registry request: name=Core Worker 17306;pid=17306
[1431110982] wproc: Registry request: name=Core Worker 17308;pid=17308
[1431110982] wproc: Registry request: name=Core Worker 17307;pid=17307
[1431110982] wproc: Registry request: name=Core Worker 17309;pid=17309
[1431110982] Successfully launched command file worker with pid 17310
[1431111000] SERVICE ALERT: divinity-1.mydomain.com;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 0%, RTA = 134.74 ms
[1431111052] SERVICE ALERT: jodreyhall-429-3.mydomain.com;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 28%, RTA = 3.22 ms
[1431111060] SERVICE ALERT: divinity-1.mydomain.com;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 21.18 ms
[1431111110] SERVICE ALERT: jodreyhall-429-3.mydomain.com;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 1.57 ms
[1431111262] HOST ALERT: uhall-169-gig1.mydomain.com;DOWN;SOFT;1;PING CRITICAL - Packet loss = 16%, RTA = 241.13 ms
[1431111309] HOST ALERT: uhall-169-gig1.mydomain.com;UP;SOFT;2;PING OK - Packet loss = 0%, RTA = 1.34 ms
[1431111356] SERVICE ALERT: dennis-449-gig1.mydomain.com;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 0%, RTA = 104.46 ms
[1431111362] SERVICE ALERT: chase-a3.mydomain.com;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 16%, RTA = 37.72 ms
[1431111416] SERVICE ALERT: dennis-449-gig1.mydomain.com;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 1.10 ms
[1431111421] SERVICE ALERT: chase-a3.mydomain.com;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 2.09 ms
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: upgrade to 4.0.8, cgis not working

Post by jdalrymple »

Was this a source upgrade or did you use some package manager?

What is the platform/OS?

A good place to start troubleshooting might be the apache error_log. Can we see the tail of it?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: upgrade to 4.0.8, cgis not working

Post by ssax »

Along with jdalrymple's response, please post your /usr/local/nagios/etc/nagios.cfg and the output of the following command:

Code: Select all

ls -l /usr/local/nagios/var
labrador
Posts: 4
Joined: Fri May 08, 2015 1:53 pm

Re: upgrade to 4.0.8, cgis not working

Post by labrador »

This is Redhat 6.6, compiling from a tar file.

apache user is in group nagcmd


var contents...

Code: Select all

# ls -l /usr/local/nagios/var
total 6840
drwxrwxr-x 2 nagios nagios    4096 Apr  1  2013 archives
-rw-r--r-- 1 nagios nagios      34 May  8 15:49 nagios.configtest
-rw-r--r-- 1 nagios nagios       6 May  8 15:49 nagios.lock
-rw-rw-r-- 1 nagios nagios     137 May  8 15:49 nagios.log
-rw-r--r-- 1 nagios nagios 1332362 May  8 15:49 objects.cache
-rw-r--r-- 1 nagios nagios 1332362 May  8 15:49 objects.precache
-rw------- 1 nagios nagios 2153983 May  8 15:49 retention.dat
drwxrwsr-x 2 nagios nagcmd    4096 May  8 15:49 rw
drwxr-xr-x 3 nagios nagios    4096 Apr  1  2013 spool
-rw-rw-r-- 1 nagios nagios 2153277 May  8 16:10 status.dat
tail of apache error log...

Code: Select all

[Fri May 08 14:05:01 2015] [notice] caught SIGTERM, shutting down
[Fri May 08 14:05:01 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri May 08 14:05:01 2015] [notice] Digest: generating secret for digest authentication ...
[Fri May 08 14:05:01 2015] [notice] Digest: done
[Fri May 08 14:05:01 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Fri May 08 15:50:35 2015] [notice] caught SIGTERM, shutting down
[Fri May 08 15:50:36 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri May 08 15:50:36 2015] [notice] Digest: generating secret for digest authentication ...
[Fri May 08 15:50:36 2015] [notice] Digest: done
[Fri May 08 15:50:36 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
nagios.cfg...

Code: Select all

cat  /usr/local/nagios/etc/nagios.cfg  | grep -v '^#' | grep -v '^$'
query_socket=/usr/local/nagios/var/rw/query.sh
log_file=/var/spool/nagios/nagios.log
use_regexp_matching=1
cfg_file=/usr/local/nagios/etc/checkcommands.cfg
cfg_file=/usr/local/nagios/etc/misccommands.cfg
cfg_file=/usr/local/nagios/etc/contactgroups.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/dependencies.cfg
cfg_file=/usr/local/nagios/etc/escalations.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
cfg_file=/usr/local/nagios/etc/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/networks.cfg
resource_file=/usr/local/nagios/etc/resource.cfg
nagios_user=nagios
nagios_group=nagios
check_external_commands=1
command_file=/usr/local/nagios/var/rw/nagios.cmd
lock_file=/usr/local/nagios/var/nagios.lock
temp_file=/usr/local/nagios/var/nagios.tmp
log_rotation_method=d
log_archive_path=/var/spool/nagios/archives
use_syslog=1
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_checks=1
host_inter_check_delay_method=s
service_inter_check_delay_method=s
service_interleave_factor=s
max_concurrent_checks=0
service_reaper_frequency=10
service_check_timeout=300
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
retain_state_information=1
retention_update_interval=60
use_retained_program_state=0
interval_length=60
use_agressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=0
obsess_over_services=0
check_for_orphaned_services=0
check_service_freshness=1
freshness_check_interval=60
status_update_interval=15
enable_flap_detection=1
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=iso8601
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
admin_email=root@mydomain.com
admin_pager=pagenagios
labrador
Posts: 4
Joined: Fri May 08, 2015 1:53 pm

Re: upgrade to 4.0.8, cgis not working

Post by labrador »

BTW, the nagios.log which I have configured is in:
/var/spool/nagios/nagios.log

The nagios log under /usr/local/nagios/var

is an oddity, and only contains these two lines with every start up:

Code: Select all

[1431088940] Error: Cannot open main configuration file '/' for reading!
[1431088940] Error: Failed to process config file '/'. Aborting
Yet, I see a stream of seemingly meaningful logging as I posted before in the /var/spool/nagios location
and the verify with -v shows it is aware of the configuration file definitions.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: upgrade to 4.0.8, cgis not working

Post by scottwilkerson »

Your nagios.cfg doesn't contain a path to your status_file
At a very minimum I would add

Code: Select all

state_retention_file=/usr/local/nagios/var/retention.dat
status_file=/usr/local/nagios/var/status.dat
Then restart nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
labrador
Posts: 4
Joined: Fri May 08, 2015 1:53 pm

Re: upgrade to 4.0.8, cgis not working

Post by labrador »

Thank you Scott. That was perfect. I am back in business with a good
Nagios Core web site again. The Home page shows the daemon is running,
and now pages such as tactical overview, hosts, services, all work again
with no "whoops" error. You guys rock!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: upgrade to 4.0.8, cgis not working

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked