Get Any Windows Performance Monitor Counter (Program)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
jbritton
Posts: 4
Joined: Tue Jun 24, 2008 1:24 pm

Get Any Windows Performance Monitor Counter (Program)

Post by jbritton »

I have created a .NET executable that allows you to get any perfmon statistic from the command line. There is a README.TXT included to explain how to use it. Also, the tool is an open source project on Sourceforge: http://sourceforge.net/projects/getperfmon

I have created many scripts using this, I will post some templates later.
Attachments
GetPerfmon-bin-1.4.zip
(17.02 KiB) Downloaded 653 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You realize another user had already created something like this too: http://forums.cacti.net/viewtopic.php?t=25600

Always a good thing to have variety.
ejensen
Cacti User
Posts: 55
Joined: Mon Jul 12, 2004 11:39 am

Post by ejensen »

I looked into using both of these yesturday and so far I have to say I like this one better because of ease of use. This one allows you to specify perfmon counters by name and therefore you dont have to know the OIDs and index numbers for each server you want to monitor. Plus with this one you dont have to load any agents (dll's) on the servers, just run this utility and point it to a host along with the perfmon counter you want and it quickly returns the results.

I think anyone looking to impliment perfmon counters should really give this script a try.

Like you said BSOD Always good to have variety.

Keep up the good work jbritton and I look forward to you posting your scripts.
ejensen
Cacti User
Posts: 55
Joined: Mon Jul 12, 2004 11:39 am

Post by ejensen »

I do have a 'feature request' for this program that you wrote jbritton.

Would it be possible to enable wild cards in the "instancename" field?

Here is an example I am trying to get around:
I want to graph "Network Interface \ Output Queue Length" but the instance name is always the name of the NIC in the server, and can be different for each server. There is no _Total for this counter.

I imagine I could get Cacti to first index all the names of the NICs and then display them for me to choose which one to graph this counter, but I'm not that smart with Cacti yet... will look into that soon.

It would be nice to be able to use a wild card or index number or maybe aggregated total for all indexes.

so the command would look like this:
"GetPerfMon.exe host "Network Interface,Output Queue Length,@,Total"

Any thoughts on this?

thanks,
Eric
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

ejensen wrote:I do have a 'feature request' for this program that you wrote jbritton.

Would it be possible to enable wild cards in the "instancename" field?

Here is an example I am trying to get around:
I want to graph "Network Interface \ Output Queue Length" but the instance name is always the name of the NIC in the server, and can be different for each server. There is no _Total for this counter.

I imagine I could get Cacti to first index all the names of the NICs and then display them for me to choose which one to graph this counter, but I'm not that smart with Cacti yet... will look into that soon.

It would be nice to be able to use a wild card or index number or maybe aggregated total for all indexes.

so the command would look like this:
"GetPerfMon.exe host "Network Interface,Output Queue Length,@,Total"

Any thoughts on this?

thanks,
Eric
I cannot be sure about this particular program, but in other cases where you're reading performance counters remotely, you cannot wildcard the counter you're trying to read. It must be called explicitly.

What you can do is build a script that takes the name of the interface on the command line and passes it in as a variable and then concatenated with the rest of the performance counter information.
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
Jesper
Posts: 45
Joined: Mon Mar 11, 2002 7:00 pm

Re: Get Any Windows Performance Monitor Counter (Program)

Post by Jesper »

Thank you Jbritton,

This is brilliant!!! One question though; what if there are commas in either Object, Counter or Instance? How to I specify the arguments in such a case?

--
Greetings
/Jesper
jbritton
Posts: 4
Joined: Tue Jun 24, 2008 1:24 pm

Re: Get Any Windows Performance Monitor Counter (Program)

Post by jbritton »

Jesper wrote:Thank you Jbritton,

This is brilliant!!! One question though; what if there are commas in either Object, Counter or Instance? How to I specify the arguments in such a case?

--
Greetings
/Jesper
Do you have a counter that has a comma in it? I can change the seperator to something more unusual, like the pipe or something.
jbritton
Posts: 4
Joined: Tue Jun 24, 2008 1:24 pm

re: Feature Request

Post by jbritton »

ejensen wrote:I do have a 'feature request' for this program that you wrote jbritton.

Would it be possible to enable wild cards in the "instancename" field?

Here is an example I am trying to get around:
I want to graph "Network Interface \ Output Queue Length" but the instance name is always the name of the NIC in the server, and can be different for each server. There is no _Total for this counter.

I imagine I could get Cacti to first index all the names of the NICs and then display them for me to choose which one to graph this counter, but I'm not that smart with Cacti yet... will look into that soon.

It would be nice to be able to use a wild card or index number or maybe aggregated total for all indexes.

so the command would look like this:
"GetPerfMon.exe host "Network Interface,Output Queue Length,@,Total"

Any thoughts on this?

thanks,
Eric
I will look into this, there should be a way to enumerate the counters (currently I don't)
Jesper
Posts: 45
Joined: Mon Mar 11, 2002 7:00 pm

Re: Get Any Windows Performance Monitor Counter (Program)

Post by Jesper »

jbritton wrote: Do you have a counter that has a comma in it? I can change the seperator to something more unusual, like the pipe or something.
Yes, I have commas in Instances. I'm not sure that pipe is a good choice at the command prompt, or?

How about letting us specify the separator? Or use backslash just as shown in PerfMon's graph properties on Data tab.

Thanks a lot!
/Jesper
jbritton
Posts: 4
Joined: Tue Jun 24, 2008 1:24 pm

Re: Get Any Windows Performance Monitor Counter (Program)

Post by jbritton »

Jesper wrote:
jbritton wrote: Do you have a counter that has a comma in it? I can change the seperator to something more unusual, like the pipe or something.
Yes, I have commas in Instances. I'm not sure that pipe is a good choice at the command prompt, or?

How about letting us specify the separator? Or use backslash just as shown in PerfMon's graph properties on Data tab.

Thanks a lot!
/Jesper
I like the idea of specifying it on the command line. I added -s[Separator] where the Separator is a character to use to separate the different parts of the Counter.
Attachments
GetPerfmon.zip
Executable version 1.5
(17.35 KiB) Downloaded 595 times
Jesper
Posts: 45
Joined: Mon Mar 11, 2002 7:00 pm

Re: Get Any Windows Performance Monitor Counter (Program)

Post by Jesper »

jbritton wrote:I like the idea of specifying it on the command line. I added -s[Separator] where the Separator is a character to use to separate the different parts of the Counter.
JBritton,
Works perfect, thanks again!
/Jesper
otherguy
Posts: 8
Joined: Sat Apr 28, 2007 7:24 pm

Post by otherguy »

Does anyone have any templates for this that they could upload? Or could someone explain how to set them up?

I want to be able to choose or specify the counter(s) when creating a new graph but I am not sure exactly how to set it up.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: Get Any Windows Performance Monitor Counter (Program)

Post by mcutting »

jbritton wrote:I have created a .NET executable that allows you to get any perfmon statistic from the command line. There is a README.TXT included to explain how to use it. Also, the tool is an open source project on Sourceforge: http://sourceforge.net/projects/getperfmon

I have created many scripts using this, I will post some templates later.
Any chances of posting your templates ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
pbrown
Posts: 3
Joined: Mon Jun 08, 2009 3:28 pm
Location: Seattle WA

Post by pbrown »

Has anyone created any templates for this yet?

I'm trying to graph terminal servers sessions. I can use the exe to get the data but an unsure as to how to get that data into Cacti. I'm still quite new at this.

--Patrick
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests