docker-icinga2 icon indicating copy to clipboard operation
docker-icinga2 copied to clipboard

Missing package snmp (prerequistite for the built-in check_snmp)

Open dominik-r-s opened this issue 1 year ago • 2 comments

The built-in command check_snmp does not work because the binary snmpget is not installed.

icinga@icinga-icinga2-0:/$ /usr/lib/nagios/plugins/check_snmp -v -C xxx -H yyy ... -v
/usr/bin/snmpget -Le -t 60 -r 5 -m ...
External command error with no output (return code: 3)
icinga@icinga-icinga2-0:/$ /usr/bin/snmpget
bash: /usr/bin/snmpget: No such file or directory
icinga@icinga-icinga2-0:/$

dominik-r-s avatar Apr 25 '24 14:04 dominik-r-s

@dominik-r-s I've just switched over my Icinga SNMP image to build Icinga using Nix. Nix manages the dependency on snmpget for check_snmp correctly.

jwillikers avatar Oct 19 '24 22:10 jwillikers

Thanks for creating this issue and please excuse the silence afterwards.

Using the 2.14 image I was unable to reproduce this, as snmpget - being part of the snmp package - seems to be available since faecd36aa647f294a6a35114ee663889ba520ae7.

$ docker run --pull=always -t -it --rm icinga/icinga2:2.14 bash
2.14: Pulling from icinga/icinga2
Digest: sha256:e77fd729998967da739b7d74d621cb7683fff6fbbe1e4be89b64686dc67125c9
Status: Image is up to date for icinga/icinga2:2.14
[snip]

icinga@0297dd5dd7c5:/$ which snmpget
/usr/bin/snmpget
icinga@0297dd5dd7c5:/$ /usr/lib/nagios/plugins/check_snmp -H 172.17.0.2 -o .1.3.6.1.2.1.1.1.0
SNMP OK - "Linux d2c6e71cc3f1 6.11.3 #1-NixOS SMP PREEMPT_DYNAMIC Thu Oct 10 10:04:18 UTC 2024 x86_64" |

@dominik-r-s: Which version of the Docker image are you using? Could you please verify if this error is still present after updating the local image?

@jwillikers: On first glance, I really like your solution and I hope I can take a closer look in the future :)

oxzi avatar Oct 21 '24 08:10 oxzi