Page 4 of 9
Re: Monitoring Ubuntu, Agent File
Posted: Thu Jan 31, 2013 10:10 am
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:
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.
Re: Monitoring Ubuntu, Agent File
Posted: Thu Jan 31, 2013 10:23 am
by slansing
Did you run:
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:
Then check the system log and let us know what it output:
Re: Monitoring Ubuntu, Agent File
Posted: Thu Jan 31, 2013 1:27 pm
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.
Re: Monitoring Ubuntu, Agent File
Posted: Thu Jan 31, 2013 2:23 pm
by slansing
Sounds good let us know the outcome of the last message.
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 11:43 am
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.
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 12:30 pm
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)?
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 12:43 pm
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..
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
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.
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 2:41 pm
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:
Then run:
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:
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?
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 3:16 pm
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.
Re: Monitoring Ubuntu, Agent File
Posted: Fri Feb 01, 2013 3:20 pm
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?