librenms / librenms-agent

LibreNMS Agent & Scripts
GNU General Public License v2.0
118 stars 188 forks source link

dhcp.py doesn't respect leasefile when running dhcpd-pools #367

Open BlueSpaceCanary opened 3 years ago

BlueSpaceCanary commented 3 years ago

Filing a bug I ran into while figuring out what was going on here.

dhcp.py doesn't use the leasefile value from dhcp.json when constructing its dhcpd-pools shell command:

shell_cmd = "dhcpd-pools -s i -A"
pool_data = (
    subprocess.Popen(shell_cmd, shell=True, stdout=subprocess.PIPE)
    .stdout.read()
    .split(b"\n")
)

There's arguably a second bug here in how the snmp response was parsed since librenms logged the wrong error, but I don't know php so I didn't dig into that at all.

oliverl-21 commented 1 year ago

looks like SElinux is the problem for this.