SNMP-Informant-STD CPU 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

SNMP-Informant-STD CPU Usage (Windows)

Post by ajeskey »

This uses the SNMP-Informants Standard MIB Add-On to graph CPU stats on Windows.

You must have SNMP-Informant Standard MIB Add-On install on the Windows host you are polling in order for this to work. If you are not familiar with SNMP-Informant, it is a free download, and is extremely stable, since it does not add any services to the machine.

I have tested this on various machines from 1 CPU to 8, and they all seem very acurate.

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


What it Graphs
--------------------
* Processor Time (Totally CPU Usage)
* User Time (User CPU Usage)
* Privileged Time (Operating System and all other Privileged CPU Usage)


XML Data Query File
----------------------------
<interface>
<name>Win32 - Informant - CPU Stats</name>
<description>Using SNMP-Informant Queries a host for a list of CPU(s) and their stats</description>
<oid_index>.1.3.6.1.4.1.9600.1.1.5.1.1.1</oid_index>
<index_order_type>numeric</index_order_type>
<fields>
<cpuinformInstance>
<name>CPU Instance</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.1.1</oid>
</cpuinformInstance>
<cpuinformPercentProcessorTime>
<name>Processor Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.5.1</oid>
</cpuinformPercentProcessorTime>
<cpuinformPercentUserTime>
<name>User Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.6.1</oid>
</cpuinformPercentUserTime>
<cpuinformPercentPrivilegedTime>
<name>Privleged Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.4.1</oid>
</cpuinformPercentPrivilegedTime>
</fields>
</interface>
Attachments
cacti_data_query_win32_snmp_informant_cpu.xml
(19.74 KiB) Downloaded 3019 times
cacti_data_template_win32_snmp_informant_cpu.xml
(7.79 KiB) Downloaded 2702 times
cacti_graph_template_win32_snmp_informant_cpu.xml
(18.21 KiB) Downloaded 3910 times
Last edited by ajeskey on Sun Apr 10, 2005 2:39 pm, edited 1 time in total.
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

The image labeled "informantcpu.JPG" had to be zoomed in a bit since the CPU is usualy maxed out.

"informantcpu2.JPG" should be a little better at describing what you will normaly see, well unless you run crazy number crunching applicatins like I do.
Attachments
informantcpu.JPG
informantcpu.JPG (36.45 KiB) Viewed 35489 times
informantcpu2.JPG
informantcpu2.JPG (49.32 KiB) Viewed 35491 times
boots
Cacti User
Posts: 55
Joined: Wed Jan 07, 2004 4:59 am
Location: Melbourne Australia

Post by boots »

Do you have any templates for other counters like Disk, Memory etc?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

There are many out there that will do what you are looking for. You should really search the forums.

If you are looking for somethat *I* have done, I posted a disk one too, that was all of 2 lines below this post. Or again it's something that would have been found by searching.

http://forums.cacti.net/viewtopic.php?t=7148

I am currently working on a Memory counter too, it will use SNMP-Informant as well.
perk
Posts: 1
Joined: Wed Jun 15, 2005 3:35 am
Location: Norway

Post by perk »

Having a slight problem with applying your templates:

Running on Fedora Core 2,Caci 0.8.6.d,php 4.3.11,net-snmp 5.2.1-10

I get data for each CPU, (graphing dual Intels w/HT on)
but not on the CPU - |query_cpuinformInstance|.

when I do a Verbose Query test on Win32 - SNMP - Informant - CPU I get:
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Located input field 'cpuinformInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Found item [cpuinformInstance='0'] index: 48 [from value]
+ Found item [cpuinformInstance='1'] index: 49 [from value]
+ Found item [cpuinformInstance='2'] index: 50 [from value]
+ Found item [cpuinformInstance='3'] index: 51 [from value]
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/win32_cpu.xml'
I then fire up GetIf and manually query the :
cpuinformPercentProcessorTime
cpuinformPercentUserTime
cpuinformPercentPrivilegedTime

I get 5 instances , each CPU + HT and a total, but for some reason it's not graphing the total.

hmm..while I was double checking this, I noticed that sometimes the host did NOT return any data on the _Total instance..

IThe hosts I want to grap is all running Windows 2000, Microsoft SNMP + Informer Standard.

Anyone able to help me ?
Per Kristiansen
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

It could be that you are running in "d" I still haven't upgraded.

I never use the "total_" I realize that it could be handy, but the returned value seems to be unstable coming out of SNMP Informant. But I may be speaking out of school on that (it's just my experiance)

When I finaly get around to upgrading to "d" I'll check this out.
- Aaron Jeskey
websat
Cacti User
Posts: 70
Joined: Wed Jun 22, 2005 3:00 pm
Contact:

Post by websat »

hi

in "data queries" edit: Win32 - SNMP - Informant - CPU:

xml path need: <path_cacti>/resource/snmp_queries/win32_cpu.xml where i can find win32_cpu.xml ?

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

Post by ajeskey »

its in the first post under the heading

XML Data Query File
----------------------------
- Aaron Jeskey
websat
Cacti User
Posts: 70
Joined: Wed Jun 22, 2005 3:00 pm
Contact:

Post by websat »

i need to create an wn32_cpu.xml with

<interface>
<name>Win32 - Informant - CPU Stats</name>
<description>Using SNMP-Informant Queries a host for a list of CPU(s) and their stats</description>
<oid_index>.1.3.6.1.4.1.9600.1.1.5.1.1.1</oid_index>
<index_order_type>numeric</index_order_type>
<fields>
<cpuinformInstance>
<name>CPU Instance</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.1.1</oid>
</cpuinformInstance>
<cpuinformPercentProcessorTime>
<name>Processor Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.5.1</oid>
</cpuinformPercentProcessorTime>
<cpuinformPercentUserTime>
<name>User Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.6.1</oid>
</cpuinformPercentUserTime>
<cpuinformPercentPrivilegedTime>
<name>Privleged Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.4.1</oid>
</cpuinformPercentPrivilegedTime>
</fields>
</interface>


?
websat
Cacti User
Posts: 70
Joined: Wed Jun 22, 2005 3:00 pm
Contact:

Post by websat »

i have this error: "RRDTool Says:

ERROR: opening 'E:\serveurperso/rra/websattelecom_com_cpuinformprocessor_58.rrd': No such file or directory"

in the Associated Graph Templates for my host when i Turn On Graph Debug Mode.
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

Well thats a good start at least you have the XML file in place now.

The file is obviously missing, or not accesable with the user account that you are running the sevice as. Does the file exist on the filesystem?

I would delete all the cpu data sources then go and recreate the graphs.
- Aaron Jeskey
websat
Cacti User
Posts: 70
Joined: Wed Jun 22, 2005 3:00 pm
Contact:

Post by websat »

i delete the cpu data and try to recreate the graphs, but still have the same problem.... :(
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

I am at a loss, may want to try the genreal forums. and point people back to this thread
- Aaron Jeskey
User avatar
ajohnson
Posts: 36
Joined: Tue Dec 27, 2005 5:36 pm

Post by ajohnson »

You may want to try setting SNMP to V2. When set to V1, I was not able to see the CPU on my Windows box from CACTI (which is on Linux)...
User avatar
dust2k
Cacti User
Posts: 101
Joined: Sun Dec 04, 2005 3:14 am

Post by dust2k »

This script need to be update as well for 0.8.6h, because win32_cpu.xml query result parsed by new version have invalid value. see the compare results.

old version

+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'D:/cacti/resource/snmp_queries/win32_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Located input field 'cpuinformInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Found item [cpuinformInstance='0'] index: 48 [from value]
+ Found data query XML file at 'D:/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at 'D:/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at 'D:/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at 'D:/cacti/resource/snmp_queries/win32_cpu.xml'

new version :
+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'G:/root/web/home.ausmis.com/cacti/resource/snmp_queries/win32_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Located input field 'cpuinformInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Found item [cpuinformInstance='End of MIB'] index: End of MIB [from value]
+ Found data query XML file at 'G:/root/web/home.ausmis.com/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at 'G:/root/web/home.ausmis.com/cacti/resource/snmp_queries/win32_cpu.xml'
+ Found data query XML file at 'G:/root/web/home.ausmis.com/cacti/resource/snmp_queries/win32_cpu.xml'

the new version use "End of Mib" as instance name so cause poller.php pull the invalid data.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests