Performance Monitor Query [v1.1 - 2011-12-16]
Moderators: Developers, Moderators
Performance Monitor Query [v1.1 - 2011-12-16]
This script is merely a wrapper around the Microsoft tool typeperf which is designed to query a single performance counter at a time. Typeperf leverages WMI, which requires user authentication, correct permission levels and of course only works from Windows. In the case of Cacti, typeperf will be executed with the permissions of the Cacti Scheduled Task. The query format typeperf requires can be somewhat confusing to figure out. The link above lists all the nitty-gritty details.
Full details and installation instructions are in the download. Sample screenshots below, demonstrating how customizable the templates are for all types of performance counter data.
Full details and installation instructions are in the download. Sample screenshots below, demonstrating how customizable the templates are for all types of performance counter data.
- Attachments
-
- PerformanceMonitorQuery-1.1.zip
- (48.31 KiB) Downloaded 697 times
-
- PerformanceMonitorQuery-1.0.zip
- script, templates, and readme
- (47.6 KiB) Downloaded 449 times
-
- Sample templates in action
- sample.png (20.81 KiB) Viewed 11665 times
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Looks like all work fine. But there is a problem with spine 0.8.7e under Windows. I use Cacti 0.8.7e and Spine http://www.cacti.net/downloads/spine/pa ... 0.8.7e.zip. For some counters result isn't shown:
"\Processor(_Total)\% Processor Time", output: RESULT:3.127480
"\MSSQL$TEST_SRV:Memory Manager\Total Server Memory (KB)", output: RESULT:
If I use cmd.php instead of Spine the result for MSSQL counter is shown. Is it a Spine bug? It can't handle "$" or ":"?
"\Processor(_Total)\% Processor Time", output: RESULT:3.127480
"\MSSQL$TEST_SRV:Memory Manager\Total Server Memory (KB)", output: RESULT:
If I use cmd.php instead of Spine the result for MSSQL counter is shown. Is it a Spine bug? It can't handle "$" or ":"?
Possibly a spine bug.
Please post the output while using cmd.php
Also, for processor time, you really want to use the snmp implementation since its a LOT faster.
Please post the output while using cmd.php
Also, for processor time, you really want to use the snmp implementation since its a LOT faster.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
04/05/2010 10:08:40 AM - CMDPHP: Poller[0] Host[2] DS[69] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\MSSQL$TEST_SRV:General Statistics\User Connections", output: RESULT:20.000000
04/05/2010 10:08:42 AM - CMDPHP: Poller[0] Host[2] DS[70] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\MSSQL$TEST_SRV:Databases(_Total)\Data File(s) Size (KB)", output: RESULT:8929408.000000
04/05/2010 10:08:33 AM - CMDPHP: Poller[0] Host[2] DS[66] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\MSSQL$TEST_SRV:Memory Manager\Total Server Memory (KB)", output: RESULT:1638400.000000
04/05/2010 10:08:46 AM - CMDPHP: Poller[0] Host[3] DS[43] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\Processor(_Total)\% Processor Time", output: RESULT:3.000000
04/05/2010 10:08:42 AM - CMDPHP: Poller[0] Host[2] DS[70] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\MSSQL$TEST_SRV:Databases(_Total)\Data File(s) Size (KB)", output: RESULT:8929408.000000
04/05/2010 10:08:33 AM - CMDPHP: Poller[0] Host[2] DS[66] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\MSSQL$TEST_SRV:Memory Manager\Total Server Memory (KB)", output: RESULT:1638400.000000
04/05/2010 10:08:46 AM - CMDPHP: Poller[0] Host[3] DS[43] CMD: D:/app/serv/apache2.2/htdocs/cacti/scripts/perfmon_query.cmd host "\Processor(_Total)\% Processor Time", output: RESULT:3.000000
Yup, looks like buggy spine to me. Please file a report at http://www.cacti.net/bugs.php, summarize the problem and reference this thread.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re:
I have the same problem :baribal wrote:Looks like all work fine. But there is a problem with spine 0.8.7e under Windows. I use Cacti 0.8.7e and Spine http://www.cacti.net/downloads/spine/pa ... 0.8.7e.zip. For some counters result isn't shown:
"\Processor(_Total)\% Processor Time", output: RESULT:3.127480
"\MSSQL$TEST_SRV:Memory Manager\Total Server Memory (KB)", output: RESULT:
If I use cmd.php instead of Spine the result for MSSQL counter is shown. Is it a Spine bug? It can't handle "$" or ":"?
04/18/2011 12:34:03 PM - SPINE: Poller[0] Host[5] DS[14] SCRIPT: C:/Cacti/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.168.0.101 "\processor(_Total)\% Processor Time" , output: RESULT:44.919050
04/18/2011 12:34:04 PM - SPINE: Poller[0] Host[5] DS[15] SCRIPT: C:/Cacti/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.168.0.101 "MSSQL$SQL2K8:General Statistics\User Connections", output: RESULT:
BSOD2600,colud you help me ,ths a lot.
Re: Performance Monitor Query [v1.0 - 2010-01-28]
nicoCn: cacti/spine 0.8.7g is the latest. please give them a try. if there is still a problem, then a bug report needs to be filed.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Performance Monitor Query [v1.0 - 2010-01-28]
thanks for your reply, I will try cacti/spine 0.8.7g.BSOD2600 wrote:nicoCn: cacti/spine 0.8.7g is the latest. please give them a try. if there is still a problem, then a bug report needs to be filed.
Re: Performance Monitor Query [v1.0 - 2010-01-28]
Hi BSOD2600:
I just installed cacti/spine 0.8.7.g and tried cmd.php/spine.
used spine.exe
04/19/2011 04:14:02 PM - SPINE: Poller[0] Host[7] TH[1] DS[18] SCRIPT: C:/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.169.0.1 "MSSQL$SQL2K8:General Statistics\User Connections", output: RESULT:
used cmdphp:
04/19/2011 04:15:02 PM - CMDPHP: Poller[0] Host[7] DS[18] CMD: C:/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.169.0.1 "MSSQL$SQL2K8:General Statistics\User Connections", output: RESULT:94.000000
Is this a spine bug ?
ths a lot.
I just installed cacti/spine 0.8.7.g and tried cmd.php/spine.
used spine.exe
04/19/2011 04:14:02 PM - SPINE: Poller[0] Host[7] TH[1] DS[18] SCRIPT: C:/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.169.0.1 "MSSQL$SQL2K8:General Statistics\User Connections", output: RESULT:
used cmdphp:
04/19/2011 04:15:02 PM - CMDPHP: Poller[0] Host[7] DS[18] CMD: C:/Apache2/htdocs/cacti/scripts/perfmon_query.cmd 192.169.0.1 "MSSQL$SQL2K8:General Statistics\User Connections", output: RESULT:94.000000
Is this a spine bug ?
ths a lot.
Re: Performance Monitor Query [v1.0 - 2010-01-28]
yes, please file a bug.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Performance Monitor Query [v1.0 - 2010-01-28]
thanks a lot BSOD2600.
- terpmeister
- Posts: 4
- Joined: Fri Dec 16, 2011 11:29 am
- Location: Oregon
- Contact:
Re: Performance Monitor Query [v1.0 - 2010-01-28]
Has anybody gotten this query (.cmd) file to work on Windows 2008 R2? If I manually run the query from a DOS command prompt, I get the following:
RESULT:wait...
I can run it successfully on a Windows 2003 box. Just curious before I start picking apart the .cmd file if somebody else has already done this work.
Here is an example of what I am running from the command line:
perfmon_query.cmd aServerName "\Processor(_Total)\% Processor Time"
I have tried multiple different Performance Monitor queries as well (to eliminate it being the Query syntax). I have full permissions on this machine (and ones I try to monitor). If I manually do the typeperf command, I do get a result back. Only thing I can think that it would be is something in the .cmd file does not like Windows 2008.
Thanks.
A little more info, if I turn echo off to see what it is doing, I get this:
(set RESULT=1.563130 )
(set RESULT=wait... )
echo.RESULT:wait...
So it looks like it is getting a result, but then something is plunking in wait...
RESULT:wait...
I can run it successfully on a Windows 2003 box. Just curious before I start picking apart the .cmd file if somebody else has already done this work.
Here is an example of what I am running from the command line:
perfmon_query.cmd aServerName "\Processor(_Total)\% Processor Time"
I have tried multiple different Performance Monitor queries as well (to eliminate it being the Query syntax). I have full permissions on this machine (and ones I try to monitor). If I manually do the typeperf command, I do get a result back. Only thing I can think that it would be is something in the .cmd file does not like Windows 2008.
Thanks.
A little more info, if I turn echo off to see what it is doing, I get this:
(set RESULT=1.563130 )
(set RESULT=wait... )
echo.RESULT:wait...
So it looks like it is getting a result, but then something is plunking in wait...
-------------------------------------
terpmeister
http://www.redmutt.com
terpmeister
http://www.redmutt.com
Re: Performance Monitor Query [v1.0 - 2010-01-28]
I've got a newer PowerShell script for this purpose... but Cacti's string cleaning routines break some counters, hence it hasn't been released yet.
I do see what you mean about something inserting that additional wait... I'll see if I can fix the script.
I do see what you mean about something inserting that additional wait... I'll see if I can fix the script.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- terpmeister
- Posts: 4
- Joined: Fri Dec 16, 2011 11:29 am
- Location: Oregon
- Contact:
Re: Performance Monitor Query [v1.0 - 2010-01-28]
Thanks for the help, I am still working it on my end as well. More info (not sure if it is useful) is if I change the token=3 variable it looks like I am getting different result. My DOS-fu is pretty rusty so I have been googling around to see if there is something I am missing.
Also, if you need any testers for the PowerShell script, my current environment is available. Using PS in this environment would be the preferred method anyways.
Thanks.
More info, changing token value to:
1 = Exiting
2 = please
3 = wait...
Also, if you need any testers for the PowerShell script, my current environment is available. Using PS in this environment would be the preferred method anyways.
Thanks.
More info, changing token value to:
1 = Exiting
2 = please
3 = wait...
-------------------------------------
terpmeister
http://www.redmutt.com
terpmeister
http://www.redmutt.com
Who is online
Users browsing this forum: No registered users and 6 guests