Page 1 of 1

NagiosXI Action Settings, runs as user Apache

Posted: Wed Oct 15, 2014 2:06 pm
by syncbak
Is there a way for nagiosxi to run the action settings scripts as nagios instead of apache?

I am running a script that ssh's to the remote machine, kills a process, and returns the output to nagios. It runs fine from the command line as both user nagios and root.

The problem is that the action (when performed by nagiosxi) is being run as user apache, not nagios like the rest of the service checks. I have keys already setup on the remote machines, and other service checks work fine.
Is there a fix, or setting I can set, so that nagiosxi performs the action as the user nagios instead of apache?
I hate to give Apache elevated access on the remote machine, feels like I'm just asking for trouble.


-TR

Re: NagiosXI Action Settings, runs as user Apache

Posted: Wed Oct 15, 2014 5:24 pm
by sreinhardt
I completely see what you are saying here. It's tricky either way you look at it though, in this particular case. On one hand you give apache ssh keys to the remote system so that this can be executed normally, or you have to give apache sudo to nagios access on your actual nagios machine. I agree that I'm not totally comfortable with either case. Could you instead change the script to specifically use nagios@ and provide the key to apache? When sshing as the nagios user normally the additional user param shouldn't harm anything else if you use this as an event handler or something of the sort.