Nsclient++ Check_Mem
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nsclient++ Check_Mem
Did you copy your nsclient/nsc.ini file? Or manually remove a large chunk of it, even for the unexpanded file yours is very bare. You may need to look at re-installing nsclient, perhaps version 3.9.x instead of 4.0.x as it will already be expanded and should work from the start.
Re: Nsclient++ Check_Mem
Steps you need to do:
On Windows remote client you are monitoring:
You can leave everything else as default for now.
Start the NSClient service from services.msc
On your Nagios box
Install check_nrpe as the root user - so change to the root user in a terminal
The actual service check for the host
The command check for check_memory
This is it - you will now have your memory monitored using check_nrpe via NSClient.
You need to do no more.
On Windows remote client you are monitoring:
- Install NSClient++ - do not start the service.
Check whatever firewall is on the machine (if any) and make sure port 5666 is open. Do a telnet from your nagios machine to remote server ip 5666 to check.
Open up a cmd prompt and type in "cd C:\Program Files\NSClient++" without the "" - hit enter
type in "nscp settings --generate --add-defaults --load-all" - without the "" - hit enter
Go into C:\program files\nsclient++ and open up the nsclient.ini file
Code: Select all
; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1Code: Select all
; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = your nagios servers IPCode: Select all
; Section for NRPE (NRPEServer.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true
; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = true
; PORT NUMBER - Port to use for NRPE.
port = 5666Start the NSClient service from services.msc
On your Nagios box
Install check_nrpe as the root user - so change to the root user in a terminal
- cd ~/downloads
wget http://sourceforge.net/projects/nagios/ ... z/download
tar xzf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure
make all
make install-plugin
The actual service check for the host
Code: Select all
define service{
use your template ; See Service Templates section below
host_name your host
service_description MEMORY USAGE
check_command check_memory ; See Commands section below
}
Code: Select all
# 'check_memory' command defintion
define command{
command_name check_memory
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c checkMEM -a MaxWarn=XX% MaxCrit=XX% type=physical
}
You need to do no more.
Re: Nsclient++ Check_Mem
but wrong result:
Error: /usr/local/nagios/libexec/check_nrpe -H 192.168.1.218 -c check_memory
UNKNOWN: No handler for that command
Have version 3.9. as recommended slansing
Error: /usr/local/nagios/libexec/check_nrpe -H 192.168.1.218 -c check_memory
UNKNOWN: No handler for that command
Have version 3.9. as recommended slansing
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nsclient++ Check_Mem
Excellent outline FTL,
By default, NSClient++ has a handful of NRPE definitions which are slotted with "alias_" in front of them, give this one a shot:
If you look in your NSC.ini file, you should see this:
By default, NSClient++ has a handful of NRPE definitions which are slotted with "alias_" in front of them, give this one a shot:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.218 -c alias_memCode: Select all
alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=pageRe: Nsclient++ Check_Mem
Done
works, solved the problem changing NSClient + + 4.2.x, NSClient++ 3.9.x, and using alias mem.
Tanks for help
works, solved the problem changing NSClient + + 4.2.x, NSClient++ 3.9.x, and using alias mem.
Tanks for help
Re: Nsclient++ Check_Mem
No..........."check_memory" is just what i have called my own command is isnt the actual command parameter.tenda21 wrote:but wrong result:
Error: /usr/local/nagios/libexec/check_nrpe -H 192.168.1.218 -c check_memory
UNKNOWN: No handler for that command
Have version 3.9. as recommended slansing
The actual check_nrpe command is checkMEM
so its
Code: Select all
check_nrpe -H 192.168.1.218 -p 5666 -c checkMem -a Maxwarn=90% Maxcrit=95% type=physicalRe: Nsclient++ Check_Mem
@tenda21
I am glad your issue has been resolved! I am locking this topic.
@FTL
Thanks for the help!
I am glad your issue has been resolved! I am locking this topic.
@FTL
Thanks for the help!
Be sure to check out our Knowledgebase for helpful articles and solutions!