When I try and do anything with nagios now all of a sudden I am being forced to authenticate, but the service never completes the start/stop/restart/status anyway.
service nagios start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'nagios.service'.
Authenticating as: notroot
Password:
notroot@nagios:/root$
I don't know where this is coming from but it seems to be preventing nagios from starting. It was not prompting me last week.
I've seen online about polkit (tried disabling it), sudoers file (tried no entry, both all and nopasswd), which group the nagios user is in (nagios and www-data)
I wasn't being prompted to authenticate previously.
Tried these solution as well:
https://askubuntu.com/questions/98006/h ... a-password
usermod -aG sudo nagios
usermod -aG sudo notroot
Created a systemd file:
/etc/systemd/system/multi-user.target.wants/nagios.service
Code: Select all
[Unit]
Description=Nagios
BindTo=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=nagios
Group=nagios
Type=simple
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
lrwxrwxrwx 1 root root 34 Nov 13 15:58 /etc/systemd/system/multi-user.target.wants/nagios.service -> /etc/systemd/system/nagios.service
Code: Select all
[Unit]
Description=Nagios Core 4.4.5
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=/bin/kill -s TERM ${MAINPID}
ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd
ExecReload=/bin/kill -s HUP ${MAINPID}
[Install]
WantedBy=multi-user.target
nagios1001:999::/home/nagios:/bin/bash
And /etc/group file:
sudo27:notroot,nagios
www-data33:nagios
nagios999:www-data
Config check:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.4.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-08-20
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 94 services.
Checked 73 hosts.
Checked 37 host groups.
Checked 3 service groups.
Checked 9 contacts.
Checked 3 contact groups.
Checked 38 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 73 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check