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 »

If it would be easier, you could just post a screenshot of the service config in XI.
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 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post by abrist »

Your check in XI should look like the attached picture (you will need to include a config name and description obviously).
You do not have the required permissions to view the files attached to this post.
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 »

The CPU Usage service looks like the following..

Image
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post 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.
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 »

But I do have check_disk and check_procs declared, but their still giving me the CHECK_NRPE error?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post 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$
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 »

Image

Image
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring Ubuntu, Agent File

Post 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.
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 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.
Locked