Page 1 of 2

Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 3:37 pm
by mlong
I am running Nagios Core 3.5.0 on a Turnkey LAMP server (Debian)
Everything works beautifully until I have to reboot the machine.

Upon reboot, the Nagios service never starts. I can start it manually using the command - service nagios start

I ran through the quick start guide and used the command - ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
to configure it to start Nagios on reboot.

We have a Nagios server running on Ubuntu 10.04 LTS
It started on reboot until we upgraded Nagios to 3.5.0, not it also fails to start Nagios on reboot

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 3:52 pm
by slansing
I'd add nagios via chkconfig like so:

Code: Select all

chkconfig --add nagios

chkconfig nagios on

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 3:54 pm
by abrist
Lets check your logs for potential errors on startup:

Code: Select all

cat /var/log/messages | grep -5 "Nagios "

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 4:35 pm
by mlong
chkconfig is not installed on the server

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 4:38 pm
by mlong
abrist wrote:Lets check your logs for potential errors on startup:

Code: Select all

cat /var/log/messages | grep -5 "Nagios "

Code: Select all

Aug 12 08:45:06 nagios nagios: Auto-save of retention data completed successfully.                                                                                                            
Aug 12 08:47:16 nagios nagios: SERVICE ALERT: oasbld1;Memory Usage;WARNING;SOFT;1;Memory usage: total:4457.52 Mb - used: 3790.29 Mb (85%) - free: 667.23 Mb (15%)                             
Aug 12 08:48:16 nagios nagios: SERVICE ALERT: oasbld1;Memory Usage;OK;SOFT;2;Memory usage: total:4457.52 Mb - used: 3738.02 Mb (84%) - free: 719.50 Mb (16%)                                  
Aug 12 08:48:29 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376315309                                                                                                                   
Aug 12 08:48:30 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 08:48:30 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 08:48:30 nagios nagios: Local time is Mon Aug 12 08:48:30 CDT 2013                                                                                                                     
Aug 12 08:48:30 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 08:48:30 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 08:48:30 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 08:48:30 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 08:48:30 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 08:48:30 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 08:48:49 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376315327                                                                                
Aug 12 08:52:31 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376315551                                                                                                                   
Aug 12 08:52:31 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 08:52:31 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 08:52:31 nagios nagios: Local time is Mon Aug 12 08:52:31 CDT 2013                                                                                                                     
Aug 12 08:52:31 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 08:52:31 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 08:52:31 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 08:52:31 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 08:52:31 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 08:52:31 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 08:52:55 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376315574                                                                                
Aug 12 09:10:49 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376316649                                                                                                                   
Aug 12 09:10:50 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 09:10:50 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 09:10:50 nagios nagios: Local time is Mon Aug 12 09:10:50 CDT 2013                                                                                                                     
Aug 12 09:10:50 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 09:10:50 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 09:10:50 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 09:10:50 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 09:10:50 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 09:11:05 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376316663                                                                                
Aug 12 09:11:10 nagios nagios: Warning: Return code of 127 for check of service 'Temperature' on host 'sensatronics' was out of bounds. Make sure the plugin you're trying to run actually exi
sts.                                                                                                                                                                                          
Aug 12 09:12:17 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376316737                                                                                                                   
Aug 12 09:12:17 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 09:12:17 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 09:12:17 nagios nagios: Local time is Mon Aug 12 09:12:17 CDT 2013                                                                                                                     
Aug 12 09:12:17 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 09:12:17 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 09:12:17 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 09:12:17 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 09:12:17 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 09:12:17 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 09:12:33 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376316752                                                                                
Aug 12 09:23:10 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376317390                                                                                                                   
Aug 12 09:23:10 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 09:23:10 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 09:23:10 nagios nagios: Local time is Mon Aug 12 09:23:10 CDT 2013                                                                                                                     
Aug 12 09:23:10 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 09:23:10 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 09:23:10 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 09:23:10 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 09:23:10 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 09:23:10 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 09:23:25 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376317403                                                                                
Aug 12 09:25:27 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376317526                                                                                                                   
Aug 12 09:25:27 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 09:25:27 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 09:25:27 nagios nagios: Local time is Mon Aug 12 09:25:27 CDT 2013                                                                                                                     
Aug 12 09:25:27 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 09:25:27 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 09:25:27 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 09:25:27 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 09:25:27 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 09:25:27 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 09:25:45 nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sensatronics;Temperature;1376317543                                                                                
Aug 12 09:27:42 nagios nagios: EXTERNAL COMMAND: RESTART_PROGRAM;1376317662                                                                                                                   
Aug 12 09:27:42 nagios nagios: PROGRAM_RESTART event encountered, restarting...                                                                                                               
Aug 12 09:27:42 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 09:27:42 nagios nagios: Local time is Mon Aug 12 09:27:42 CDT 2013                                                                                                                     
Aug 12 09:27:42 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 09:27:42 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 09:27:42 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 09:27:42 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 09:27:42 nagios nagios: Warning: Duplicate definition found for service 'D:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/development-d.cfg', starting
 on line 14)                                                                                                                                                                                  
