- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
06-30-2021 10:26 AM
Is anyone using the API or another method to pull dhcp scope utilization? I'd like to pull these stats via API and graph utilization using Grafana?
07-01-2021 07:33 AM - edited 07-01-2021 07:33 AM
Hi @MatthewDeSantos, you can grab the lease information via API:
https://{{host}}/api/?key={{key}}&type=op&cmd=<show><dhcp><server><lease><interface>{{interface-name}}</interface></lease></server></dhcp></show>
The response will look something like this:
<response status="success">
<result>
<interface name="ethernet1/2" id="17" allocated="11" total="51">
<entry name="192.168.0.50">
<ip>192.168.0.50</ip>
<mac>00:00:00:00:00:00</mac>
<state>reserved</state>
</entry>
<entry name="192.168.0.121">
<ip>192.168.0.121</ip>
<mac>00:00:00:00:00:00</mac>
<state>reserved</state>
</entry>
<entry name="192.168.0.115">
.
.
.
Where you would take allocated=11 and total=51, to derive the utilisation. In this case 22%.
Hope this helps!
07-01-2021 07:33 AM - edited 07-01-2021 07:33 AM
Hi @MatthewDeSantos, you can grab the lease information via API:
https://{{host}}/api/?key={{key}}&type=op&cmd=<show><dhcp><server><lease><interface>{{interface-name}}</interface></lease></server></dhcp></show>
The response will look something like this:
<response status="success">
<result>
<interface name="ethernet1/2" id="17" allocated="11" total="51">
<entry name="192.168.0.50">
<ip>192.168.0.50</ip>
<mac>00:00:00:00:00:00</mac>
<state>reserved</state>
</entry>
<entry name="192.168.0.121">
<ip>192.168.0.121</ip>
<mac>00:00:00:00:00:00</mac>
<state>reserved</state>
</entry>
<entry name="192.168.0.115">
.
.
.
Where you would take allocated=11 and total=51, to derive the utilisation. In this case 22%.
Hope this helps!
07-09-2021 11:51 AM
Thanks for the reply, would you happen to know if this could be translated into a grafana query/graph?
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!