[stork-users] Problem with subnet statistics/utilization

Tobias Hachmer t.hachmer at s-v.de
Wed Sep 16 11:29:31 UTC 2020


Hello,

first of all, thanks for this nice kea ui!

In our test installation we have encountered a problem with the subnet
statistics.

To begin it was not easy to get the information that the stat_cmds hook
has to be loaded. Maybe this is a point to add to the stork documentation.

After enabling the stat_cmds hook the Stork DHCP Dashboard takes a long
time to load the Subnet/Shared Networks and Service Status information.
After the subnets are listed in the dashboard all of them shows 0% used,
which is not correct.

On the dhcp/subnets view no subnets are shown. The one shown row shows
subnet id 1 with a green bar in the subnet column, but nothing else.

In the stork server logs I have seen the following entries whose maybe
points to the problem:

---
Sep 16 10:27:31 stork-server-vm stork-server[12020]: INFO[2020-09-16
10:27:31]              rps.go:295   Updating KeaDHCPDaemonStats: {RPS1:1
RPS2:1 AddrUtilization:0 PdUtilization:0}
Sep 16 10:27:31 stork-server-vm stork-server[12020]: INFO[2020-09-16
10:27:31]      statspuller.go:112   completed pulling lease stats from
Kea apps: 1/1 succeeded
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 18823000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 10000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 20000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 10000000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 12000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 10120000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 10000000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 20000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 9000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 30000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 31000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 31128 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 65000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 11000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 12000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 7000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 6000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 5000 stats
Sep 16 10:27:31 stork-server-vm stork-server[12020]: WARN[2020-09-16
10:27:31]      statspuller.go:59    missing key total-addreses in
LocalSubnet 8000 stats
Sep 16 10:27:32 stork-server-vm stork-server[12020]: INFO[2020-09-16
10:27:32]      statepuller.go:66    completed pulling lease stats from
Kea apps: 1/1 succeeded
---

In our stork database I've found this:

---
stork=# select * from local_subnet;
 app_id | subnet_id | local_subnet_id |     stats_collected_at     |
                                                   stats
--------+-----------+-----------------+----------------------------+-------------------------------------------------------------------------------------------------------------------
      1 |        10 |           30000 | 2020-09-16 11:25:31.383009 |
{"total-addresses": 211, "assigned-addresses": 110,
"declined-addresses": 0, "cumulative-assigned-addresses": 28}
      1 |        11 |           31000 | 2020-09-16 11:25:31.383766 |
{"total-addresses": 115, "assigned-addresses": 5, "declined-addresses":
0, "cumulative-assigned-addresses": 4}
      1 |        16 |           12000 | 2020-09-16 10:35:31.386954 |
{"total-addresses": 215, "assigned-addresses": 0, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         4 |        10000000 | 2020-09-15 15:37:31.286997 |
{"total-addresses": 211, "assigned-addresses": 1, "declined-addresses":
0, "cumulative-assigned-addresses": 1}
      1 |        17 |        10120000 | 2020-09-16 11:25:31.387452 |
{"total-addresses": 215, "assigned-addresses": 0, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |        15 |           12000 | 2020-09-16 11:25:31.3815   |
{"total-addresses": 215, "assigned-addresses": 0, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         3 |           20000 | 2020-09-16 11:00:31.295997 |
{"total-addresses": 231, "assigned-addresses": 41, "declined-addresses":
0, "cumulative-assigned-addresses": 6}
      1 |        18 |           20000 | 2020-09-16 11:25:31.382265 |
{"total-addresses": 231, "assigned-addresses": 40, "declined-addresses":
0, "cumulative-assigned-addresses": 6}
      1 |         5 |            5000 | 2020-09-16 11:25:31.359225 |
{"total-addresses": 121, "assigned-addresses": 0, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         6 |            6000 | 2020-09-16 11:25:31.36222  |
{"total-addresses": 51, "assigned-addresses": 0, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         7 |            7000 | 2020-09-16 11:25:31.374033 |
{"total-addresses": 50, "assigned-addresses": 1, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         8 |            8000 | 2020-09-16 11:25:31.377094 |
{"total-addresses": 244, "assigned-addresses": 6, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
      1 |         9 |            9000 | 2020-09-16 11:25:31.378491 |
{"total-addresses": 0, "assigned-addresses": 0, "declined-addresses": 0,
"cumulative-assigned-addresses": 0}
      1 |        14 |           11000 | 2020-09-16 11:25:31.380637 |
{"total-addresses": 21, "assigned-addresses": 4, "declined-addresses":
0, "cumulative-assigned-addresses": 4}
      1 |         2 |        18823000 | 2020-09-16 11:25:31.388846 |
{"total-addresses": 0, "assigned-addresses": 14, "declined-addresses":
0, "cumulative-assigned-addresses": 193}
      1 |         1 |           10000 | 2020-09-16 11:25:31.379256 |
{"total-addresses": 0, "assigned-addresses": 1, "declined-addresses": 0,
"cumulative-assigned-addresses": 96}
      1 |        19 |        10000000 | 2020-09-16 11:25:31.386649 |
{"total-addresses": 211, "assigned-addresses": 2, "declined-addresses":
0, "cumulative-assigned-addresses": 5}
      1 |        12 |           31128 | 2020-09-16 11:25:31.38511  |
{"total-addresses": 116, "assigned-addresses": 6, "declined-addresses":
0, "cumulative-assigned-addresses": 6}
      1 |        13 |           65000 | 2020-09-16 11:25:31.385914 |
{"total-addresses": 55, "assigned-addresses": 1, "declined-addresses":
0, "cumulative-assigned-addresses": 0}
---

---
stork=# select * from subnet;
 id |         created_at         |      prefix       | shared_network_id
| client_class | addr_utilization | pd_utilization
----+----------------------------+-------------------+-------------------+--------------+------------------+----------------
  2 | 2020-09-14 12:43:38.070283 | 192.xx.0/24   |                 1 |
            |                  |
  1 | 2020-09-14 12:43:38.070283 | 192.xx.0/24   |                 1 |
            |                  |
  3 | 2020-09-14 12:43:38.070283 | 192.xx.0/22   |                 2 |
            |                  |
  4 | 2020-09-14 12:43:38.070283 | 10.xx.0/24       |                 2
|              |                  |
 16 | 2020-09-15 09:14:45.857752 | 192.xx.0/24   |                 3 |
            |                  |
 17 | 2020-09-15 09:14:45.857752 | 10.xx.0/24      |                 3 |
             |                  |
 19 | 2020-09-15 09:14:45.857752 | 10.xx.0/24       |                 4
|              |                  |
 18 | 2020-09-15 09:14:45.857752 | 192.xx.0/22   |                 4 |
            |                  |
  9 | 2020-09-14 12:43:38.070283 | 192.xx.0/24    |                   |
             |                  |
 10 | 2020-09-14 12:43:38.070283 | 192.xx.0/24   |                   |
            |                  |
 11 | 2020-09-14 12:43:38.070283 | 192.xx.0/25   |                   |
            |                  |
 12 | 2020-09-14 12:43:38.070283 | 192.xx.128/25 |                   |
            |                  |
 13 | 2020-09-14 12:43:38.070283 | 192.xx.0/24   |                   |
            |                  |
 14 | 2020-09-15 08:54:15.9463   | 192.xx.0/24   |                   |
            |                  |
 15 | 2020-09-15 08:54:15.9463   | 192.xx.0/24   |                   |
            |                  |
  7 | 2020-09-14 12:43:38.070283 | 192.xx.0/24    |                   |
             |                  |
  6 | 2020-09-14 12:43:38.070283 | 192.xx.0/24    |                   |
             |                  |
  5 | 2020-09-14 12:43:38.070283 | 192.xx.0/24    |                   |
             |                  |
  8 | 2020-09-14 12:43:38.070283 | 192.xx.0/24    |                   |
             |                  |
(19 rows)
---

Does someone have hints for me to check? Have I configured something
wrong or is this a bug?

Thanks in advance and kind regards,
Tobias Hachmer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.isc.org/pipermail/stork-users/attachments/20200916/8ab8a54d/attachment.bin>


More information about the Stork-users mailing list