Page 1 of 3
Ubuntu Postfix NRPE: Unable to read output
Posted: Thu Jul 24, 2014 8:58 am
by nickp
Hi,
I am currently deploying the Nagios agent onto our Ubuntu 12.04 servers and on each one I am getting this NRPE: Unable to read output error in the Postfix service monitoring.
I know that the service name has to be entered correctly after having the same error when entering the wrong service name when running the wizard but as far as I know it is just called postfix in Ubuntu so I am scratching my my head about this one.
Any suggestions would be greatly appreciated and apologies if I am missing something obvious.
Thanks
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Thu Jul 24, 2014 12:36 pm
by abrist
Can you post the full command and service config for the check? Have you tried testing the check from the cli?
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Fri Jul 25, 2014 3:43 am
by nickp
Hi Andy and thanks for your reply.
This is the command that is checking the Postfix service:
check_nrpe!check_init_service!-a 'postfix'
I will look into the plugins as well.
Cheers
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Fri Jul 25, 2014 11:01 am
by slansing
Hello,
To grab what Abrist was asking for, please navigate to Configure > CCM > Services > 'click the blue diskette icon next to the name of this service in your list, then post the output here'. What you did give us though should be sufficient. Lets try this, open an ssh session to your XI server and log in as root, then run:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H ip.addr.of.your.remotehost -c check_init_service -a 'postfix'
Can you also attach the nrpe.cfg of that remote host so we can verify your command definition there? Thanks!
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Wed Jul 30, 2014 4:57 am
by nickp
Hi,
I get the following when running the command you provided:
NRPE: Unable to read output
I have attached the nrpe.cfg as requested.
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Wed Jul 30, 2014 4:05 pm
by lmiltchev
If you are passing arguments with your command, you will need to change:
to
in the "nrpe.cfg" on the remote box and restart the daemon.
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Thu Jul 31, 2014 3:32 am
by nickp
Hi,
I have made the changes you suggested but I'm still getting the same error.
All the other processes are being monitored OK it is just Postfix that is throwing this error.
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Thu Jul 31, 2014 4:28 pm
by tmcdonald
Are the functioning checks using command arguments at all? Or is that all handled NRPE-side? If you did not compile with the --enable-command-args flag you will not be able to use arguments.
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Fri Aug 01, 2014 4:01 am
by nickp
Hi,
Yes, all the other functioning service checks are using command arguments so I can't understand why the Postfix one isn't working correctly on any of the servers we are monitoring.
Re: Ubuntu Postfix NRPE: Unable to read output
Posted: Fri Aug 01, 2014 1:14 pm
by lmiltchev
It seems it's working fine for me. Here's what I have on the client:
in the nrpe.cfg
Code: Select all
command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $ARG1$
in the sudoers:
Code: Select all
Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service
On the client:
Code: Select all
[root@speedking ~]# service postfix status
master (pid 16292) is running...
Testing from the XI server:
Code: Select all
./check_nrpe -H 192.168.x.x -c check_init_service -a 'postfix'
master (pid 16292) is running...
Hope this helps.