Back to OP5 Monitor FAQ

Internal documentation only

This page has been marked as draft.

Unable to run NRPE-based checks inside of /var and /tmp directories

When trying to run a script or a file check plugin on either the /var or /tmp directories, you may receive an error closely resembling the below one:

[root@op5master ~]# /opt/plugins/check_nrpe -H RockyOS8 -c check_file_content_tmp
Can't open /var/tmp/localhost_isi_rbm_ping.txt: No such file or directory

Which can be confusing to troubleshoot, since it is able to be ran locally with no issue:

[root@RockyOS8 nrpe.d]# /etc/nrpe.d/scripts/check_file_content.pl -f /var/tmp/localhost_isi_rbm_ping.txt -i CRIT
No CRITICAL found in /var/tmp/localhost_isi_rbm_ping.txt

This is most likely be caused by the following line in /lib/systemd/system/nrpe.service:

PrivateTmp=true

What you would need to do is find the above line in the /lib/systemd/system/nrpe.service file, and change it to look like so:

PrivateTmp=false

Then save the modified file.

Afterwards, reload the daemon and restart the service:

systemctl daemon-reload
systemctl restart nrpe

Afterwards, you should now be able to run the check against the EL8 server:

root@op5master ~]# /opt/plugins/check_nrpe -H RockyOS8 -c check_file_content_tmp
No CRITICAL found in /var/tmp/localhost_isi_rbm_ping.txt

More information can be found on this external link.

check_file_content.pl can be found on Nagios Exchange.

["Geneos"] ["FAQ"]

Was this topic helpful?