NSCLIENT problem with windows performance monitor counters

Arjan de Graaff arjan at pwc-mas.nl
Fri Nov 8 16:35:20 CET 2002


Found the solution :-)) (thought you would like to know)

It is a bug in the program. The procedure PdhCollectQueryData is called to
retreve the counter value from perfmon but it is only called once. (see
explination)

Obtaining the value of rate counters such as Page faults/sec requires that
PdhCollectQueryData be called twice, with a specific time interval between
the two calls, before calling PdhGetFormattedCounterValue

I created a new routine in nsclient, it now works like it is supposed to. i
only have to test in on some systems for a longer period than 5 minutes to
see if it keeps working.
When it is finished i will post it for yoall.

Arjan

PS.
Is there anyone who already corrected this problem?


-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of
Arjan at pwc-mas.nl
Sent: donderdag 7 november 2002 17:34
To: Nagios-Users; Tom Lichti
Subject: RE: [Nagios-users] NSCLIENT problem with windows performance
monitor counters


I just debugged part of the NSCLIENT and the third argument is parces
correctly to the program and counter requested is the correct one in the
folowing procedure wich is called. I checked the sCounter here and it is the
same as typed after check_nt.

The arguments given with check_nt are when received by nsclient first put in
a araay, the 3 element of the array (asArgv[2]) is parced to the
ProcessCounterReq and put in sCounter.
I checked the sCounter here and it is the same as typed after check_nt.

function TNSClient.ProcessCounterReq(sCounter : string) : string;
   var
      qryPDHQuery : HQUERY;
      custom_counter : HCOUNTER;
      lStatus : cardinal;
   begin

//    DEBUGGING CODE !!!!!!!!
      WriteToEventLog('NSClient DEBUG: Custom Counter : ' + sCounter,0);
.
.
.
.
end;


-----Original Message-----
From: Tom Lichti [mailto:tom at redpepperracing.com]
Sent: donderdag 7 november 2002 16:09
To: Arjan at pwc-mas.nl
Subject: Re: [Nagios-users] NSCLIENT problem with windows performance
monitor counters


Try putting a '\' in front of the '/'. It might parse ok then.

Tom

--On Thursday, November 07, 2002 9:10 AM +0100 "Arjan at pwc-mas.nl"
<arjan at pwc-mas.nl> wrote:

> Hi,
>
> We had sometrouble retriving counters values from the NT4 and W2000
> performance monitor.
> I have found that when you try to retrive a counter which contains a
> '/' inthe name you will get a number back that makes no sense.
> I tryed to do this with several counters containing forward slahes and
> found the same problems. (all counter with something/sec)
> I get a value wich constantly changes but you can only see this when
> you look at 6 decimal digits. Also if you compare the value that is
> returned with the value given to you by performance monitor it makes
> no sense
>
> Example:
> ./check_nt -H 10.11.250.10 -v COUNTER -l "\\Memory\\Page
> Faults/sec","%.6f"
>
> because of the '/' in "Page Faults/sec" something goes wrong with the
> query.
> What is the value i get and how can i get the value i requested?
>
> Hope you can give me an answer to this problem,
>
> Arjan.
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm
> Tungsten T handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en




More information about the Users mailing list