Service test button runs script as apache user
Posted: Tue Oct 20, 2015 11:37 am
Hi,
I have a service running a script that runs commands via ssh in remote boxes. It fails in funny ways intermittently. On another Nagios install that's supposed to be the same, the same service always seems to work fine. The scripts are identical. I added a line to the script to touch a file to see who's running the script. I had assumed it would run as nagios, but I its owned by apache on the server with the problem.
Works:
-rw-r--r-- 1 nagios nagios 0 Oct 20 16:21 /tmp/check_capacity.txt
Fails:
-rw-r--r-- 1 apache apache 0 Oct 20 16:13 /tmp/check_capacity.txt
So on one system, the script is running as apache, and on the other as nagios. Where is the user running the service defined? I don't see it in nagios.cfg
When I test the service (test check command button), the command always fails on either system.
OUTPUT: Could not connect to...
When run by the nagios user, the script runs fine every time.
I have a service running a script that runs commands via ssh in remote boxes. It fails in funny ways intermittently. On another Nagios install that's supposed to be the same, the same service always seems to work fine. The scripts are identical. I added a line to the script to touch a file to see who's running the script. I had assumed it would run as nagios, but I its owned by apache on the server with the problem.
Works:
-rw-r--r-- 1 nagios nagios 0 Oct 20 16:21 /tmp/check_capacity.txt
Fails:
-rw-r--r-- 1 apache apache 0 Oct 20 16:13 /tmp/check_capacity.txt
So on one system, the script is running as apache, and on the other as nagios. Where is the user running the service defined? I don't see it in nagios.cfg
When I test the service (test check command button), the command always fails on either system.
OUTPUT: Could not connect to...
When run by the nagios user, the script runs fine every time.