Monitoring Ubuntu, Agent File

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

You may have 2 nrpe installation this system - one from the agent/source and the other from ubuntu's repos. You will know which one is running when you start nrpe by checking the config it loads with. The command:

Code: Select all

ps -aef | grep nrpe
Will show us which cfg is in use. You most likely have one config/install at /usr/local/nagios/etc and the other at /etc/nagios. When you get a chance reply back with the output of the ps command. We can get this sorted.
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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitoring Ubuntu, Agent File

Post by slansing »

Did you run:

Code: Select all

nmap 192.168.19.141 -p 5666
Before or after you killed the NRPE daemon? Hopefully after, if so then the port is open, lets check the syslog on the NRPE system.

Make sure that in the nrpe.cfg you have debugging set to 1 or "enabled." This will dump all NRPE relevant information to the syslog. After changing this restart nrpe:

Code: Select all

/etc/init.d/nrpe restart
Then check the system log and let us know what it output:

Code: Select all

tail /var/log/messages
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Thank you for the advise guys. Sadly I don't have access to the computer lab today but I will do tomorrow so ill update you. Once again thanks.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitoring Ubuntu, Agent File

Post by slansing »

Sounds good let us know the outcome of the last message.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Ok, So i've just started up all the machines and the current status is Nagios saying "CHECK_NRPE" and not connection refused.

Abrist

Code: Select all

ps -aef | grep nrpe
nagios 879  1  0  08:17  ?      00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
1000 1289  1056  0  08:31  tty1    00:00:00 grep --color=auto nrpe
slansing

I ran the Nmap command both before and after I killed it, just to make sure as I wasn't 100%. I've just ran it and got "5666/tcp open nrpe"

I put debug to zero and restarted NRPE. But when in the /var/log directory there is nothing called messages so I am unable to read/open it.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

Debug should be set to 1 for logging. Nrpe is using the config file /etc/nagios/nrpe.cfg, so make sure that is the one you are editing.
Could you post:

1. The command in commands.cfg you are using?
2. The NRPE command in nrpe.cfg
3. The service check in nagios (in the corresponding 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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Monitoring Ubuntu, Agent File

Post by A.Cormack »

Ok, so I was editing the wrong NRPE.cfg file... sorry. So I've gone into that and changed...

Code: Select all

allowed_hosts=127.0.0.1,192.168.19.134
dont_blame_nrpe=1
debug=1
But still no change in Nagios.

Appologies, but I don't quite understand what you wish me too post. I went into nrpe.cfg and found..

Code: Select all

command_prefix=/usr/bin/sudo
Is that what you meant? Appologies if not.

-----EDIT-----

Think I may have found the problem. I went into /var/log and instead of messages I did

Code: Select all

tail syslog
and got several of the following messages..

Code: Select all

Feb 1 10:28:28 ubuntu nrpe[2716]: Host 192.168.19.134 is not allowed to talk to us!
Each log is the same (6 of them) apart from the nrpe[2716] which increase each time by 2.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

You will need to restart nrpe on the remote host every time you change the nrpe.cfg file. As you installed from a package, you may have to restart it one of two ways:

Try this on first:

Code: Select all

/etc/init.d/nrpe restart
Then run:

Code: Select all

ps -aef |grep nrpe
To verify you restarted the right one.

The other way to restart nrpe is usually specific to the source install, so DO NOT RUN this one unless you are sure you need to:

Code: Select all

service xinetd restart
At the bottom of teh nrpe.cfg, you should have some command definitions, they will look like:
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200

Could you post your nrpe.cfg from the remote host and the commands.cfg from the nagios server?
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 used the restart command, still remains the same

In regards to the commands at the bottom I have 4 of them

Code: Select all

#command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $
#command[check_procs=usr/lib/nagios/plugins/check_procs -w $ARGS1$ -c $ARG2$ -$
Working on the configs now.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

If you notice, all 4 of those checks are commented out (#). Remove the # before them to enable them. Your nagios server should be allowed to talk to your client at this point. So this is really strange. Are you sure you have restarted the right one and you are editing the right 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