Hello,
I have run into an issue with the docker-stats.sh script - the Container Memory usage, % graph is showing as nan, even though the values are being returned to LibreNMS. This is using the SNMP extend method as laid out in the documentation ( Applications - LibreNMS Docs).
The Docker output on the host shows the memory usage in %:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
b7a319ab3de7 rtorrent_logs 0.01% 1.68MiB / 3.705GiB 0.04% 50.5kB / 0B 3.62MB / 0B 1
bf7957ccd0ae rtorrent 19.09% 340.9MiB / 3.705GiB 8.98% 21.5GB / 555GB 416MB / 2.19GB 150
d90c96420abe rtorrent_geoip 0.00% 28.7MiB / 3.705GiB 0.76% 133MB / 1.48MB 389MB / 259MB 10
The script output run locally on the same host as the SNMP user:
root@pi:/home/# sudo -u Debian-snmp /etc/snmp/docker-stats.sh
{“version”:“1”,“data”:[{“container”:“rtorrent_logs”,“pids”:1,“memory”:{“used”:“1.68MiB”,“limit”:“3.705GiB”,“perc”:“0.04%”},“cpu”:“0.01%”},{“container”:“rtorrent”,“pids”:150,“memory”:{“used”:“350.8MiB”,“limit”:“3.705GiB”,“perc”:“9.25%”},“cpu”:“2.13%”},{“container”:“rtorrent_geoip”,“pids”:10,“memory”:{“used”:“28.86MiB”,“limit”:“3.705GiB”,“perc”:“0.76%”},“cpu”:“0.00%”}],“error”:“0”,“errorString”:“”}
From this I assume the script runs correctly and retrieves the correct values.
Debugging on the LibreNMS host shows that the values are being received:
.1.3.6.1.4.1.8072.1.3.2.3.1.1.6.100.111.99.107.101.114 = STRING: “{"version":"1","data":[{"container":"rtorrent_logs","pids":1,"memory":{"used":"1.68MiB","limit":"3.705GiB","perc":"0.04%"},"cpu":"0.01%"},{"container":"rtorrent","pids":150,"memory":{"used":"340.7MiB","limit":"3.705GiB","perc":"8.98%"},"cpu":"0.57%"},{"container":"rtorrent_geoip","pids":10,"memory":{"used":"28.86MiB","limit":"3.705GiB","perc":"0.76%"},"cpu":"0.00%"}],"error":"0","errorString":""}”
This suggests that LibreNMS is receiving the values from the script correctly, but the graph does not populate:
Docker is running on a Raspberry Pi 4; I asked a friend earlier and he was able to reproduce this on his Pi, as well as on an x86 machine. Just to reiterate, this is the only Docker graph which is not drawing - the others are all correct.
Output of validate.php:
librenms@LibreNMS:/root$ /opt/librenms/validate.php
Component | Version |
---|---|
LibreNMS | 21.12.1-11-g6dc3e4217 |
DB Schema | 2021_11_29_165436_improve_ports_search_index (229) |
PHP | 7.4.25 |
Python | 3.9.2 |
MySQL | 10.5.12-MariaDB-0+deb11u1 |
RRDTool | 1.7.2 |
SNMP | 5.9 |
==================================== |
[OK] Composer Version: 2.2.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
It seems to me that the system does not know what to do with the value or how to interpret it - any assistance would be much appreciated.