nagios-plugins-linux icon indicating copy to clipboard operation
nagios-plugins-linux copied to clipboard

[Feature Request] check_container. Possibility to filter by name and check status or health or uptime

Open melck opened this issue 10 months ago • 0 comments

🚀 Feature Request

Is your feature request related to a problem? Please describe.

Hi, first of all thank you for these plugins, they are really useful.

Currently, the check_container plugin only allows monitoring based on container images (--image) rather than container names. This makes it difficult to track specific containers when multiple containers share the same image but have different configurations or roles. Additionally, there’s no built-in way to check container health status or uptime using this plugin.

Describe the solution you'd like

  1. Container Name Support

    • Add a new option (e.g., -n, --name <NAME>) to filter containers by name. This would allow users to monitor specific containers without relying on the image name. Multiple name options would verify each container
  2. Status Check

    • Implement an option (e.g., --status status_name ) to return the Docker status for one or more containers by name. This would check if a container is in a specific state (as defined by the Docker status).
  3. Health Status Check

    • Implement an option (e.g., --health) to return the Docker health status for one or more containers by name. This would check if a container is in a healthy or unhealthy state (as defined by the Docker healthcheck).
  4. Uptime Check

    • Add an option (e.g., --uptime) to retrieve and validate the uptime of one or more containers by name. Users could specify warning/critical thresholds based on how long a container has been running.

Describe alternatives you've considered

  • Using the --image option to approximate container checks by image, but this doesn’t help distinguish between different containers running the same image nor does it allow health or uptime checks.
  • For docker i'm using github.com/timdaman/check_docker, but it needs a custom install and it is not really maintained

Additional context

melck avatar Feb 18 '25 14:02 melck