Page 3 of 4

Re: Nsclient++ Check_Mem

Posted: Wed Mar 12, 2014 3:31 am
by tenda21
yes, is the only configuration file . I have one more

Re: Nsclient++ Check_Mem

Posted: Wed Mar 12, 2014 6:19 am
by tenda21
help me create script for edit ok in status information.

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: Wed Mar 12, 2014 10:32 am
by slansing
You should be able to find a windows memory check plugin our our exchange that will work with NRPE, and alter that. You will need to make the changes, we can help give guidance:

http://exchange.nagios.org/index.php?op ... s%20memory

Re: Nsclient++ Check_Mem

Posted: Wed Mar 12, 2014 10:46 am
by tenda21
which recommends?

Re: Nsclient++ Check_Mem

Posted: Wed Mar 12, 2014 2:37 pm
by abrist
Any of them - depends on your requirements, etc.

Re: Nsclient++ Check_Mem

Posted: Thu Mar 13, 2014 5:35 am
by tenda21
how to tell nagios to run the script memory.sh check process, to collect information in windows server

http://exchange.nagios.org/directory/Pl ... ng/details

Re: Nsclient++ Check_Mem

Posted: Thu Mar 13, 2014 5:59 am
by tenda21
I make:

commands.cfg

Code: Select all

define command{
        command_name            check_mem.sh
        command_line            $USER1$/home/check_mem.sh -H $HOSTADDRESS$
}

windows.cfg

define service{
        use                     generic-service
        host_name               winserver
        service_description     memory
        check_command           check_mem.sh
        }
but not work

the Nagios plugins do not include check_mem:

Code: Select all

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
}

Code: Select all

define service{
        use                     generic-service
        host_name               teste
        service_description     Memori
        check_command           check_nrpe!check_mem
}
Command not found

I used:

commands.cfg

Code: Select all

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

Code: Select all

define service{
use generic-service
host_name teste
service_description Memory
check_command check_mem
}
but result wrong result:

Code: Select all

Result= OK:
'committed'=1GB;3;4;0;4 'committed %'=29%;79;89;0;100 'physical'=1GB;2;2;0;2 'physical %'=47%;79;89;0;100
Computer have 3G RAM

To expand:

Code: Select all

check_nt!MEMUSE MaxWarn=80% MaxCrit=90% ShowAll type=page
check_nt $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
-> $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v MEMUSE MaxWarn=80% MaxCrit=90% ShowAll type=page (undefined)
where defined page

Merged your five posts, do not post multiple times in a row as that will bump you lower on our "to be replied to" list. Simply edit your previous post to add new info, also, use code-wraps as has been shown before so it is easier to read your text... - Slansing

Re: Nsclient++ Check_Mem

Posted: Thu Mar 13, 2014 11:37 am
by lmiltchev
Your nsclient.ini file is not complete... Take a look at the top portion of the file. You will need to run the following command in CMD on the Windwos box to load all of the defaults:

Code: Select all

nscp settings --generate --add-defaults --load-all
Then you will have to set up a command under external scripts, something like this one:

Code: Select all

check_physical_memory=checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Restart the NSClient++ service, so that changes can take effect.

Test it from the nagios server:

Code: Select all

./check_nrpe -H <client IP> -c check_physical_memory

Re: Nsclient++ Check_Mem

Posted: Thu Mar 13, 2014 11:57 am
by tenda21
rum command and obtain error:

Re: Nsclient++ Check_Mem

Posted: Thu Mar 13, 2014 12:48 pm
by lmiltchev
I believe you need to go to the nsclient dir. Usually it's in:

Code: Select all

cd "c:\Program Files\NSClient++"