need help to monitor remote server
need help to monitor remote server
I try to monitor remote host, so I add remote host as indicated in the attached file, but it only works for current load and current users, and it fails for other services. Thanks very much for your help.
- Attachments
-
ddctst101.cfg- remote host
- (5 KiB) Downloaded 546 times
-
nrpe.server.cfg- nrpe on nagios master
- (7.8 KiB) Downloaded 548 times
-
nrpe.client.cfg- nrpe on remote host
- (7.81 KiB) Downloaded 532 times
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: need help to monitor remote server
So for check_users, here is why it works:
ddctst101.cfg
nrpe.client.cfg
Nagios looks at ddctst101.cfg and uses the argument "check_users" which it sends over to the client.
The client is listening and looks in it's config. It sees a command called "check_users" so it executes it and returns the result.
Now if you look at one that doesn't work:
ddctst101.cfg
nrpe.client.cfg
The reason why this doesn't work is because nagios uses the argument "check_procs" which it sends over to the client.
The client is listening and looks in it's config. It doesn't have a command called "check_procs" so it fails.
However there is a command defined called "check_total_procs" and if you changed ddctst101.cfg to use "check_total_procs" instead of "check_procs", it would work.
Does that make sense?
ddctst101.cfg
Code: Select all
check_command check_nrpe!check_usersCode: Select all
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10The client is listening and looks in it's config. It sees a command called "check_users" so it executes it and returns the result.
Now if you look at one that doesn't work:
ddctst101.cfg
Code: Select all
define service{
use generic-service ; Name of service template to use
host_name ddctst101
service_description Total Processes
check_command check_nrpe!check_procs
}Code: Select all
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200The client is listening and looks in it's config. It doesn't have a command called "check_procs" so it fails.
However there is a command defined called "check_total_procs" and if you changed ddctst101.cfg to use "check_total_procs" instead of "check_procs", it would work.
Does that make sense?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: need help to monitor remote server
Thanks for your help. It works. However, I have another issue with check swap.
Here is content in nrpe.client.cfg
.....
command[check_swap]=/usr/local/nagios/libexec/check_swap -H localhost -w 20 -c 10
...
On Nagios master dashboard, on the line Swap usage under status information: Missing Host or Password arguments.
Could you please help for this issue? I really appreciate for your help.
Here is content in nrpe.client.cfg
.....
command[check_swap]=/usr/local/nagios/libexec/check_swap -H localhost -w 20 -c 10
...
On Nagios master dashboard, on the line Swap usage under status information: Missing Host or Password arguments.
Could you please help for this issue? I really appreciate for your help.
Re: need help to monitor remote server
Can you post the service config for the service that runs check_nrpe for the swap usage? You likely are missing a -H in the check_nrpe args or you do not have a password defined.
Former Nagios employee
Re: need help to monitor remote server
FIles attached.
- Attachments
-
swap.docx- snapshot of swap detail
- (264.39 KiB) Downloaded 362 times
-
nrpe.client.cfg- nrpe.cfg on remote host
- (8.05 KiB) Downloaded 506 times
-
ddctst101.cfg- remote host
- (4.99 KiB) Downloaded 506 times
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: need help to monitor remote server
The plugin check_swap does not use the -H argument. Change it to:ducle99 wrote:command[check_swap]=/usr/local/nagios/libexec/check_swap -H localhost -w 20 -c 10
Code: Select all
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20 -c 10As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: need help to monitor remote server
Yes, I have tried check_swap without -H option, but I still get the same error.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: need help to monitor remote server
On the remote host, show us the output of:
I get:
SWAP OK - 100% free (1983 MB out of 1983 MB) |swap=1983MB;0;0;0;1983
Code: Select all
su nagios
/usr/local/nagios/libexec/check_swap -w 20 -c 10SWAP OK - 100% free (1983 MB out of 1983 MB) |swap=1983MB;0;0;0;1983
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: need help to monitor remote server
/usr/local/nagios/libexec/check_swap -w 20 -c 10
Missing Host or Password arguments
/usr/local/nagios/libexec/check_swap version 1.9.2 last updated 03.17.2011
* OVERVIEW *
This utility was written 10/25/2004 as a method for automating
the collection of SNMP based information, for the ultimate goal
of pushing the result to Nagios.
* USAGE *
/usr/local/nagios/libexec/check_swap ARGS
ARGS:
-v Print version and exit
-h Print this help message
-d n Turn debug on at level n (1-3)
-H SNMP (remote) host to poll
-w n Warning level (alert if free swap (MB) drops below this)
n% Warning level (alert if % of swap free drops below this)
-c n Critical level
n% Critical level
-p SNMP Community password on remote host
All options can be prefixed with a single or double "-".
All options are case sensitive and only eval the first character
(e.g. --debug is the same as --d, -d, -debug)
Missing Host or Password arguments
/usr/local/nagios/libexec/check_swap version 1.9.2 last updated 03.17.2011
* OVERVIEW *
This utility was written 10/25/2004 as a method for automating
the collection of SNMP based information, for the ultimate goal
of pushing the result to Nagios.
* USAGE *
/usr/local/nagios/libexec/check_swap ARGS
ARGS:
-v Print version and exit
-h Print this help message
-d n Turn debug on at level n (1-3)
-H SNMP (remote) host to poll
-w n Warning level (alert if free swap (MB) drops below this)
n% Warning level (alert if % of swap free drops below this)
-c n Critical level
n% Critical level
-p SNMP Community password on remote host
All options can be prefixed with a single or double "-".
All options are case sensitive and only eval the first character
(e.g. --debug is the same as --d, -d, -debug)
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: need help to monitor remote server
This must be a 3rd party check_swap plugin. Can you try the check_swap plugin from the official nagios plugins?
http://www.nagios.org/download/plugins
http://www.nagios.org/download/plugins