librenms/librenms-agent

Pi-Hole script: `DHCP_ACTIVE` can generate an error if its not defined

Chewie9999 opened this issue · 1 comments

DHCP_ACTIVE can generate an error if its not defined

root@dockerserver:~# /etc/snmp/pi-hole
0
48342
2
0.004137
11953
41139
6993
68.57
0.58
2.67
0.13
/etc/snmp/pi-hole: line 101: DHCP_ACTIVE: unbound variable
root@dockerserver:~#

my example: i run pi-hole in a docker container so the docker-host connects to the container ip itself to get stats,
so it doesnt know anything about the config file or how to read it,
only way around this is to set DHCP_ACTIVE='false' inside the pi-hole script itself

Originally posted by @si458 in #351 (comment)

PR will be generated to add a test for existence of DHCP_ACTIVE environment variable