nagcmd after install

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
vinmansbrew
Posts: 30
Joined: Wed Jan 22, 2020 5:26 pm

nagcmd after install

Post by vinmansbrew »

rhel 9.7, core 4.5.11
So, whatever nagios install doc I used, didn't mention the nagcmd group.
So, I went on my merry way and get everything installed, and everything works, except command through the webui. Which apparently requires nagcmd.

I tried just adding the group and adding nagios and apache to it. Didn't help.
I changed the ownership on /usr/local/nagios/var/rw to nagios:nagcmd That didn't help either.

Is this something that can still be added in/fixed, or am I screwed and have to start all over?
vinmansbrew
Posts: 30
Joined: Wed Jan 22, 2020 5:26 pm

Re: nagcmd after install

Post by vinmansbrew »

Ok, sell if anyone else has this issue, you aren't screwed.

steps I took:
sudo groupadd nagcmd
sudo usermod -aG nagcmd nagios
sudo usermod -aG nagcmd apache
sudo chown -R nagios:nagcmd /usr/local/nagios/var/rw
sudo chmod 2775 /usr/local/nagios/var/rw
sudo systemctl restart nagios
sudo systemctl restart httpd

ls -l /usr/local/nagios/var/rw/nagios.cmd should show prw-rw---- 1 nagios nagcmd

sudo chcon -R -t httpd_sys_rw_content_t /usr/local/nagios/var/rw
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/usr/local/nagios/var/rw(/.*)?"
sudo restorecon -R /usr/local/nagios/var/rw

After this, I was able to do commands such as acknowledging notifications, in the webui.
Post Reply