Linuxfabrik / monitoring-plugins

220+ check plugins for Icinga and other Nagios-compatible monitoring applications. Each plugin is a standalone command line tool (written in Python) that provides a specific type of check.
https://linuxfabrik.ch
The Unlicense
220 stars 51 forks source link

docker-stats: Improve handling of container names #586

Closed Gninieb closed 2 years ago

Gninieb commented 2 years ago

Is your feature request related to a problem? Please describe. We are using Docker Swarm and so we get something like "traefik_traefik.2.1idw12p2yqpxutlzkcwign4at" as NAME in docker stats. This was composed as follows: "..". The dynamic ID changes every time the container is restarted and is a problem in connection with valid perfdata e.g. regarding whisper entries in metrics.

Describe the solution you'd like A shortening of the name after the replica number would be very helpful! This could be triggerd through a argument like -s for SWARM Mode

Describe alternatives you've considered Alternatively, you could generally shorten the name before the second point and save the optional argument

Additional context

markuslf commented 2 years ago

Sounds reasonable, we'll take a look at it.

Gninieb commented 2 years ago

Hey, thank you for the improvement! But I think you missed the shortening at the perfdata output?

markuslf commented 1 year ago

Handled in https://github.com/Linuxfabrik/monitoring-plugins/issues/600