Ubuntu Postfix NRPE: Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Ubuntu Postfix NRPE: Unable to read output

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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!
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post by lmiltchev »

If you are passing arguments with your command, you will need to change:

Code: Select all

dont_blame_nrpe=0
to

Code: Select all

dont_blame_nrpe=1
in the "nrpe.cfg" on the remote box and restart the daemon.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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.
Former Nagios employee
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked