NRPE retrieveing weird results

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.
Locked
cosmin.neagu01
Posts: 1
Joined: Mon Aug 17, 2020 2:49 am

NRPE retrieveing weird results

Post by cosmin.neagu01 »

Hello,

I have a local script on a postfix server that checks the emails procesed. Locally the script runs just fine, getting the proper results when run as nagios user.
But when I try to run the same command through NRPE, it always returns 0 as value.
Some help would be appreciated to find out what's wrong with this setup, never seen such a weird behavior with NRPE
NRPEv4.0.2
NagiosV4.4.6



On postfix server:
nagios@postfix:/usr/local/nagios/etc$ whoami
nagios
nagios@postfix:/usr/local/nagios/etc$ /usr/local/nagios/libexec/check_postfix_processed2 -w 50 -c 100
Messages processed in the last 300 seconds: 3 | mailsprocessed=3
nagios@postfix:/usr/local/nagios/etc$ cat nrpe.cfg | grep postfix_proc
command[check_postfix_processed2]=/usr/local/nagios/libexec/check_postfix_processed2 -w 50 -c 100

On nagios server via NRPE:
nagios@AZNO-PRD-NAG001:/usr/local/nagios/libexec$ ./check_nrpe -H 172.18.249.10 -c check_postfix_processed2
Messages processed in the last 300 seconds: 0 | mailsprocessed=0
pelle_viktor
Posts: 6
Joined: Thu Aug 03, 2017 4:17 am

Re: NRPE retrieveing weird results

Post by pelle_viktor »

Are you using $PATH or $HOME or any other system variables in you script?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NRPE retrieveing weird results

Post by benjaminsmith »

@pelle_viktor Thanks for helping out!

Are you getting the expected exit codes when using nrpe?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked