My version of Win32 Disk Stats

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

Moderators: Developers, Moderators

africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

My version of Win32 Disk Stats

Post by africanw »

Hi,

My script is similair to an earlier post (http://forums.cacti.net/viewtopic.php?t ... statistics). Instead of using SNMP I have used WMI.

Recreated it as the one in the post did not work very well.

If you are going to montior other servers on the network you will need to modify a section of the script to include a local account common to all the machines or a domain account. This account needs admin access.

Networkusername="username"
Networkpassword="password"

OR

Networkusername="DOMAIN\username"
Networkpassword="password"

This script is only for Windows and has been tested on Windows 2003.

Enjoy
Attachments
Disk Stats.zip
(33.1 KiB) Downloaded 2462 times
DiskStats.gif
DiskStats.gif (25.23 KiB) Viewed 32707 times
tbaror
Cacti User
Posts: 75
Joined: Mon Jun 05, 2006 6:54 am

Disk stat issues

Post by tbaror »

Hi
doesnt work cant import the graph and data template
please advise
Tanks
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

What version of Cacti are you using?
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

mmm If you are using the latest open the templates in IE and fix any errors.

I use " alot in my templates and it subsitues it for &#34 when when you export and does not like to reimport them

For example -

<value>&#34localhost&#34</value>
---------------^

I have attached the two templates that will import.
Attachments
cacti_data_template_windows_disk_stats_wmi.xml
(11.02 KiB) Downloaded 1923 times
cacti_graph_template_windows_disk_stats_wmi.xml
(35.42 KiB) Downloaded 2127 times
tbaror
Cacti User
Posts: 75
Joined: Mon Jun 05, 2006 6:54 am

Disk stat issues

Post by tbaror »

Hi,

thanks now the import part is working ,but where and how should use the vbs script?
thanks in advanced.
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

You put it in your cacti scripts folder.
tbaror
Cacti User
Posts: 75
Joined: Mon Jun 05, 2006 6:54 am

Disk stst issue

Post by tbaror »

Hi again,

Even tough I have placed the script in scripts folder and filled the user/pass section with admin right still no data "Nan" and I get error in cacti log
Also I have tried to run the script manually and i get error you can see on attached screenshot
Attachments
error screen shoot
error screen shoot
disk-error.png (14.6 KiB) Viewed 32225 times
Fleabag
Posts: 8
Joined: Thu Dec 21, 2006 4:14 pm

Disk WMI problems - Help.

Post by Fleabag »

New Cacti User,
I am having the same problem and if I run poller from CMD prompt I get the following error. I have confirmed user/passwd, The cscript cmd runs fine from the CMD prompt.


C:\Inetpub\wwwroot\cacti\scripts\w32_WMI_logical_disks.vbs
Data Input String = C:/WINDOWS/system32/cscript.exe //Nologo <path_cacti>/scripts/w32_WMI_logical_disks.vbs <Hostname><diskname>




Cacti Log;
12/21/2006 04:30:03 PM - CMDPHP: Poller[0] Host[2] DS[126] WARNING: Result from CMD not valid. Partial Result:



C:\php>php C:\Inetpub\wwwroot\Cacti\poller.php
OK u:0.00 s:0.00 r:0.12
OK u:0.00 s:0.00 r:0.12
OK u:0.00 s:0.00 r:0.14
OK u:0.00 s:0.00 r:0.14
OK u:0.00 s:0.00 r:0.16
OK u:0.00 s:0.00 r:0.16
OK u:0.00 s:0.00 r:0.16
OK u:0.00 s:0.00 r:0.17
OK u:0.00 s:0.00 r:0.17
OK u:0.00 s:0.00 r:0.17
ERROR: Not enough arguments
OK u:0.00 s:0.03 r:0.19


It seems a lot of people provide this but I am not sure why... :)
Data Source Debug

