Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Apr 24, 2019 3:30 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: My version of Win32 Disk Stats
PostPosted: Thu Nov 16, 2006 7:03 am 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
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:
DiskStats.gif
DiskStats.gif [ 25.23 KiB | Viewed 29122 times ]
Disk Stats.zip [33.1 KiB]
Downloaded 2273 times
Top
 Profile  
 
 Post subject: Disk stat issues
PostPosted: Thu Dec 07, 2006 10:52 am 
Offline
Cacti User

Joined: Mon Jun 05, 2006 6:54 am
Posts: 55
Hi
doesnt work cant import the graph and data template
please advise
Tanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 7:22 pm 
Offline
Cacti User

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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 7:31 pm 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
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_graph_template_windows_disk_stats_wmi.xml [35.42 KiB]
Downloaded 1782 times
cacti_data_template_windows_disk_stats_wmi.xml [11.02 KiB]
Downloaded 1719 times
Top
 Profile  
 
 Post subject: Disk stat issues
PostPosted: Thu Dec 14, 2006 3:40 am 
Offline
Cacti User

Joined: Mon Jun 05, 2006 6:54 am
Posts: 55
Hi,

thanks now the import part is working ,but where and how should use the vbs script?
thanks in advanced.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 5:14 am 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
You put it in your cacti scripts folder.


Top
 Profile  
 
 Post subject: Disk stst issue
PostPosted: Thu Dec 14, 2006 8:40 am 
Offline
Cacti User

Joined: Mon Jun 05, 2006 6:54 am
Posts: 55
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:
File comment: error screen shoot
disk-error.png
disk-error.png [ 14.6 KiB | Viewed 28640 times ]
Top
 Profile  
 
 Post subject: Disk WMI problems - Help.
PostPosted: Thu Dec 21, 2006 4:39 pm 
Offline

Joined: Thu Dec 21, 2006 4:14 pm
Posts: 8
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 \


Top
 Profile  
 
 Post subject: SubScript out of range from CMD line
PostPosted: Thu Dec 21, 2006 4:42 pm 
Offline

Joined: Thu Dec 21, 2006 4:14 pm
Posts: 8
You do not have all the Arguments in the CMD line

cscript w32_WMI_logical_disks.vbs localhost C:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 7:02 pm 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
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


Top
 Profile  
 
 Post subject: Error is still there DISK WMI - ERROR: Not enough arguments
PostPosted: Thu Dec 21, 2006 9:36 pm 
Offline

Joined: Thu Dec 21, 2006 4:14 pm
Posts: 8
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 9:45 pm 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 11:02 pm 
Offline

Joined: Thu Dec 21, 2006 4:14 pm
Posts: 8
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 11:17 pm 
Offline
Cacti User

Joined: Thu Mar 31, 2005 4:24 pm
Posts: 124
Location: Sydney, Asutralia
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 10:34 am 
Offline

Joined: Thu Dec 21, 2006 4:14 pm
Posts: 8
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group