nagios service stopped frequently
Posted: Tue Sep 08, 2020 9:16 am
Hello,
The nagios service is stopped unexpectedly and below is the error when checking the log file. This server is nagios HA cluster.
nagiosxi version : 5.6.6
Due to this issue, we have changed the service from init.d to sysytemd. But the nagios service is stopping again.
+++++++++++++++++++++++++++++++++++++++++++
Sep 08 02:00:03 in-nagios-a.informatica.com systemd[1]: Stopping Cluster Controlled nagios...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9813]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Successfully shutdown... (PID=9633)
Sep 08 02:00:04 in-nagios-a.informatica.com nagios[9633]: livestatus: Socket thread has terminated
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service stop-sigterm timed out. Killing.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service: main process exited, code=killed, status=9/KILL
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: Stopped Nagios Core 4.4.3.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: Unit nagios.service entered failed state.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service failed.
+++++++++++++++++++++++++++++++++++++++++++
Below is the systemd file for nagios service.
+++++++++++++++++++++++++++
[root@in-nagios-a ~]# cat /usr/lib/systemd/system/nagios.service
[Unit]
Description=Nagios Core 4.4.3
Documentation=https://www.nagios.org/documentation
After=network.target local-fs.target
[Service]
Type=forking
ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
ExecStop=/usr/bin/kill -s TERM ${MAINPID}
ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd
ExecReload=/usr/bin/kill -s HUP ${MAINPID}
[Install]
WantedBy=multi-user.target
+++++++++++++++++++++++++++
The nagios service is stopped unexpectedly and below is the error when checking the log file. This server is nagios HA cluster.
nagiosxi version : 5.6.6
Due to this issue, we have changed the service from init.d to sysytemd. But the nagios service is stopping again.
+++++++++++++++++++++++++++++++++++++++++++
Sep 08 02:00:03 in-nagios-a.informatica.com systemd[1]: Stopping Cluster Controlled nagios...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9813]: Caught SIGTERM, shutting down...
Sep 08 02:00:03 in-nagios-a.informatica.com nagios[9633]: Successfully shutdown... (PID=9633)
Sep 08 02:00:04 in-nagios-a.informatica.com nagios[9633]: livestatus: Socket thread has terminated
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service stop-sigterm timed out. Killing.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service: main process exited, code=killed, status=9/KILL
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: Stopped Nagios Core 4.4.3.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: Unit nagios.service entered failed state.
Sep 08 02:01:57 in-nagios-a.informatica.com systemd[1]: nagios.service failed.
+++++++++++++++++++++++++++++++++++++++++++
Below is the systemd file for nagios service.
+++++++++++++++++++++++++++
[root@in-nagios-a ~]# cat /usr/lib/systemd/system/nagios.service
[Unit]
Description=Nagios Core 4.4.3
Documentation=https://www.nagios.org/documentation
After=network.target local-fs.target
[Service]
Type=forking
ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
ExecStop=/usr/bin/kill -s TERM ${MAINPID}
ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd
ExecReload=/usr/bin/kill -s HUP ${MAINPID}
[Install]
WantedBy=multi-user.target
+++++++++++++++++++++++++++