Nsclient++ Check_Mem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post 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%)
Attachments
Sem título.JPG
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nsclient++ Check_Mem

Post 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.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post by tenda21 »

know where is this plugin to make the necessary changes?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nsclient++ Check_Mem

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nsclient++ Check_Mem

Post 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)
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post by tenda21 »

to be able to use the command check_mem have to create a script?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nsclient++ Check_Mem

Post 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]
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nsclient++ Check_Mem

Post by slansing »

Is that the only nsclient/nsc.ini file in your installation directory? That looks like a sample.
Locked