Host-Resources-V2 Disk Usage ( Windows )

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

Moderators: Developers, Moderators

ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Host-Resources-V2 Disk Usage ( Windows )

Post by ajeskey »

***************************************************
** NEW VERSION **
Leaving the original posts to so the prograssion of the graph
***************************************************

This graph uses the Host-Resources-V2 MIB to gather Disk usage.

I have tested this on Windows platforms, but not on any other Host-Reources-V2 compliant SNMPD.

I can never pick nice colors, so go nuts on that and if you find something that looks really sharp, let me know!

Image to follow on the next post… the forums should let you attach more…


What it Graphs
--------------------
* Allocated Disk Size
* Disk Allocation Used
* Disk Allocation Failures

The disk allocation failures is a handy thing for those using threshld, you can easily add a monitor to it to report when the machine was unable to write to the disk, due to the lack of space.


XML Data Query File
----------------------------
<interface>
<name>Host-Resources-V2 - Disk Stats</name>
<description>Using HOST-RESOURCES-V2-MIB Queries a host for a list of Disk(s) and thier stats</description>
<oid_index>.1.3.6.1.2.1.25.2.3.1.1</oid_index>
<index_order_type>numeric</index_order_type>
<fields>
<hostresInstance>
<name>Disk Instance</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.25.2.3.1.1</oid>
</hostresInstance>
<hostresDescription>
<name>Disk Description</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.25.2.3.1.3</oid>
</hostresDescription>
<hostresAllocation>
<name>Disk Description</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.25.2.3.1.5</oid>
</hostresAllocation>
<hostresUsed>
<name>Disk Description</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.25.2.3.1.6</oid>
</hostresUsed>
<hostresFailures>
<name>Disk Description</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.25.2.3.1.7</oid>
</hostresFailures>
</fields>
</interface>
Attachments
cacti_data_query_snmp_hostresources_v2_disk.xml
(18.38 KiB) Downloaded 902 times
cacti_data_template_snmp_hostresourcesv2_disk.xml
(7.78 KiB) Downloaded 899 times
cacti_graph_template_snmp_hostresources_v2_disk.xml
(16.85 KiB) Downloaded 1038 times
Last edited by ajeskey on Tue Apr 12, 2005 10:56 am, edited 4 times in total.
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

***************************************************
** NEW VERSION **
Leaving the original posts to so the prograssion of the graph
***************************************************

In Action...
Attachments
hostresources-disk.JPG
hostresources-disk.JPG (40.02 KiB) Viewed 21242 times
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

***************************************************
** NEW VERSION 04/12/2005 **
***************************************************

* Cleaned up some of the GPRINTs
* Set the failures to a white line at the bottom, so that people wont question why there is red on the graph.
* Picked some better colors.
* Removed all the extra padding on the top of the graph

( oh and i am zipping it so i can't complain about the lack of attachments anymore )
Attachments
SNMP Host-Resources-V2 Disk.zip
(8.32 KiB) Downloaded 1137 times
hostresources-disk.JPG
hostresources-disk.JPG (36.66 KiB) Viewed 21151 times
Jdude
Posts: 24
Joined: Mon Jan 24, 2005 10:49 am
Location: Cork Ireland
Contact:

Post by Jdude »

dose not work For me



Warning: Variable passed to each() is not an array or object in C:\Apache2\htdocs\cacti\lib\data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at C:\Apache2\htdocs\cacti\lib\data_query.php:490) in C:\Apache2\htdocs\cacti\host.php on line 70
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

I assure you that it works. make sure there are no trailing spaces after </inderface> and that, that is the last line.

Oh and that you are running 0.8.6c
mjaz
Posts: 9
Joined: Mon Apr 18, 2005 7:33 am

Post by mjaz »

Won't work for me either. I imported the following 3 files from the zip file,

cacti_data_query_snmp_hostresources_v2_disk.xml
cacti_data_template_snmp_hostresourcesv2_disk.xml
cacti_graph_template_snmp_hostresources_v2_disk.xml

and get the error

Warning: Variable passed to each() is not an array or object in C:\Apache2\htdocs\cacti\lib\data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at C:\Apache2\htdocs\cacti\lib\data_query.php:490) in C:\Apache2\htdocs\cacti\host.php on line 75

when trying to do the data query. running 0.8.6c.

would be great to see this working

Mark
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

Here it is again you should be able to jus timport this one and have it work... make sure that your script has permisions to be rad by cacti, and that you are running 8.6c
Attachments
cacti_graph_template_snmp_hostresources_v2_disk.xml
(15.81 KiB) Downloaded 1011 times
mjaz
Posts: 9
Joined: Mon Apr 18, 2005 7:33 am

Post by mjaz »

Thanks :)

I have it working now. get great results with this, no more gaps in my hdd stats like i used to get with the default templates.

Mark
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

glad to help
tightcode
Posts: 4
Joined: Fri Jun 03, 2005 2:57 am

Post by tightcode »

Hello ajeskey,

I just came across your CPU and Disk SNMP Informat scripts and have some trouble making them work. As I am a new cacti user I suspect user error however I thought I would ask here in case my problem is version specific and not of my own causeing.
I originally had the same errors with both of your scripts as mentioned by previous people in this thread (array + each) related. I patched the cacti files in question to better handle that particular error and ended up with the following:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Could not find data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/win32_cpu.xml'
+ Error parsing XML file into an array.
+ Could not find data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/win32_cpu.xml'
+ Could not find data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/win32_cpu.xml'
+ Could not find data query XML file at '/var/www/localhost/htdocs/cacti/resource/snmp_queries/win32_cpu.xml'
I receive the same for the disk query when doing the verbose query except it shows win32_disk.xml instead of win32_cpu.xml. I checked on that file and it is correct it is not in that folder (neither of them that is). I ran locate for win32 and it found neither of those files anywhere on my machine. Additionally in the menu for the graph templates there is no option for any of the SNMP Informant graphs I imported. Your scripts are the first I have imported so I may very well be doing something wrong.

I am using cacti 0.8.6d installed 2 days ago.

Thanks for your time and sorry for the questions if they are silly,

Cheers, TC
wally.nl
Posts: 8
Joined: Tue Jun 14, 2005 9:40 am
Contact:

Post by wally.nl »

Hi TC

Just starting to explore cacti myself but I think you need to create that file yourself and paste the xml code from the original post that starts with <interface> in there (the stuff under the "XML Data Query File").

Wally.nl
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

wally is exactly right.

i havnt used my script with .d yet, but it should work... but let us know if it does.

thanks
- Aaron Jeskey
kiw0r
Posts: 18
Joined: Fri Jun 17, 2005 4:26 am

Works with Net-SNMP machines

Post by kiw0r »

I just wanted to tell that theses templates works well on Net-SNMP machines (mostly Unix ones...) and they are not limited to Windows only :)
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

i agree ! I monitor a few windows boxes from a linux box. it works perfectly and shows the right value for the harddisk usage but for physical memory and virtual memory it shows not the correct value or did i a mistake ?
Attachments
graph_110_1.png
graph_110_1.png (3.35 KiB) Viewed 19479 times
currently the windows task manager shows something else : USAGE 272 MB !
currently the windows task manager shows something else : USAGE 272 MB !
graph_111_1.png (3.51 KiB) Viewed 19479 times
http://www.lounge-radio.com/
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

I am working on something to do Physical memory. Should be done by the end of the day (i've had it for months but its not very intuitive, so I am just cleaning it up)

As for the Vistual Memory. That is kind of an odd thing, it seems to only show what it's allocated from the page file for what is in RAM and what is on disk. I do see it trend differently on hosts, and I do see it go up when a machine eats all of its Physical memory. But you wont see that until I get you the Physical Memory graph :)

I'll keep you guys posted.
- Aaron Jeskey
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests