NagiosXI Action Settings, runs as user Apache

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
syncbak
Posts: 11
Joined: Thu May 08, 2014 10:08 am

NagiosXI Action Settings, runs as user Apache

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NagiosXI Action Settings, runs as user Apache

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked