Skip to main content
Needs Votes

[new plugin] isc-kea-dhcp

Related products:Infra Monitoring - Connectors
  • August 14, 2024
  • 4 replies
  • 87 views

Forum|alt.badge.img+11

Hello all,

Since isc-dhcp is end of life and is replaced by isc-kea-dhcp, It would be very useful to have a plugin to be able to monitor dhcp KEA server statistics of packets such as :

  • discover-received
  • nak-sent
  • offer-sent
  • ack-sent
  • request-received

 

and pools usage such as :

  • total-addresses
  • assigned-addresses
  • ...

 

Thanks a lot

4 replies

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • August 23, 2024
NewDiscussion ongoing

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • August 23, 2024
Updated idea statusDiscussion ongoingNeeds Votes

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • August 23, 2024

How would we get those metrics? Is there a CLI, API to Kea?


Forum|alt.badge.img+11
  • Author
  • Builder *
  • August 23, 2024

Dear @rchauvel ,

Yes, Kea provide API for this.

Here here you will find all the API documentation  > https://kea.readthedocs.io/en/latest/api.html

Here official documentation about command “statistic-get” https://kea.readthedocs.io/en/latest/api.html#statistic-get

for example, I used the command below
curl -X POST -H "Content-Type: application/json" -d '{ "command": "statistic-get", "arguments": {"name": "pkt4-ack-sent"}, "service": [ "dhcp4" ]}' http://127.0.0.1:8000/
 
 
but it is also possible to obtain all the statistics with a single command “statistic-get-all”  https://kea.readthedocs.io/en/latest/api.html#statistic-get-all

curl -X POST -H "Content-Type: application/json" -d '{ "command": "statistic-get-all", "service": [ "dhcp4" ]}' http://127.0.0.1:8000/

 

Below is an example of a “first” run response for statistic “pkt4-ack-sent”

[ { "arguments": {

    "pkt4-ack-sent": [

    [ 10361, "2024-08-23 16:12:06.909295" ],

    [ 10360, "2024-08-23 16:11:43.973630" ],

    [ 10359, "2024-08-23 16:11:19.347363" ],

    [ 10358, "2024-08-23 16:11:15.245672" ],

    [ 10357, "2024-08-23 16:10:38.329874" ],

    [ 10356, "2024-08-23 16:10:20.615629" ],

    [ 10355, "2024-08-23 16:09:58.122563" ],

    [ 10354, "2024-08-23 16:09:36.889122" ],

    [ 10353, "2024-08-23 16:09:13.945146" ],

    [ 10352, "2024-08-23 16:08:49.327541" ],

    [ 10351, "2024-08-23 16:08:45.225745" ],

    [ 10350, "2024-08-23 16:08:08.299823" ],

    [ 10349, "2024-08-23 16:07:50.585751" ],

    [ 10348, "2024-08-23 16:07:28.102418" ],

    [ 10347, "2024-08-23 16:07:06.869778" ],

    [ 10346, "2024-08-23 16:06:43.917068" ],

    [ 10345, "2024-08-23 16:06:19.291991" ],

    [ 10344, "2024-08-23 16:06:15.205099" ],

    [ 10343, "2024-08-23 16:05:38.289962" ],

    [ 10342, "2024-08-23 16:05:20.565687" ]

    ] }, "result": 0 } ]

 

below the answer to the “second” run     

[ { "arguments": {

    "pkt4-ack-sent": [

    [ 10377, "2024-08-23 16:17:50.685336" ],

    [ 10376, "2024-08-23 16:17:28.228027" ],

    [ 10375, "2024-08-23 16:17:06.958158" ],

    [ 10374, "2024-08-23 16:16:44.004034" ],

    [ 10373, "2024-08-23 16:16:19.398865" ],

    [ 10372, "2024-08-23 16:16:15.295104" ],

    [ 10371, "2024-08-23 16:15:38.359188" ],

    [ 10370, "2024-08-23 16:15:20.646954" ],

    [ 10369, "2024-08-23 16:14:58.191906" ],

    [ 10368, "2024-08-23 16:14:36.938840" ],

    [ 10367, "2024-08-23 16:14:13.983225" ],

    [ 10366, "2024-08-23 16:13:49.367915" ],

    [ 10365, "2024-08-23 16:13:45.275336" ],

    [ 10364, "2024-08-23 16:13:08.339029" ],

    [ 10363, "2024-08-23 16:12:50.636297" ],

    [ 10362, "2024-08-23 16:12:28.143346" ],

    [ 10361, "2024-08-23 16:12:06.909295" ],

    [ 10360, "2024-08-23 16:11:43.973630" ],

    [ 10359, "2024-08-23 16:11:19.347363" ],

    [ 10358, "2024-08-23 16:11:15.245672" ]

    ] }, "result": 0 } ]    

  

With that we can determine that between 16h12 and 16h17 there are 16 ACK sent.

 

Below we see the pool 0 of subnet id 202 has 5 IP addresses whose lease is active since 21-08-2024.

 

curl -X POST -H "Content-Type: application/json" -d '{ "command": "statistic-get", "arguments": {"name": "subnet[202].pool[0].assigned-addresses"}, "service": [ "dhcp4" ]}' http://127.0.0.1:8000/


[ { "arguments": {

    "subnet[202].pool[0].assigned-addresses": [

    [ 5, "2024-08-21 09:27:38.779610" ],

    [ 4, "2024-08-21 09:26:59.167705" ],

    [ 3, "2024-08-21 09:26:56.144104" ],

    [ 2, "2024-08-21 09:26:31.365483" ],

    [ 1, "2024-08-21 09:26:14.311218" ],

    [ 0, "2024-08-19 10:05:32.540398" ] ]

    }, "result": 0 } ]

 

 

I remain at your disposal if you need anything.

thanks a lot