Aug 12 09:27:42 nagios nagios: Warning: Duplicate definition found for service 'W3SVC' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/infrastructure-webservers.cfg', starti
ng on line 14)                                                                                                                                                                                
Aug 12 10:27:42 nagios nagios: Auto-save of retention data completed successfully.                                                                                                            
Aug 12 11:27:42 nagios nagios: Auto-save of retention data completed successfully.                                                                                                            
Aug 12 11:49:40 nagios nagios: Caught SIGHUP, restarting...                                                                                                                                   
Aug 12 11:49:40 nagios nagios: Nagios 3.5.0 starting... (PID=2254)
Aug 12 11:49:40 nagios nagios: Local time is Mon Aug 12 11:49:40 CDT 2013                                                                                                                     
Aug 12 11:49:40 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 11:49:41 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 11:49:41 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 11:49:41 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 11:50:32 nagios kernel: [    7.343983] Adding 3141624k swap on /dev/mapper/turnkey-swap_1.  Priority:-1 extents:1 across:3141624k                                                      
Aug 12 11:50:32 nagios kernel: [    8.346445] ADDRCONF(NETDEV_UP): eth0: link is not ready                                                                                                    
Aug 12 11:50:34 nagios kernel: [   11.820163] b44: eth0: Link is up at 100 Mbps, full duplex.                                                                                                 
Aug 12 11:50:34 nagios kernel: [   11.820167] b44: eth0: Flow control is off for TX and off for RX.                                                                                           
Aug 12 11:50:34 nagios kernel: [   11.820986] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready                                                                                               
Aug 12 12:02:32 nagios nagios: Nagios 3.5.0 starting... (PID=2426)
Aug 12 12:02:32 nagios nagios: Local time is Mon Aug 12 12:02:32 CDT 2013                                                                                                                     
Aug 12 12:02:32 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 12:02:32 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 12:02:32 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 12:02:32 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)                                                                                                                                                                 
--
Aug 12 12:25:45 nagios kernel: [    7.052919] Adding 3141624k swap on /dev/mapper/turnkey-swap_1.  Priority:-1 extents:1 across:3141624k                                                      
Aug 12 12:25:45 nagios kernel: [    8.055127] ADDRCONF(NETDEV_UP): eth0: link is not ready                                                                                                    
Aug 12 12:25:46 nagios kernel: [   10.816168] b44: eth0: Link is up at 100 Mbps, full duplex.                                                                                                 
Aug 12 12:25:46 nagios kernel: [   10.816172] b44: eth0: Flow control is off for TX and off for RX.                                                                                           
Aug 12 12:25:46 nagios kernel: [   10.816998] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready                                                                                               
Aug 12 12:49:44 nagios nagios: Nagios 3.5.0 starting... (PID=2259)
Aug 12 12:49:44 nagios nagios: Local time is Mon Aug 12 12:49:44 CDT 2013                                                                                                                     
Aug 12 12:49:44 nagios nagios: LOG VERSION: 2.0                                                                                                                                               
Aug 12 12:49:44 nagios nagios: Warning: Duplicate definition found for service 'C:\ Drive Space' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastru
cture.cfg', starting on line 14)                                                                                                                                                              
Aug 12 12:49:44 nagios nagios: Warning: Duplicate definition found for service 'CPU Load' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructure.c
fg', starting on line 32)                                                                                                                                                                     
Aug 12 12:49:44 nagios nagios: Warning: Duplicate definition found for service 'Memory Usage' on host 'gfifaxmaker' (config file '/usr/local/nagiosql/services/domain-controllers_infrastructu
re.cfg', starting on line 50)

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 4:47 pm
by abrist
What init system are you using on 10 - systemd, upstart, or openrc?

Re: Nagios service will not start after reboot

Posted: Mon Aug 12, 2013 5:11 pm
by mlong
abrist wrote:What init system are you using on 10 - systemd, upstart, or openrc?
I'm sorry to say I do not know and Im unsure how to check.

Re: Nagios service will not start after reboot

Posted: Tue Aug 13, 2013 9:50 am
by slansing
If you are running 9.x or greater you should be able to do the following:
"example"

Code: Select all

update-rc.d dhcp3-server enable
Otherwise we will need to go abrist's rout, or install the chkconfig package which will automatically symlink and do this for you.

Re: Nagios service will not start after reboot

Posted: Tue Aug 13, 2013 10:03 am
by mlong
slansing wrote:If you are running 9.x or greater you should be able to do the following:

Code: Select all

update-rc.d dhcp3-server enable
Otherwise we will need to go abrist's rout, or install the chkconfig package which will automatically symlink and do this for you.
These are the results I got from this command:

update-rc.d: using dependency based boot sequencing
update-rc.d: error: cannot find a LSB script for dhcp3-server

Re: Nagios service will not start after reboot

Posted: Tue Aug 13, 2013 10:44 am
by slansing
That was an example for another service, use nagios instead as that is what you are trying to do here.