On Mon, 24 Mar 2014 18:04:19 +0000 Mischa Diehm mischa.diehm@unibas.ch wrote:
I have a problem with /usr/lib/nav/powersupplywatch.py:
I get the following error runninng this script as user navcron:
[snip]
pynetsnmp.netsnmp.SnmpError: snmp_open
NAV can actually poll the device with snmp. When I delete the device, the next device in the list will fail. It's always device No. 1020 (see below)
root@urz-nav-pet:~# sudo -u navcron /usr/lib/nav/powersupplywatch.py -v -d 2>&1| grep Alloc | wc -l 1020
any ideas?
I have an inkling, yes. This is one of the reasons I asked the original author to implement it as an ipdevpoll plugin, not as a separate program; which he did anyway.
I would venture to guess the powersupplywatch program never closes its SNMP sockets when it's finished with them, meaning it is leaking file handles all over the place. A process will typically be limited to 1024 simultaneous file handles (and this internal limit is even hardcoded into NET-SNMP, so increasing the number of handles a process is allowed would not help in this case).
If you would file a bug report at [1], I will see if the code can't be fixed.
[1] https://bugs.launchpad.net/nav/+filebug