Page 2 of 4

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 9:46 am
by tenda21
Anyone know how to change the ok, the status information and put something like: Memory usage: total: 3838.52 Mb - used: 1178.90 Mb (31%) - free: 2659.61 Mb (69%)

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 10:48 am
by slansing
That change would have to be made to the plugin that is running the check, as that is what is responsible for this status output.

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:03 am
by tenda21
know where is this plugin to make the necessary changes?

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:08 am
by sreinhardt
The plugin is likely check_nt. This is a compiled c program, so you will need to find the source code from our nagios-plugins github account or write a wrapper script to call instead and alter it.

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:15 am
by tenda21
I'm using the alias of NSClient + +, would not use the nrpe make make the query to a windows server:

My configuracion:

define service{
use generic-service
host_name teste
service_description Memory
check_command check_nrpe!alias_mem
}

But a teste:

In commands.cfg

define command {
command_name check_mem
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c CheckMem -a type=physical MaxWarn=$ARG1$ MaxCrit=$ARG2$ ShowAll=long
}

In test.cfg
define service{
use generic-service
host_name test
service_description RAMss
check_command check_mem
}

But nagios display: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:20 am
by sreinhardt
OK, so you are using check_nrpe, it is still a compiled c program and the source would need to be modified or a wrapper script created to call it and then alter the output. If you wish to look at the source, it is on our sourceforge account for nrpe(included with the linux daemon)

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:24 am
by tenda21
to be able to use the command check_mem have to create a script?

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:28 am
by sreinhardt
No, likely you just need to enable it on your nsclient system. Could you post your nsc.ini please? Also run:

Code: Select all

nmap -p 5666 [host\IP of nsclient system]

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 11:35 am
by tenda21
nsclient-sample.ini
(23.76 KiB) Downloaded 408 times
I have Nsclien++ 4.2.8

Nmap result:
Starting Nmap 5.21 ( http://nmap.org ) at 2014-03-11 16:04 WET
Nmap scan report for 192.168.1.218
Host is up (0.00093s latency).
PORT STATE SERVICE
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds

Re: Nsclient++ Check_Mem

Posted: Tue Mar 11, 2014 4:12 pm
by slansing
Is that the only nsclient/nsc.ini file in your installation directory? That looks like a sample.