c:/rrdtool/rrdtool.exe create \
c:/Inetpub/wwwroot/cacti/rra/localhost_avgdisksecperread_126.rrd \
--step 300 \
DS:AvgDiskReadQueueLen:GAUGE:600:0:100 \
DS:FreeMegabytes:GAUGE:600:0:U \
DS:AvgDiskWriteQueueLe:GAUGE:600:0:100 \
DS:PercentFreeSpace:GAUGE:600:0:100 \
DS:PercentDiskWriteTim:GAUGE:600:0:100 \
DS:AvgDiskSecPerRead:GAUGE:600:0:U \
DS:AvgDiskSecPerWrite:GAUGE:600:0:U \
DS:PercentDiskReadTime:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
Fleabag
Posts: 8
Joined: Thu Dec 21, 2006 4:14 pm

SubScript out of range from CMD line

Post by Fleabag »

You do not have all the Arguments in the CMD line

cscript w32_WMI_logical_disks.vbs localhost C:
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

Your data input has taken the spaces out -

w32_WMI_logical_disks.vbs <Hostname><diskname>

Should read -

w32_WMI_logical_disks.vbs <Hostname> <diskname>

If you want to run it from the command line do something like -

cscript w32_WMI_logical_disks.vbs localhost C:

You will always need two arguements after the script
Fleabag
Posts: 8
Joined: Thu Dec 21, 2006 4:14 pm

Error is still there DISK WMI - ERROR: Not enough arguments

Post by Fleabag »

I have fixed this. (I must have changed it when troubleshooting)

However the problem is still there... If I delete the Data Input for this WMI the "ERROR: Not enough arguments" no longer appears.

C:/WINDOWS/system32/cscript.exe //Nologo <path_cacti>/scripts/w32_WMI_logical_disks.vbs <Hostname> <diskname>

C:\php>php C:\Inetpub\wwwroot\Cacti\poller.php
OK u:0.00 s:0.00 r:0.00
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.03
OK u:0.00 s:0.00 r:0.03
OK u:0.00 s:0.00 r:0.03
OK u:0.01 s:0.00 r:0.05
OK u:0.01 s:0.00 r:0.05
OK u:0.01 s:0.00 r:0.05
ERROR: Not enough arguments
OK u:0.01 s:0.00 r:0.06
OK u:0.01 s:0.00 r:0.06



My end goal is to monitor the same Disk values via WMI so if someone can assist. please do.



Thanks for the help in advance.
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

can you post the bit from your cacti log for this error.

Also what happens when you run it from the command line?

cscript w32_WMI_logical_disks.vbs localhost C: for example.

Also check the data source for the graph and check it has a space.
Fleabag
Posts: 8
Joined: Thu Dec 21, 2006 4:14 pm

Post by Fleabag »

Cacti Log regarding this issue;
12/21/2006 10:57:30 PM - CMDPHP: Poller[0] Host[2] DS[126] WARNING: Result from CMD not valid. Partial Result:



When run from CMD lline;
C:\Inetpub\wwwroot\cacti\scripts>cscript //nologo 32_WMI_logical_disks.vbs localhost C:

FreeMegabytes:60 AvgDiskReadQueueLength:0 AvgDiskWriteQueueLength:0 PercentDiskR
eadTime:0 PercentDiskWriteTime:0 PercentFreeSpace:89 AvgDiskSecPerRead:0 AvgDisk
SecPerWrite:0



Thanks
africanw
Cacti User
Posts: 130
Joined: Thu Mar 31, 2005 4:24 pm
Location: Sydney, Asutralia
Contact:

Post by africanw »

your cacti logging level is not high enough.

Make sure it is at least on MEDIUM. Am sure its your graph data source that is wrong. Try and delete the current one and start a new one.
Fleabag
Posts: 8
Joined: Thu Dec 21, 2006 4:14 pm

Post by Fleabag »

africanw, I thank you for your help.

I am not too sure on your statement. "graph data source that is wrong. Try and delete the current one and start a new one."


How do I delete the Graph Data, I see template, but I do not think this is what you mean.

THanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests