Page 7 of 9

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:14 pm
by abrist
If it would be easier, you could just post a screenshot of the service config in XI.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:17 pm
by A.Cormack
Ok so I didnt your command and found several listed, but the one that looked similar to yours was

Code: Select all

nagios    1793     1  0 16:48 ?        00:00:06 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
So I went to

Code: Select all

/usr/local/nagios/etc/nagios.cfg
and found

Code: Select all

# OBJECTS - UNMODIFIED
#cfg_file=/usr/local/nagios/etc/objects/commands.cfg
#cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
#cfg_file=/usr/local/nagios/etc/objects/templates.cfg
#cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg

# STATIC OBJECT DEFINITIONS (THESE DON'T GET EXPORTED/IMPORTED BY NAGIOSQL)
cfg_dir=/usr/local/nagios/etc/static

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:20 pm
by abrist
Your check in XI should look like the attached picture (you will need to include a config name and description obviously).

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:25 pm
by A.Cormack
The CPU Usage service looks like the following..

Image

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:48 pm
by abrist
So you are embedding all of the args in the xi check itself. That means you need to edit the nrpe.cfg on the remote host to reflect that. Additionally, you do not have that command definition name (check_cpu_stats) declared in your nrpe.cfg:

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 $ARG3$
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
As the arguments are declared in XI, you should change the nrpe.cfg to only declare 1 argument that will get passed the warning and crit level from XI.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 1:52 pm
by A.Cormack
But I do have check_disk and check_procs declared, but their still giving me the CHECK_NRPE error?

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:01 pm
by abrist
Could I see those checks in XI? If you declare all your arguments in XI, you will need to edit the remote host nrpe.cfg to reflect that. There are a few different ways to setup checks between nrpe and XI, the important thing is that they are consistent. For example:

For check_users in XI:

Code: Select all

$ARG1$ check_users
$ARG2$ -a '-w 5 -c 10'
Then in nrpe.cfg:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$


OR



For check_users in XI:

Code: Select all

$ARG1$ check_users
$ARG2$ blank
Then in nrpe.cfg:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10


OR



For check_users in XI:

Code: Select all

$ARG1$ check_users
$ARG2$ -a '5 10'
Then in nrpe.cfg:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:08 pm
by A.Cormack
Image

Image

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:24 pm
by abrist
In all of your commands, you are declaring the arguments directly in the XI check. So you need to alter your nrpe.cfg to reflect that:

For example, the check users command in nrpe.cfg should just have an $ARG1$ after it:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$
The same with check_disk:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
check_services is not declared in your nrpe.cfg, and you probably do not have the plugin as well.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:36 pm
by A.Cormack
Ok so I went into nrpe.cfg file and change it from

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p$
to

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Rebooted the server, but Nagios still says the same

--
I was unware that you had to install a plug-in for a service in which Nagios offers you during the configuration wizard.