Page 1 of 1

Can't restart Nagios service

Posted: Fri Feb 11, 2022 10:38 am
by vornado
The Nagios service on our dev Nagios server suddenly stopped running and I'm not able to restart it. I tried to restart it with systemctl. After that didn't work, I rebooted and it still wouldn't run.

Here's the status:

[root@c210enat01 ~]# systemctl status nagios
● nagios.service - Nagios Core 4.4.6
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2022-02-11 10:23:52 EST; 5min ago
Docs: https://www.nagios.org/documentation
Process: 2635 ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)
Process: 2633 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)

Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: ***> One or more problems was encountered while running the pre-...ck...
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: Check your configuration file(s) to ensure that they contain valid
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: directives and data definitions. If you are upgrading from a previous
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: version of Nagios, you should be aware that some variables/definitions
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: may have been removed or modified in this version. Make sure to read
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: the HTML documentation regarding the config files, as well as the
Feb 11 10:23:52 c210enat01.vornadort.com nagios[2633]: 'Whats New' section to find out what has changed.
Feb 11 10:23:52 c210enat01.vornadort.com systemd[1]: Failed to start Nagios Core 4.4.6.
Feb 11 10:23:52 c210enat01.vornadort.com systemd[1]: Unit nagios.service entered failed state.
Feb 11 10:23:52 c210enat01.vornadort.com systemd[1]: nagios.service failed.

Restart gives this:

[root@c210enat01 ~]# systemctl restart nagios
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.


journalctl -xe gives this:

[root@c210enat01 ~]# journalctl -xe
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 142 commands.
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 23 time periods.
Feb 11 10:35:10 c210enat01.vornadort.com systemd[1]: Failed to start Nagios Core 4.4.6.
-- Subject: Unit nagios.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit nagios.service has failed.
--
-- The result is failed.
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 0 host escalations.
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 0 service escalations.
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checking for circular paths...
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 75 hosts
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 0 service dependencies
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 0 host dependencies
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checked 23 timeperiods
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checking global event handlers...
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checking obsessive compulsive processor commands...
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Checking misc settings...
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Total Warnings: 67
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Total Errors: 1
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: ***> One or more problems was encountered while running the pre-flight c
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: Check your configuration file(s) to ensure that they contain valid
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: directives and data definitions. If you are upgrading from a previous
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: version of Nagios, you should be aware that some variables/definitions
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: may have been removed or modified in this version. Make sure to read
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: the HTML documentation regarding the config files, as well as the
Feb 11 10:35:10 c210enat01.vornadort.com nagios[6212]: 'Whats New' section to find out what has changed.
Feb 11 10:35:10 c210enat01.vornadort.com systemd[1]: Unit nagios.service entered failed state.
Feb 11 10:35:10 c210enat01.vornadort.com systemd[1]: nagios.service failed.
Feb 11 10:35:10 c210enat01.vornadort.com polkitd[686]: Unregistered Authentication Agent for unix-process:6205:85224 (system bu
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6228]: nagios : TTY=unknown ; PWD=/home/nagios ; USER=root ; COMMAND=/usr/local
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6228]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6228]: pam_unix(sudo:session): session closed for user root
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6237]: nagios : TTY=unknown ; PWD=/home/nagios ; USER=root ; COMMAND=/usr/local
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6237]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 11 10:35:22 c210enat01.vornadort.com sudo[6237]: pam_unix(sudo:session): session closed for user root



I haven't made any changes recently. Our production Nagios is working fine and actually notified me of this issue.

Any assistance would be appreciated.

Thanks and best regards,

Steve

Re: Can't restart Nagios service

Posted: Fri Feb 11, 2022 3:28 pm
by pbroste
Hello Steve,

Thanks for reaching out, let's take a look at the pre-flight and correct the error.
Total Warnings: 67
Total Errors: 1

Code: Select all

/usr/local/nagios/bin/nagios -vvv /usr/local/nagios/etc/nagios.cfg
Resolve the issue and then re-run the pre-fight and restart the nagios.service by bouncing:

Code: Select all

systemctl restart nagios
let us know how things look,
Perry

Re: Can't restart Nagios service

Posted: Tue Feb 15, 2022 10:10 am
by vornado
Thanks Perry -- apparently the problem was with a comma in a new monitor I created.

Code: Select all

Error: The description string for service 'Oracle Query - BGUSSONI, JSHEFF LOGGED OUT' on host '10.1.1.11' contains one or more illegal characters.
After replacing the comma with 'or' and I was able to start the Nagios service. Thanks again for your help.

Steve

Re: Can't restart Nagios service

Posted: Tue Feb 15, 2022 4:22 pm
by pbroste
Excellent, @vornado glad that you were able to resolve the issue.

I will go ahead and close,
Perry