Monitor Infoblox DHCP subnet percentage used

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

Moderators: Developers, Moderators

Post Reply
pvalck
Posts: 17
Joined: Wed Feb 01, 2012 3:36 am

Monitor Infoblox DHCP subnet percentage used

Post by pvalck »

Hey all,

I'm trying to get a script to work but it's not. Maybe that someone can tell me where i made a mistake in the script as i get some output but not exactly what i want.

We have some infoblox appliances and i want to monitor the usage percentage of the created vlan's on them. I found in the mib files the corresponding OID's but they don't have a perfect index so i create one with the numbers after the 33 number.

Here is the code i wrote for it.

Code: Select all

<dhcp_utilisation>
        <name>Get dhcp utilisation </name>
        <description>Queries a host for a list of monitorable DHCP outputs</description>
        <oid_index>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1</oid_index>
	<oid_index_parse>OID/REGEXP:^.{33}(.*)</oid_index_parse>

	<fields>
        <ibDHCPSubnetNetworkAddress>
            <name>Network</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1</oid>
        </ibDHCPSubnetNetworkAddress>
        <ibDHCPSubnetNetworkMask>
            <name>NetworkMask</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2</oid>
        </ibDHCPSubnetNetworkMask>
        <ibDHCPSubnetPercentUsed>
            <name>Percentage</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3</oid>
        </ibDHCPSubnetPercentUsed>
    </fields>
</dhcp_utilisation>
Here is the result i get from the code:
+ Running data query [40].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/data/cacti/resource/snmp_queries/IB-DHCPutilisation.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.7779.3.1.1.4.1.1.1'
+ Index found at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1.10.49.48.46.49.50.49.46.48.46.48' value: '10.200.2.0'
+ Index found at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2.10.49.48.46.49.50.49.46.48.46.48' value: '255.255.255.0'
+ Index found at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3.10.49.48.46.49.50.49.46.48.46.48' value: '15'
+ index_parse at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1.10.49.48.46.49.50.49.46.48.46.48' results: '10.49.48.46.49.50.49.46.48.46.48'
+ index_parse at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2.10.49.48.46.49.50.49.46.48.46.48' results: '10.49.48.46.49.50.49.46.48.46.48'
+ index_parse at OID: '1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3.10.49.48.46.49.50.49.46.48.46.48' results: '10.49.48.46.49.50.49.46.48.46.48'
+ Located input field 'ibDHCPSubnetNetworkAddress' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1'
+ Found item [ibDHCPSubnetNetworkAddress='10.200.2.0'] index: 10.49.48.46.50.48.48.46.50.46.48 [from value]
+ Located input field 'ibDHCPSubnetNetworkMask' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2'
+ Found item [ibDHCPSubnetNetworkMask='255.255.255.0'] index: 10.49.48.46.49.50.49.46.48.46.48 [from value]
+ Found data query XML file at '/var/data/cacti/resource/snmp_queries/IB-DHCPutilisation.xml'
+ Found data query XML file at '/var/data/cacti/resource/snmp_queries/IB-DHCPutilisation.xml'
+ Found data query XML file at '/var/data/cacti/resource/snmp_queries/IB-DHCPutilisation.xml'
I can't put here the info that i get back when i perform a normal snmpwalk as in the MIB this info is in a table.

Can someone tell me what is wrong in my script and how i can solve it?

Thx,
Peter
pvalck
Posts: 17
Joined: Wed Feb 01, 2012 3:36 am

Re: Monitor Infoblox DHCP subnet percentage used

Post by pvalck »

I found the solution of the code i hope, but unfortunately the graphs result only in NAN.

Code: Select all

<dhcp_utilisation>
        <name>Get dhcp utilisation </name>
        <description>Queries a host for a list of monitorable DHCP outputs</description>
        <oid_index>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1</oid_index>
		<oid_index_parse>OID/REGEXP:^.{33}(.*)</oid_index_parse>
		<index_order>index</index_order>
		
	<fields>
		<index>
            <name>Index</name>
            <source>index</source>
            <direction>input</direction>
        </index>
        <ibDHCPSubnetNetworkAddress>
            <name>Network</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1</oid>
        </ibDHCPSubnetNetworkAddress>
        <ibDHCPSubnetNetworkMask>
            <name>NetworkMask</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2</oid>
        </ibDHCPSubnetNetworkMask>
        <ibDHCPSubnetPercentUsed>
            <name>Percentage</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3</oid>
        </ibDHCPSubnetPercentUsed>
    </fields>
