Windows 2003 disk statistics from WMI

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

Moderators: Developers, Moderators

Post Reply
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Windows 2003 disk statistics from WMI

Post by YoMarK »

On this forum you can find mutiple templates and scripts gathering Windows disk statistics.
Most of them require a "alternative" SNMP agent, and others did not supply the information I needed.
Some time ago I've created some templates and scripts which use WMI to get that information.

Important: The included vbscripts only work on windows( but with http://forums.cacti.net/viewtopic.php?t=29392 and some work, you could do the same thing), where the user that runs the poller has permissions to read WMI counters on other servers.
I run al my vbscripts using "Data Input Methods" as a script/Command, something like this:
c:/windows/system32/cscript.exe /T:10 /nologo c:/{yourcactipath}/www/scripts/DiskPerfv2.vbs <hostname>

Scripts and templates are included in the attached zipfile.
Attachments
WindowsDiskPerformanceUsingWMI.zip
(177.06 KiB) Downloaded 379 times
diskperformance1.png
diskperformance1.png (56 KiB) Viewed 8183 times
diskperformance2.png
diskperformance2.png (48.86 KiB) Viewed 8183 times
diskperformance3.png
diskperformance3.png (61.55 KiB) Viewed 8183 times
crashergs
Cacti User
Posts: 53
Joined: Fri May 23, 2008 3:37 pm

Post by crashergs »

What would you insert for the input/output fields?
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Post by YoMarK »

Hello crashergs, what do you mean exactly?

The only input is the servers hostname. The output fields are the field you can find in the scripts.
falkorette
Posts: 4
Joined: Tue Dec 23, 2008 12:56 pm

Post by falkorette »

Hello guys,

Very nice Graphs, thanks !

Can anyone tell me how to make multiple graphs for one host ? I've got to monitor servers that have at least 4 logical volumes and I have to make one graph per volume or per physical disk, can I do that with that template ?

I've got no problems to make it work but with only one graph per host. In fact, I don't really know what I'm graphing :-?

Am I graphing all the disks ? or only the first disk/volume ?

Thanks for your responses.

Forgive my poor english, I'm French :oops:
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Post by YoMarK »

Hello Falkorette, you're graphing "_Total" from WMI's Win32_PerfRawData_PerfDisk_PhysicalDisk to be more exact(look inside the .vbs script).
_total is the counter which combines all the statistics from volumes in windows together.
Example, if you have a C and a D drive, one transferring 5MB/sec and the other 10Mb/sec, _Total is 15MB/sec.

If you need specific information on for example the D drive, then could change the query in the .vbs scripts. Most of the time the D partition is called " 1 D:" and the C drive "0 C:"(instead of _total) .

Tip: with scriptomatic from microsoft(download at http://www.microsoft.com/downloads/deta ... layLang=en), it's easy to figure out the names of you physical drives(or logical drives, or...), and create scripts for it.
Just start it at the server you want to graph, and select the WMI class at the right dropdown menu. Good luck!
falkorette
Posts: 4
Joined: Tue Dec 23, 2008 12:56 pm

Post by falkorette »

Hello and merry christmas :)

First Thanks for helping me.

I tried to modify your script, and it worked well ( In command line, I can get WMI informations for one volume )

I got some questions again :

Do I need to create one "Data Input Method" per volume that I want to potentialy graph. ( One for "C:", another for "D:", etc... ) where each "Data Input Methods" have to run its own script with the right value ?

Is it the only way to collect multiple independant volumes WMI datas ?

Will I need to create some "data templates" which will refer to each "data input methods" ?

When I will be at this point, what am I supposed to do ?

Last and more "terrible" question : Is it possible to keep your templates as they are, but just let "cacti lazy users like me" the choice between the differents volumes on the host ?

I found some disk templates that let us the choice, but the graphs are not very good.

Thanks for your responses, and your patience too :roll:

I can telll it now : Happy new year ==> 2 days left !!
falkorette
Posts: 4
Joined: Tue Dec 23, 2008 12:56 pm

Post by falkorette »

Hello everybody !

So, after facing few troubles to make it work, I think I Succeed !

Now, what I've done ( Not very hard in fact ) :

In fact I mixed your template with another one : Disk Stats, that allows users to specify the Logical disks to graph. So the vb script is a little bit different than yours.

You'll find 2 directories in the Zip file : Workgroup & Domain :
( The only difference is the VB Script which is a little bit different due to the Authentification )

For the "Workgroup" Version :

In the VB Script, you've got to fill the "user" and "password" fields :

Networkusername="cacti"
Networkpassword="password"

The account specified here must have rights to read WMI informations on the host / target. (Admin accounts for example)

For the "Domain" Version :

In the VB Script, you've got to fill the "user", "password" and "Domainname" fields :

Domainname="DOMAIN"
Networkusername="cacti"
Networkpassword="password"

The account specified here must have rights to read WMI informations on the host / target.

I kept your graph Skeleton which is more efficient. (For the moment, I have only "translated" the two lasts -> diskperformance2 and diskperformance3)

So, when you create a graph, you must fill the "Hostname" and "Logical Disk" fields.

For Example :

Hostname (or IP) : 192.168.0.1
Logical Disk : C:

Don't forget to rename the title of the graph, it's not automatic :(

If you encounter troubles or if you can help me to make it much better, please tell me.

Enjoy :)

Once again, forgive my poor english
Attachments
Windows_Logical_Disk_Performance - WMI - VBS.rar
You'll find :
- Data Template
- 2 Graphs Templates
- VB Script
(19.5 KiB) Downloaded 148 times
Last edited by falkorette on Fri Feb 06, 2009 8:36 pm, edited 2 times in total.
falkorette
Posts: 4
Joined: Tue Dec 23, 2008 12:56 pm

Post by falkorette »

PS : Here is the working input string :

"c:/windows/system32/cscript.exe /T:300 //nologo c:/Inetpub/wwwroot/cacti/scripts/Windows_Logical_Disk_Performance.vbs <Hostname> <Diskname>"


These graphs work with the "_Total" in spite of "C:" or "D:".
You can graph the "Total" activity of your Disks.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests