NSClient++ Help (#1) - checkMEM -> define service ? (#950) - Message List

checkMEM -> define service ?

Help... plz...

I'm having problem understand the define service syntax for NSClient checkMEM.

It's not a problem with NSClient++, it works!, but I have tried several syntax for the checkMEM without luck... Hope you can help.

Monitor Remote
Server Win2k8 64bit
NSClient++ 0.3.9.328
NSC.ini: alias_mem=checkMem MaxWarn=90% MaxCrit=95% type=physical

Monitor Server
Linux(Ubuntu) - Nagios
NRPE Version: 2.12

commands.cfg:
define command {

command_name CheckMEM
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckMEM -a MaxWarn=$ARG2$% MaxCrit=$ARG3$% ShowAll type=physical
}

windows.cfg
define service{

use generic-service
host_name <MISC SERVERSHOST>
service_description Memory Usage - Physical
check_command CheckMEM!????????????????????????????????
}

How should this looks like to before it works! I have a CRITICAL alarm no matter what I type in the check_commands "CheckMEM bla bla bla...."

Current Status: CRITICAL (for 0d 1h 2m 34s) Status Information: CRITICAL: physical memory: Total: 128G - Used: 99.7G (77%) - Free: 28.3G (23%) > critical Performance Data: 'physical memory %'=77%;0;0 'physical memory'=107075739648B;0;0;0;137428119552 Current Attempt: 3/3 (HARD state)

Normal Commands are working fine

# ./check_nrpe -H <IP> -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
OK: physical memory: 99.7G|'physical memory %'=77%;80;90 'physical memory'=99.71GB;102.39;115.19;0;127.99

But I don't see this output when trying in a define services. Plz help if time, need the know the physical memory. check_nt gives physical+page, that I can't use.

I have same issue on Win2k3 32bit.

Tree View Flat View (newer first) Flat View (older first)
  • Message #2511

    Solution: was a bit wierd... 2X !

    check_command CheckMEM!!92%!97%

    Is it common !! are required when using NSClient++ internal scripts/features?

  • Message #2512

    Actually not weird at all:

    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckMEM -a MaxWarn=$ARG2$% MaxCrit=$ARG3$% ShowAll type=physical
    

    Your command says to use $ARG2$ and $ARG3$ which means you "discard" the first one... Change into this:

    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical
    

    And I think it will work as you expect it...

    Michael Medin

  • Message #2513

    Thank you...

    I found this deeper in the commands.cfg file...

    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -n

    and because of that it would not work with $ARG1$ and $ARG2$...

    I have now change it to one check_nrpe with correct arguments... and now it seems to work correct...

    Thank you for you help.

    TJ

Tree View Flat View (newer first) Flat View (older first)

Subscriptions