</dhcp_utilisation>
If i find the solution i'll post it here.

P.
HzE
Posts: 20
Joined: Wed Oct 27, 2010 5:40 am
Location: Espoo, Finland
Contact:

Re: Monitor Infoblox DHCP subnet percentage used

Post by HzE »

pvalck wrote:I found the solution of the code i hope, but unfortunately the graphs result only in NAN.

If i find the solution i'll post it here.

P.
Maybe you had the same problem as I did? -> http://forums.cacti.net/viewtopic.php?f=12&t=45749 (forgot to tick that checkbox)

I used this query as a base, created templates and so far it seems to be running quite okay for me.
nafets
Posts: 12
Joined: Fri Sep 30, 2022 8:24 am

Re: Monitor Infoblox DHCP subnet percentage used

Post by nafets »

This thread was abandoned in 2014, but has anyone ever got a working template to monitor DHCP scope usage? I know the Infoblox appliances can warn you by mail, as someone in a related thread suggested, but that is not what I am looking for. However the xml in this thread does not work and templates for the datasources and graphs were never shared here.

I use IB-1425 appliances and the SNMP is still in the same place.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Monitor Infoblox DHCP subnet percentage used

Post by TheWitness »

Without access to the unit I can not help. There are several OID parse techniques you could use, and depending on the complexity of the OID parsing, some of this could be better handled in a Script Query vs. an SNMP Query.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
nafets
Posts: 12
Joined: Fri Sep 30, 2022 8:24 am

Re: Monitor Infoblox DHCP subnet percentage used

Post by nafets »

Thanks for your response. Unfortunately I can't give you access to our equipment and I know you weren't offering to solve this for me, but I'll restart the thread anyway with my information.

snmpwalk -c mycomm -v 1 -On 10.10.10.10 .1.3.6.1.4.1.7779.3.1.1.4.1.1.1
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1.8.49.48.46.49.46.48.46.48 = STRING: "10.1.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1.8.49.48.46.50.46.48.46.48 = STRING: "10.2.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1.8.49.48.46.51.46.48.46.48 = STRING: "10.3.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2.8.49.48.46.49.46.48.46.48 = STRING: "255.255.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2.8.49.48.46.50.46.48.46.48 = STRING: "255.255.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2.8.49.48.46.51.46.48.46.48 = STRING: "255.255.0.0"
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3.8.49.48.46.49.46.48.46.48 = INTEGER: 81
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3.8.49.48.46.50.46.48.46.48 = INTEGER: 35
.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3.8.49.48.46.51.46.48.46.48 = INTEGER: 51

which stands for:
snmpwalk -c mycomm -v 1 10.10.10.10 .1.3.6.1.4.1.7779.3.1.1.4.1.1.1
IB-DHCPONE-MIB::ibDHCPSubnetNetworkAddress."10.1.0.0" = STRING: "10.1.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetNetworkAddress."10.2.0.0" = STRING: "10.2.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetNetworkAddress."10.3.0.0" = STRING: "10.3.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetNetworkMask."10.1.0.0" = STRING: "255.255.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetNetworkMask."10.2.0.0" = STRING: "255.255.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetNetworkMask."10.3.0.0" = STRING: "255.255.0.0"
IB-DHCPONE-MIB::ibDHCPSubnetPercentUsed."10.1.0.0" = INTEGER: 81
IB-DHCPONE-MIB::ibDHCPSubnetPercentUsed."10.2.0.0" = INTEGER: 35
IB-DHCPONE-MIB::ibDHCPSubnetPercentUsed."10.3.0.0" = INTEGER: 51


It's quite clear that everything starts at .1.3.6.1.4.1.7779.3.1.1.4.1.1.1, and then
.1 = ibDHCPSubnetNetworkAddress
.2 = ibDHCPSubnetNetworkMask
.3 = ibDHCPSubnetPercentUsed

My challenge is that there is no index, and there is no other oid to derive the number of defined DHCP scopes from. The strings in .1 and .2 have a maximum length of 33 characters because they write out the full IP and Netmask in ASCII. I think I can manage from the point the xml will generate an index, but fiddling around with the available examples and the documentation has not generated any index for me. I should probably count the number of entries for ibDHCPSubnetNetworkAddress first, and that might best be done with a script query. If so, then I will look into that.


xml file:

Code: Select all

<dhcp_utilisation>
  <name>Get dhcp utilisation</name>
  <description>Queries a host for a list of monitorable DHCP outputs</description>
  <oid_index>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1</oid_index>
  <oid_index_parse>OID/REGEXP:^.{33}(.*)</oid_index_parse>
  <index_order>index</index_order>		

  <fields>
    <index>
      <name>Index</name>
      <source>index</source>
      <direction>input</direction>
    </index>
    <ibDHCPSubnetNetworkAddress>
      <name>Network</name>
      <method>walk</method>
      <source>value</source>
      <direction>input</direction>
      <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.1</oid>
    </ibDHCPSubnetNetworkAddress>
    <ibDHCPSubnetNetworkMask>
      <name>NetworkMask</name>
      <method>walk</method>
      <source>value</source>
      <direction>input</direction>
      <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.2</oid>
    </ibDHCPSubnetNetworkMask>
    <ibDHCPSubnetPercentUsed>
      <name>Percentage</name>
      <method>walk</method>
      <source>value</source>
      <direction>output</direction>
      <oid>.1.3.6.1.4.1.7779.3.1.1.4.1.1.1.3</oid>
    </ibDHCPSubnetPercentUsed>
  </fields>
</dhcp_utilisation>

result:
Data Query Debug Information
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/infoblox_subnets.xml'
Total: 0.000000, Delta: 0.000000, Running Data Query [24].
Total: 0.000000, Delta: 0.000000, Found Type = '4' [Script Query].
Total: 0.000000, Delta: 0.000000, XML file parsed ok.
Total: 0.000000, Delta: 0.000000, <arg_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting arg_index entries
Total: 0.000000, Delta: 0.000000, ERROR: Data Query returned no indexes.
Last edited by nafets on Sat Nov 26, 2022 7:55 am, edited 1 time in total.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Monitor Infoblox DHCP subnet percentage used

Post by TheWitness »

Walk all those OID's and post the results.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
nafets
Posts: 12
Joined: Fri Sep 30, 2022 8:24 am

Re: Monitor Infoblox DHCP subnet percentage used

Post by nafets »

I already posted the information of the first three entries of my 249 DHCP scopes. If you mean walking the tree a bit higher up to see if there's some sort of an indextable of a counter which says "3" (or "249" in reality), there isn't. There is also no mention of a relevant table in the MIBfile. The only other information in this DHCPv4 part of the snmpwalk is about the total number of discoveries, requests, releases etc., which is not relevant to the defined DHCP scopes and their usage. I will not post more of the snmpwalk as there is company information in it, which is a bit too much to anonymize.

I'll search some more on the forum about indexing data that has no index, but what I found so far has answers like: I solved it and will let you know. End of thread. I'll also look into a way of doing it with an SNMP query.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Monitor Infoblox DHCP subnet percentage used

Post by TheWitness »

Just saw that. So, basically, I would make the following the index:

Code: Select all

49.48.46.49.46.48.46.48
Unless you want the index converted to an IP address, and just use that throughout. If you want that series of digits to transform into an IP Address, there may be a modifier for that. But you will have to use the OID INDEX PARSE on everything. We just received a contribution for the 1.2.23 and 1.3 branches to do the OID INDEX PARSE on the value too. So, that might be your ticket.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Monitor Infoblox DHCP subnet percentage used

Post by TheWitness »

Until the 1.2.23/1.3 is released, you can get the data here:

https://github.com/Cacti/documentation/ ... Queries.md

What you are looking for is value_index_parse. I hope this helps.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests