Page 1 of 1
Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Sun Jun 10, 2018 1:15 pm
by NickK
Hi guys,
I've installed Nagios according to
https://assets.nagios.com/downloads/nag ... Source.pdf
on CentOS 7. But it fails to start.
Failed at step EXEC spawning /usr/lib/systemd/scripts/nagios: No such file
The file is missing indeed. After I have created it manually with 755 permissions, it shows the following:
Failed at step EXEC spawning /usr/lib/systemd/scripts/nagios: Exec format eep EXEC spawning /usr/lib/systemd/scripts/nagios: Exec format error
I have googled and added #!/bin/bash at the beginning.
It is running now, but shows an error on a webpage.
What code should be inside the file? I have failed to find it on the Internet.
Also, I have no idea what went wrong during the installation.
Please help.
Re: Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Mon Jun 11, 2018 2:38 pm
by scottwilkerson
What version of Core did you install?
Did you run the following which should have set that script up
Re: Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Sun Jun 17, 2018 2:40 pm
by NickK
nagios-4.3.4 core.
Sure, I have run make install-init command.
I have tried to reinstall it again totally, but the same issue persists, unfortunately.
- 918 useradd nagios
919 groupadd nagcmd
920 usermod -G nagcmd nagios
921 usermod -G nagcmd apache
922 cd /tmp/nagios-4.3.4/
923 ./configure --with-command-group=nagcmd
924 make all
925 make install
926 make install-init
927 make install-commandmode
928 make install-config
929 nano /usr/local/nagios/etc/objects/contacts.cfg
930 make install-webconf
931 htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
932 systemctl start httpd.service
933 cd ..
934 ls
935 cd nagios-plugins-2.2.1/
936 ./configure --with-nagios-user=nagios --with-nagios-group=nagios
937 make
938 make install
939 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
940 chkconfig --add nagios
941 systemctl enable nagios
942 systemctl enable httpd
943 systemctl start nagios.service
944 service nagios start
945 journalctl -xe
Re: Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Mon Jun 18, 2018 2:57 pm
by scottwilkerson
what does the status show?
Re: Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Tue Jun 19, 2018 1:39 pm
by NickK
Code: Select all
[18:36] [server1.krapnk.com ~] # systemctl status nagios
● nagios.service - Nagios Core Monitoring Daemon
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2018-06-10 18:00:05 UTC; 1 weeks 2 days ago
Process: 18302 ExecStart=/usr/lib/systemd/scripts/nagios start (code=exited, status=203/EXEC)
Jun 10 18:00:05 server1.krapnk.com systemd[1]: Starting Nagios Core Monitoring Daemon...
Jun 10 18:00:05 server1.krapnk.com systemd[1]: nagios.service: control process exited, code=exited status=203
Jun 10 18:00:05 server1.krapnk.com systemd[1]: Failed to start Nagios Core Monitoring Daemon.
Jun 10 18:00:05 server1.krapnk.com systemd[1]: Unit nagios.service entered failed state.
Jun 10 18:00:05 server1.krapnk.com systemd[1]: nagios.service failed.
If I start it and check error log, this is what I get:
Code: Select all
[18:36] [server1.krapnk.com ~] # journalctl -xe
Jun 19 18:38:11 server1.krapnk.com polkitd[437]: Registered Authentication Agent for unix-process:4311:84267938 (system bus na
Jun 19 18:38:11 server1.krapnk.com systemd[1]: Starting Nagios Core Monitoring Daemon...
-- Subject: Unit nagios.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nagios.service has begun starting up.
Jun 19 18:38:11 server1.krapnk.com systemd[4317]: Failed at step EXEC spawning /usr/lib/systemd/scripts/nagios: Exec format er
-- Subject: Process /usr/lib/systemd/scripts/nagios could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /usr/lib/systemd/scripts/nagios could not be executed and failed.
--
-- The error number returned by this process is 8.
Jun 19 18:38:11 server1.krapnk.com systemd[1]: nagios.service: control process exited, code=exited status=203
Jun 19 18:38:11 server1.krapnk.com systemd[1]: Failed to start Nagios Core Monitoring Daemon.
-- Subject: Unit nagios.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nagios.service has failed.
--
-- The result is failed.
Jun 19 18:38:11 server1.krapnk.com systemd[1]: Unit nagios.service entered failed state.
Jun 19 18:38:11 server1.krapnk.com systemd[1]: nagios.service failed.
Jun 19 18:38:11 server1.krapnk.com polkitd[437]: Unregistered Authentication Agent for unix-process:4311:84267938 (system bus
lines 2850-2892/2892 (END)
Re: Installation issue with /usr/lib/systemd/scripts/nagios
Posted: Tue Jun 19, 2018 4:28 pm
by scottwilkerson
what does tail /usr/local/nagios/var/nagios.log display?
what does /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg display?