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.
MrPippin wrote:Can you supply more details of this plugin you've written?
see attached
MrPippin wrote:Had you put in debug statements in the script logging to a debug file to see the flow of execution?
yes, tried that. The script flows as expected. The exception/issue is when doing the "ls" on /tmp remotely, the files are not read (ie, the script leaves the file_count at 0).
Again, the script works perfectly when run locally or even remotely when run on another directory.
Thanks for supplying the script.
You don't have a #! specifier in the front of the script. I'd correct that, first.
That would assure that the script is run with the same shell regardless whether it's you running it or nagios.
Could be a globbing issue, based on what it's the script.
It could also be this "feature" of RHEL/CENTOS/... that are using systemd.
If a daemon is started from systemd (like NRPE probably is) then each daemon get "their own" tmp.
You don't have a #! specifier in the front of the script. I'd correct that, first.
That would assure that the script is run with the same shell regardless whether it's you running it or nagios.
Could be a globbing issue, based on what it's the script.
Sorry, I did not include the header info in the attached script because it contains non-public info. I assure you there is a#!/bin/bash on the first line.
If it is a globbing issue why does the exact same script work when checking for similarly named files in a differently named directory?
danjoh wrote:It could also be this "feature" of RHEL/CENTOS/... that are using systemd.
If a daemon is started from systemd (like NRPE probably is) then each daemon get "their own" tmp.
I think this is controlled with "PrivateTmp=" in the service file.
Regards,
Thanks! This seems like a much more plausible cause versus nitpicking on a script that clearly works. I will check into this further. The only thing is that systemd was implemented in RH7 and I am not seeing the issue on RH7 systems...
danjoh wrote:It could also be this "feature" of RHEL/CENTOS/... that are using systemd.
If a daemon is started from systemd (like NRPE probably is) then each daemon get "their own" tmp.
I think this is controlled with "PrivateTmp=" in the service file.
Regards,
Thanks! This seems like a much more plausible cause versus nitpicking on a script that clearly works. I will check into this further. The only thing is that systemd was implemented in RH7 and I am not seeing the issue on RH7 systems...
This was exactly the cause of the problem. On the RH8 client, "PrivateTmp=" was set to true. Restarting the service after setting it to false, fixed it.
To answer my own questions about RH7 systemd, I am using an older version of NRPE that is not implementing that setting in the service file.