Graphing Windows NT hosts via SNMP

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

Moderators: Developers, Moderators

Post Reply
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Graphing Windows NT hosts via SNMP

Post by georger_br »

May/3/2006 - UPDATE - Template updated for 0.8.6h. The same instructions as in my original post still apply, but now the upper limit in disk graphs should be expressed in megabytes, not in bytes.
The file is attached to the topic. Regards,

Georger

---

Hi,
I have some Windows NT boxes at work and wanted to graph them, but Cacti 0.8.6f doesn't have a Windows NT template, and the 2000/XP template isn't compatible, as you can see in my topic http://forums.cacti.net/viewtopic.php?t=8548. So I asked around, did a lot of research and came up with my own Windows NT host template.

Cookbook:
1) Install the Microsoft SNMP Service on your Windows NT box. You'll need to reinstall SP6a in order for the agent to actually run. Download SNMP4NT from http://www.wtcs.org/snmp4tpc/nt.htm and install it. Run mibinst.bat afterwards.
2) Copy winnt_disk.xml and winnt_cpu.xml to your <path_cacti>/resource/snmp_queries/ directory.
3) Import the cacti_host_template_windows_nt_host.xml template file. Done!

Pay attention that you have to manually add the upper limit (insert hard drive size in bytes) to your Disk graphs, as well as upper limit (Commit Limit in bytes) and Physical Memory (physical memory in bytes) to your Memory graphs. This is due to limitations in the Windows NT SNMP agent.
To be honest, the graphs are pretty ugly, but they're WAY better than no graph at all. I tested this successfully on two servers. Have fun!

Georger
Attachments
winnt.zip
Windows NT host template and associated SNMP queries.
(14.92 KiB) Downloaded 3893 times
Last edited by georger_br on Wed May 03, 2006 11:25 am, edited 3 times in total.
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

Works well thanks.

Have you considered using Host-Resources-V1 for the disk stats? I am using H-R-V2 for 2000/2003/XP machines seems to work well.
- Aaron Jeskey
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Post by georger_br »

Glad you like it. Seeing that my template was downloaded 58 times as of today is rewarding, but getting some real feedback is much better :)
You said right - it works fine for 2K/2K3/XP boxes because their native SNMP agent SUPPORTS the HRV1/HRV2 MIB. NT's native SNMP agent (9 years old now, see? :D) does not - and SNMP Informat does a great job filling that void. Regards,

Georger
ajeskey wrote:Works well thanks.

Have you considered using Host-Resources-V1 for the disk stats? I am using H-R-V2 for 2000/2003/XP machines seems to work well.
Sjowhan
Posts: 6
Joined: Thu Nov 03, 2005 2:34 pm
Location: Netherlands

Post by Sjowhan »

Thanks for this script. Perhaps this solves my problem (i'm getting the 2003-boxes not working with the 2k/xp script ;))
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Post by georger_br »

Anyone interested in seeing this template converted to 0.8.6g? I'll only bother to do it if somebody says they want it, because it's a fair bit of work to spend on an old platform - and the template works flawlessly in 0.8.6f. Regards,

Georger
luckyksc
Posts: 22
Joined: Tue Apr 19, 2005 5:24 pm

Can't get this to work

Post by luckyksc »

First off, thanks for the template!
I am using cactif, I can get the memory. But no graph for disk space. So I ran the verbose query and get this:

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'E:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.311.1.1.3.1.1.5.1.1'
+ Located input field 'informDiskInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.311.1.1.3.1.1.5.1.1'
+ Found item [informDiskInstance='0:0:C:'] index: 6.48.58.48.58.67.58 [from value]
+ Found item [informDiskInstance='_Total:_Total'] index: 13.95.84.111.116.97.108.58.95.84.111.116.97.108 [from value]
+ Found data query XML file at 'D:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'
+ Found data query XML file at 'D:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'
+ Found data query XML file at 'D:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'
+ Found data query XML file at 'D:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'
+ Found data query XML file at 'D:\Apache2\htdocs\cacti/resource/snmp_queries/winnt_disk.xml'

Sometime when I use get if to get the snmp information, I get wrong type(should be integer) for indexes.

What could be the problem?

Thanks,
Luckyksc
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

Am trying to import the new template (updated May 3rd), and am getting the following error:
Warning: filesize() [function.filesize]: stat failed for C:\WINDOWS\TEMP\php24F7.tmp in E:\Inetpub\wwwroot\cacti\templates_import.php on line 59

Warning: fread() [function.fread]: Length parameter must be greater than 0 in E:\Inetpub\wwwroot\cacti\templates_import.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at E:\Inetpub\wwwroot\cacti\templates_import.php:59) in E:\Inetpub\wwwroot\cacti\templates_import.php on line 71
Any ideas?
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Post by georger_br »

Hmm,
I just did a fresh install of Cacti on my dev machine, and it imported the template fine.
Is the TMP file OK? Does your webserver have permission to write to C:\WINDOWS\TEMP? Can you upload anything else with PHP?
My current environment is: Windows XP SP2, Apache 1.3.34, MySQL 5.0.20a, PHP 4.4.1, Cacti 0.8.6h + patches. Regards,

Georger
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

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

Sorted - was permissions errors on the TEMP folder for the IUSR user-id...
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Post by georger_br »

Did the new template work? Regards,

Georger
User avatar
AndyStewart
Cacti User
Posts: 102
Joined: Thu Sep 29, 2005 5:21 am
Location: Edinburgh, Scotland

Post by AndyStewart »

Is Use (RAM+Swap) is showing correct figure.
Total (RAM+Swap) is still incorrect. still looks like its 2^32 then resetting to 0 so only shows 114 MB. (see graph)

Although for some (other) reason, the disk stats now seem to be broken...will check these out...
Attachments
awdlive3.jpg
awdlive3.jpg (31.9 KiB) Viewed 38490 times
I don't care if the glass is half full or half empty, i want to know, who's been drinking my pint!!!

[size=75][Windows 2003 & IIS6] [Cacti 0.8.7b] [ActivePerl 5.8.8.817] [MySql 5.0.19] [NetSNMP 5.2.1.2-1] [PHP 5.1.2] [RRDTool 1.2.11]
[Plugins: PluginArchitecture, Monitor, Discovery, Threshold, Update, Reports, Manage, RealTime][/size]
georger_br
Cacti User
Posts: 63
Joined: Mon Jul 04, 2005 10:12 am
Location: Brazil

Post by georger_br »

You have to change the graph upper limit for disk graphs - the template now takes disk space in megabytes, not bytes.
About the memory problem, try the following:

Click Data Templates
Edit "Windows NT - SNMP - SNMP4NT - Memory Allocatable"
Change "Maximum Value" to 0. It's 16 GB right now, but who knows if it has a hard-coded 2^32 ceiling. Regards,

Georger
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

hello, can you help me ?
Attachments
error.JPG
error.JPG (32.6 KiB) Viewed 36912 times
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

solved
it was the graph template
i have delete it and recreated
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests