Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_table() call hangups with docker #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pboguslawski
Copy link

check_snmp_storage.pl executions may hang (checked on Debian 11/12)
while querying host with docker filesystems with many long filesystem
mountpoints like

iso.3.6.1.2.1.25.2.3.1.3.1 = STRING: "Physical memory"
iso.3.6.1.2.1.25.2.3.1.3.3 = STRING: "Virtual memory"
iso.3.6.1.2.1.25.2.3.1.3.6 = STRING: "Memory buffers"
iso.3.6.1.2.1.25.2.3.1.3.7 = STRING: "Cached memory"
iso.3.6.1.2.1.25.2.3.1.3.8 = STRING: "Shared memory"
iso.3.6.1.2.1.25.2.3.1.3.10 = STRING: "Swap space"
iso.3.6.1.2.1.25.2.3.1.3.35 = STRING: "/run"
iso.3.6.1.2.1.25.2.3.1.3.36 = STRING: "/"
iso.3.6.1.2.1.25.2.3.1.3.38 = STRING: "/dev/shm"
iso.3.6.1.2.1.25.2.3.1.3.39 = STRING: "/run/lock"
iso.3.6.1.2.1.25.2.3.1.3.40 = STRING: "/sys/fs/cgroup"
iso.3.6.1.2.1.25.2.3.1.3.59 = STRING: "/test1"
iso.3.6.1.2.1.25.2.3.1.3.60 = STRING: "/test2"
iso.3.6.1.2.1.25.2.3.1.3.61 = STRING: "/test3"
iso.3.6.1.2.1.25.2.3.1.3.64 = STRING: "/var/lib/docker/containers/43b4ba50f14279701a4d13333e00a26375aa114b9100d845044107cbcd5ce4a0/mounts/shm"
iso.3.6.1.2.1.25.2.3.1.3.66 = STRING: "/var/lib/docker/containers/5f62f6600a81d7c8b116a134853d9b445711d3a9e79935ded1831c09cab5d6176/mounts/shm"
iso.3.6.1.2.1.25.2.3.1.3.68 = STRING: "/var/lib/docker/containers/7ddef6926988082e6c5d33bdf8544cf7659f85e760587111c3737f2addc04d60a/mounts/shm"
[...]

It was tested that issue does not occur if get-next-requests is used instead of
get-bulk-requests. This fix forces get-next-requests to be used in problematic call.

Plugin code was tided also in 3f31d36.

Related: https://metacpan.org/pod/Net::SNMP#get_table()-retrieve-a-table-from-the-remote-agent
Author-Change-Id: IB#1089430

check_snmp_storage.pl executions may hang (checked on Debian 11/12)
while querying host with docker filesystems with many long filesystem
mountpoints like

```
iso.3.6.1.2.1.25.2.3.1.3.1 = STRING: "Physical memory"
iso.3.6.1.2.1.25.2.3.1.3.3 = STRING: "Virtual memory"
iso.3.6.1.2.1.25.2.3.1.3.6 = STRING: "Memory buffers"
iso.3.6.1.2.1.25.2.3.1.3.7 = STRING: "Cached memory"
iso.3.6.1.2.1.25.2.3.1.3.8 = STRING: "Shared memory"
iso.3.6.1.2.1.25.2.3.1.3.10 = STRING: "Swap space"
iso.3.6.1.2.1.25.2.3.1.3.35 = STRING: "/run"
iso.3.6.1.2.1.25.2.3.1.3.36 = STRING: "/"
iso.3.6.1.2.1.25.2.3.1.3.38 = STRING: "/dev/shm"
iso.3.6.1.2.1.25.2.3.1.3.39 = STRING: "/run/lock"
iso.3.6.1.2.1.25.2.3.1.3.40 = STRING: "/sys/fs/cgroup"
iso.3.6.1.2.1.25.2.3.1.3.59 = STRING: "/test1"
iso.3.6.1.2.1.25.2.3.1.3.60 = STRING: "/test2"
iso.3.6.1.2.1.25.2.3.1.3.61 = STRING: "/test3"
iso.3.6.1.2.1.25.2.3.1.3.64 = STRING: "/var/lib/docker/containers/43b4ba50f14279701a4d13333e00a26375aa114b9100d845044107cbcd5ce4a0/mounts/shm"
iso.3.6.1.2.1.25.2.3.1.3.66 = STRING: "/var/lib/docker/containers/5f62f6600a81d7c8b116a134853d9b445711d3a9e79935ded1831c09cab5d6176/mounts/shm"
iso.3.6.1.2.1.25.2.3.1.3.68 = STRING: "/var/lib/docker/containers/7ddef6926988082e6c5d33bdf8544cf7659f85e760587111c3737f2addc04d60a/mounts/shm"
[...]
```
It was tested that issue does not occur if `get-next-requests` is used instead of
`get-bulk-requests`. This fix forces `get-next-requests` to be used in problematic call.

Related: https://metacpan.org/pod/Net::SNMP#get_table()-retrieve-a-table-from-the-remote-agent
Author-Change-Id: IB#1089430
check_snmp_storage.pl plugin code tided.

Fixes: 35e9ec4
Related: https://github.com/SteScho/manubulon-snmp?tab=readme-ov-file#contributing
Author-Change-Id: IB#1089430
Fixes: 35e9ec4
Author-Change-Id: IB#1089430
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant