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

Re: Ubuntu Postfix NRPE: Unable to read output

Post by nickp »

Hi,

I can confirm that I do not have the following on the client nrpe.cfg:

command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $ARG1$

This is also the case on the Nagios XI hosting server nrpe.cfg file


Also the following entry is not in the client or host sudoers file:

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service

Do both these entries need to be added to the respective files and if so does this need to be done on both the Nagios host + client or just one of these?

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post by tmcdonald »

Both of those changes need to be made on the remote host only - nothing should need to change in the XI server.
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 »

I have made the changes on the remote host and I am still getting the same error
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ubuntu Postfix NRPE: Unable to read output

Post by scottwilkerson »

Can you send the output of running the following on the Ubuntu server

Code: Select all

/usr/local/nagios/bin/nrpe -h
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nickp
Posts: 11
Joined: Wed Jul 09, 2014 7:31 am

Re: Ubuntu Postfix NRPE: Unable to read output

Post by nickp »

Here is result of the command:

root@ed-uk:~# /usr/local/nagios/bin/nrpe -h
-bash: /usr/local/nagios/bin/nrpe: No such file or directory

As you can see there are no /usr/local/nagios/bin/ directories, only /usr/local

Should these directories have been created during the Nagios agent install?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post by abrist »

How was nrpe installed? From source or a package?
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 »

I ran the following:

# add-apt-repository ppa:nagiosinc/ppa
# apt-get update
# apt-get install nagios-agent
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post by abrist »

Is it located at /usr/bin/nrpe?

Code: Select all

/usr/bin/nrpe -h
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 »

abrist wrote:Is it located at /usr/bin/nrpe?

Code: Select all

/usr/bin/nrpe -h
It is located here:

root@ed-**:~# find / -name nrpe
/usr/sbin/nrpe

root@ed-uk:~# /usr/sbin/nrpe -h

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************

Usage: nrpe [-n] -c <config_file> <mode>

Options:
-n,--no-ssl = Do not use SSL
<config_file> = Name of config file to use
<mode> = One of the following two operating modes:
-i,--inetd Run as a service under inetd or xinetd
-d,--daemon Run as a standalone daemon
-h,--help Print this short help.
-l,--license Print licensing information.

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Ubuntu Postfix NRPE: Unable to read output

Post by abrist »

Have you restarted the nrpe daemon since you made the config file changes?
Do you have more than one nrpe.cfg?

Code: Select all

find / -name nrpe.cfg
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.
Locked