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 »

yes, is the only configuration file . I have one more
Attachments
nsclient.ini
(859 Bytes) Downloaded 313 times
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

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

Re: Nsclient++ Check_Mem

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

Re: Nsclient++ Check_Mem

Post by tenda21 »

which recommends?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nsclient++ Check_Mem

Post by abrist »

Any of them - depends on your requirements, etc.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

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

Re: Nsclient++ Check_Mem

Post 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
Last edited by slansing on Thu Mar 13, 2014 9:56 am, edited 2 times in total.
Reason: 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 te
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nsclient++ Check_Mem

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
tenda21
Posts: 37
Joined: Tue Feb 25, 2014 7:55 am

Re: Nsclient++ Check_Mem

Post by tenda21 »

rum command and obtain error:
Attachments
Sem título.JPG
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nsclient++ Check_Mem

Post by lmiltchev »

I believe you need to go to the nsclient dir. Usually it's in:

Code: Select all

cd "c:\Program Files\NSClient++"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked