[XML] Microsoft DHCP Free / In Use Script

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

Moderators: Developers, Moderators

MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Server 2008?

Post by MU-IT »

I've got this script working on my 2003 servers, and it's proving to be quite informative.... how do i get this to work on server 2008? i have the 08 server in cacti, and am graphing interface stats, and the OID is exactly the same (and yeilds accurate data), yet I get this:

Data Query Debug Information
+ Running data query [28].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.311.1.3.2.1.1.1'
+ No SNMP data returned
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'


what am i missing?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

post the snmpwalk of .1.3.6.1.4.1.311.1.3.2.1.1.1 against the 2008 server.
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

BSOD2600 wrote:post the snmpwalk of .1.3.6.1.4.1.311.1.3.2.1.1.1 against the 2008 server.

Here's the results of the SNMP Walk from the .1.3.6.1.4.1.311.1.3.2.1.1.1 , .1.3.6.1.4.1.311.1.3.2.1.1.2, and .1.3.6.1.4.1.311.1.3.2.1.1.3 that are referenced in the http://forums.cacti.net//files/microsoft_dhcp.xml.


C:\Inetpub\wwwroot\cacti\scripts>snmpwalk -v2c -cPuBlic.Ro2006! <valid IP> 1.3.6.1.4.1.311.1.3.2.1.1.1

Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP> = IpAddress: <valid IP>
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP> = IpAddress: <valid IP>
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP>= IpAddress: <valid IP>
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP>= IpAddress: <valid IP>
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP>= IpAddress: <valid IP>
SNMPv2-SMI::enterprises.311.1.3.2.1.1.1.<valid IP> = IpAddress: <valid IP>

C:\Inetpub\wwwroot\cacti\scripts>snmpwalk -v2c -cPuBlic.Ro2006! <valid IP> 1
.3.6.1.4.1.311.1.3.2.1.1.2
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP> = Counter32: 284
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP>= Counter32: 286
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP> = Counter32: 393
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP> = Counter32: 154
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP>= Counter32: 300
SNMPv2-SMI::enterprises.311.1.3.2.1.1.2.<valid IP> = Counter32: 253

C:\Inetpub\wwwroot\cacti\scripts>snmpwalk -v2c -cPuBlic.Ro2006! <valid IP> 1
.3.6.1.4.1.311.1.3.2.1.1.3
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP> = Counter32: 197
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP>= Counter32: 186
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP>Counter32: 79
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP> = Counter32: 330
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP> = Counter32: 171
SNMPv2-SMI::enterprises.311.1.3.2.1.1.3.<valid IP> = Counter32: 231
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

Is this one of those things that should be painfully obvious that i cannot see?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

No, on quick look of the XML script, it appears it should work. In a bit when I've got time, I'll fire up my 2003 and 2008 VM's to compare the differences of the output.

I assume other SNMP scripts are working against the problematic windows 2008 box?
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

BSOD2600 wrote:No, on quick look of the XML script, it appears it should work. In a bit when I've got time, I'll fire up my 2003 and 2008 VM's to compare the differences of the output.

I assume other SNMP scripts are working against the problematic windows 2008 box?
yes. I have traffic, process, and logged in users graphing correctly.

Thanks for your help BSOD.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

This script still appears to be completely functional. I added the DHCP server role to my windows 2008 SP2 server and had a client get an address from it.

Code: Select all

C:\>snmpwalk -v 2c -c public -On Cacti-Win2K8x64 1.3.6.1.4.1.311.1.3.2
.1.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0 = IpAddress: 192.168.5.0
.1.3.6.1.4.1.311.1.3.2.1.1.2.192.168.5.0 = Counter32: 1
.1.3.6.1.4.1.311.1.3.2.1.1.3.192.168.5.0 = Counter32: 8
.1.3.6.1.4.1.311.1.3.2.1.1.4.192.168.5.0 = Counter32: 0
The data query in cacti works as well

Code: Select all

+ Running data query [27].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.311.1.3.2.1.1.1'
+ Index found at OID: 'iso.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0' value: '192.168.5.0'
+ index_parse at OID: 'iso.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0' results: '192.168.5.0'
+ Located input field 'subnetAdd' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.311.1.3.2.1.1.1'
+ Found item [subnetAdd='192.168.5.0'] index: 192.168.5.0 [from value]
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
So, the question is now what non-standard things are you doing with your configs? ;)
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

BSOD2600 wrote:This script still appears to be completely functional. I added the DHCP server role to my windows 2008 SP2 server and had a client get an address from it.

Code: Select all

C:\>snmpwalk -v 2c -c public -On Cacti-Win2K8x64 1.3.6.1.4.1.311.1.3.2
.1.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0 = IpAddress: 192.168.5.0
.1.3.6.1.4.1.311.1.3.2.1.1.2.192.168.5.0 = Counter32: 1
.1.3.6.1.4.1.311.1.3.2.1.1.3.192.168.5.0 = Counter32: 8
.1.3.6.1.4.1.311.1.3.2.1.1.4.192.168.5.0 = Counter32: 0
The data query in cacti works as well

Code: Select all

+ Running data query [27].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.311.1.3.2.1.1.1'
+ Index found at OID: 'iso.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0' value: '192.168.5.0'
+ index_parse at OID: 'iso.3.6.1.4.1.311.1.3.2.1.1.1.192.168.5.0' results: '192.168.5.0'
+ Located input field 'subnetAdd' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.311.1.3.2.1.1.1'
+ Found item [subnetAdd='192.168.5.0'] index: 192.168.5.0 [from value]
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/microsoft_dhcp.xml'
So, the question is now what non-standard things are you doing with your configs? ;)
Doh!

I'm not aware of anything unusual... Thanks for the footwork BSOD!
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

BSOD2600 wrote: So, the question is now what non-standard things are you doing with your configs? ;)
I'm using this template on 2003 servers without issue, and the 2008 server install is standard... nothing changed from a typical dhcp installation.

what could/should I check? Everything I can think of turns out to lead me to believe it should work... only it doesn't; i'd appreciate any ideas / direction.

thanks.
mcaser
Posts: 3
Joined: Fri Feb 01, 2008 3:49 am

Re: [XML] Microsoft DHCP Free / In Use Script

Post by mcaser »

if I have several subnet using vlan, I am wondering if this template can get IP free / in use amount in each subnet/vlan or not?
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: [XML] Microsoft DHCP Free / In Use Script

Post by mcutting »

mcaser wrote:if I have several subnet using vlan, I am wondering if this template can get IP free / in use amount in each subnet/vlan or not?
I have the same setup (4 VLANS via one DHCP server), and this works fine for me.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
ch3i
Posts: 17
Joined: Tue Mar 03, 2015 6:22 am

Re: [XML] Microsoft DHCP Free / In Use Script

Post by ch3i »

Hi,

I'm using this script during 3 years, we just upgrade our DHCP server into 2012 server.
snmpwalk return nothing, the 311 OID isn't supported in 2012 (https://technet.microsoft.com/en-us/lib ... 31568.aspx)

Is there a way to monitor DHCP lease in 2012 server with Cacti ?

Regards,
Ch3i.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests