Memuse returns 0% using Win 2000 and NSClient



I’m using Nagios 2.0b2. I also have installed NSCLient in a Windows 2000.
I’ve added this line to the file checkcommands.cfg:

‘check_nt_cpuload’ command definition

define command{
command_name check_nt_memuse
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v MEMUSE -w $ARG1$ -c $ARG2$

and these ones to services.cfg:

define service{
use gs
host_name ITD057
service_description NT_MEMUSE
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_nt_memuse!60!90
contact_groups gsystems

The problem is I always get this result: Memory usage: total:0.00 Mb - used: 0.00 Mb (nan%) - free: 0.00 Mb (nan%)
I understand the command give me and advice when the memory is up to 60 and 90 %. But I always get 0 %. And this value should be the physical memory + the swap size.

So, what’s wrong ?
Thank you !


what happens if you run the command from command line?



I get the same result: Memory usage: total:0.00 Mb - used: 0.00 Mb (nan%) - free: 0.00 Mb (nan%)

Any idea ?
I’ve tried loading the computer almost until 100 %, but nothing happens… I get 0%


Is it a localized windows version? If yes you could try using a counter

$USER1$/check_nt -H $HOSTADDRESS$ -v COUNTER -l “PUT NAME OF COUNTER HERE”,“output expression”

you should use the exact name of the CPU load counter you fins in windows performance monitor.



This is an spanish version of Win 2000.
I really don’t know what a counter is, and how to use it.
Could you please explain me more about it ?

Thank you.


I just checked the counter.defs file supplied with the latest nsclient and it looks like the win2k info is missing for both Spanish and Portugese. Looking at what is missing from the Spanish version (copy/paste from the English part):

W2K_SystemTotalProcessorTime = "\Processor(_total)% Processor Time"
W2K_SystemSystemUpTime = "\System\System Up Time"
W2K_MemoryCommitLimit = "\Memory\Commit Limit"
W2K_MemoryCommitByte = “\Memory\Committed Bytes”

I’m pretty sure this is what is causing your problems. It looks like you’d have to find out the SPanish equivalents for this and add them to your counters.defs file.

Hope this helps.

Edited Thu Apr 07 2005, 04:44PM ]


you mosty probably need to duoble the backslashes :wink:

"\Processor(_total)\% Processor Time"
By the way this is a counter. Use the performance monitor to find the exact names of the counters you need to check




the version of counter.defs I’m using has the spanish definition. This is:
Description = "Spanish"
NT4_SystemTotalProcessorTime = "\Sistema% Tiempo total de
NT4_SystemSystemUpTime = "\Sistema\Tiempo de actividad del sistema"
NT4_MemoryCommitLimit = "\Memoria\Límite comprometido"
NT4_MemoryCommitByte = “\Memoria\Bytes comprometidos”

So, the 2 last values are working fine.

./check_nt -H -v COUNTER -l "\Memoria\Bytes comprometidos"
./check_nt -H -v COUNTER -l "\Memoria\Límite comprometido"

But the 2 first values just returns 0.
And why this command always return 0 ??:
check_nt -H $HOSTADDRESS$ -v MEMUSE -w $ARG1$ -c $ARG2$

I’m using this list of commands, too:

check_nt -H $HOSTADDRESS$ -v COUNTER -l $ARG1$ -w $ARG2$ -c $ARG3$

check_nt_counter!"\Paging File(_Total)\%% Usage",“Paging file usage is %.2f %%”!80!90
check_nt_counter!"\Process(_Total)\Thread Count",“Thread Count: %.f”!600!800
check_nt_counter!"\Server\Server Sessions",“Server Sessions: %.f”!20!30

and all them return always 0. I understand I should have them defined in counters.defs in spanish language, but I don’t know how or where to find the correct name for a Windows 2000.

And also this command returns 0:

./check_nt -H -v UPTIME
System Uptime : 0 day(s) 0 hour(s) 0 minute(s)

Any help will be appreciate :slight_smile: Thank you very much !


Well, what I’m seeing is in counter.defs the spanish definition has lines only for NT4 parameters. But on the english section there are also these lines for win2000:

W2K_SystemTotalProcessorTime = "\Processor(_total)% Processor Time"
W2K_SystemSystemUpTime = "\System\System Up Time"
W2K_MemoryCommitLimit = "\Memory\Commit Limit"
W2K_MemoryCommitByte = “\Memory\Committed Bytes”

But where to get the right parameters, in spanish ?


Windows 2000 Performance Monitor.



I think you have two choices. Using CPU as the example.

  1. Update the counter.defs on the checked machine with the correct counters. You can find them from running performance monitor on the box as Luca stated. You should then be able to use the -v CPULOAD switch in the command. So you have a command like
    $USER1$/check_nt -H $HOSTADDRESS$ -v CPULOAD -w $ARG1$ -c $ARG2$
  2. Change the check command to -v COUNTER and put the counter on your Nagios box. e.g.
    $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v COUNTER -l
    "\Processor(0)% Processor Time",“CPU 1 Load” -w $ARG1$ -c $ARG2$

THe other thing is to check that you are using the latest version of pnsclient. I messed around for days getting zeroes before upgrading to 2.0.1 and everything suddenly started working…


Ok, both you where right: I went to Perfomance Monitor, and I’ve added some of them.
Then, all this commands are working fine (in spanish):

./check_nt -H -v COUNTER -l “\Procesador(_Total)% tiempo de procesador”
./check_nt -H -v COUNTER -l “\Interfaz de red(Realtek RTL8139_810x Family Fast Ethernet NIC)\Total de s.”

./check_nt -H -v COUNTER -l “\Memoria\Bytes de caché”
./check_nt -H -v COUNTER -l “\Memoria\Bytes comprometidos”
./check_nt -H -v COUNTER -l “\Memoria\Bytes de memoria no paginable”
./check_nt -H -v COUNTER -l “\Memoria\Bytes de memoria paginable”
./check_nt -H -v COUNTER -l “\Memoria\Escrituras de página/s.”
./check_nt -H -v COUNTER -l “\Memoria\KBytes disponibles”
./check_nt -H -v COUNTER -l “\Memoria\Lecturas de página/s.”
./check_nt -H -v COUNTER -l “\Memoria\MBytes disponibles”
./check_nt -H -v COUNTER -l “\Memoria\Límite comprometido”
./check_nt -H -v COUNTER -l “\Memoria\Páginas de salida/s.”
./check_nt -H -v COUNTER -l “\Memoria\Páginas de entrada/s.”
./check_nt -H -v COUNTER -l “\Memoria\Páginas/s.”
./check_nt -H -v COUNTER -l “\Memoria\Uso máximo de los bytes de caché”

./check_nt -H -v COUNTER -l “\Sistema\Procesos”
./check_nt -H -v COUNTER -l “\Sistema\tiempo de actividad del sistema”

./check_nt -H -v COUNTER -l "\TCP\Segmentos enviado/s. >
./check_nt -H -v COUNTER -l “\TCP\Segmentos enviado/s.”
./check_nt -H -v COUNTER -l “\TCP\Segmentos recibido/s.”

The version of NSClient I’m using on Win 2000 is 2.0.1 .

The only problem is sometimes I don’t know wich is the unity of the value returned by the commands :slight_smile: but I’m gonna keep searching…

Thank you again for your help.