Monitoring Ubuntu, Agent File

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Sorry Rookie mistake

changed back to

Code: Select all

#server_address=127.0.0.1
and did the nmap

says its open and its server is nrpe

But stil getting connection refused on Nagios
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

Alright, the port on the remote host is open. These edits are being done on the remote host's nrpe.cfg, is that correct? I am sorry, the nmap should be the ip of the remote host, not the nagios server.

Is 192.168.19.134 the nagios server or the nrpe remote host?
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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Nagios Server - 192.168.19.134
Ubuntu Server - 192.168.19.141

The nrpe.cfg is being edited on the Ubuntu Server (.141).

So, If i've understood what you said, I went to the Nagios serer (.134) and typed..

Code: Select all

nmap 192.168.19.141 -p 5666
Which says

Code: Select all

PORT STATE SERVICE
5666/TCP CLOSED NRPE
So I'm guessing thats my problem and I need to open it? if so how?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

Alright. I assume you have successfully compiled nrpe on the ubuntu server. Lets try starting nrpe if you have not done so:

On the ubuntu host, we will try to xinetd first, and if that does not work, try to start it by it's init script:

Code: Select all

/etc/init.d/xinetd restart
if that does not work, try:

Code: Select all

/etc/init.d/nrpe start
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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

I've really messed up somewhere I think, sorry for wasting your time.

I've just done "ls" in my init.d directory and xinetd or nrpe are not there :/

I think it might be best i start from fresh again.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Ok, So I did

Code: Select all

sudo apt-get install xinetd
sudo apt-get install nagios-nrpe-server
now in Nagios I get

Code: Select all

CHECK_NRPE Received 0 bytes from Daemon. Check remote server logs for error messages
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

You will most likely need to edit the nrpe.cfg file again. The nrpe file for the package-based install is located in /etc/nagios. Go there and re apply your changes to the nrpe.cfg file.
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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Yeah, I already changed them back to

Code: Select all

allowed_hosts=127.0.0.1,192.168.19.134
dont_blame_nrpe=1
still same message on Nagios
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

Alright, run the nmap command again to see if port 5666 is open. Could you post you /etc/nagios/nrpe.cfg file as well?
On the Nagios server:

Code: Select all

nmap 192.168.19.141 -p 5666
On the Ubuntu server:
You may want to stop the nrpe service, killall nrpe, and then bring it back up to make sure you are using the right config:

Code: Select all

/etc/init.d/nrpe stop
killall nrpe
/etc/init.d/nrpe start
ps -aef |grep nrpe
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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Code: Select all

5666/tcp OPEN NRPE
After doing the NRPE commands you said, the message has now gone back to connection refused.

Its 23:09 here and been here since 17:00 so anything I do will have to be tomorrow. Thanks for all your help today, really appricaite it specially when I have no knowledge at all, hopefully I can get this resolved tomorrow.

As for the log file, it doesnt seem to want to copy/paste so ill just give you all the values if thats ok? If not just say and ill get you the full log tomorrow.

Code: Select all

log_facility=daemon
pid_file=/ar/run/nrpe.pid
serer_port=5666
server_address=127.0.0.1
nrpe_group=nagios
allowed_hosts=127.0.0.1,192.168.19.134
dont_blame_nrpe=1
allow_bash_command_substitution=0
command_prefix=/usr/bin/sudo
debug=0
connection_timeout=300
Locked