Skip to content

A simple nagios/icinga2 plugin for checking docker containter state

License

Notifications You must be signed in to change notification settings

BlackZork/check_docker_container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check_docker_container

A simple nagios/icinga2 plugin for checking docker containter state.

Parses docker ps output for performance.

Issues CRITICAL if a container is not Up, WARINING if container is paused.

Icinga2 Mini-HOWTO

  1. Define check command:

command_docker_container.conf:

object CheckCommand "docker_container" {
  import "plugin-check-command"
  command = [ PluginDir + "/check_docker_container" ]

  arguments = {
    "--name" = {
      value = "$docker_container_name$"
      description = "Name of docker container to monitor"
    }
  }
}
  1. Define service that accepts list of container names:

services.conf:

apply Service for (container_name in host.vars.docker_containers) {
  import "generic-service"
  check_command = "docker_container"

  vars.docker_container_name = container_name
}
  1. Add list of containers that you want to monitor:

host.conf:

object Host "myhost.com" {
  /* Import the default host template defined in `templates.conf`. */
  import "linux-server"

  [...]

  vars.docker_containers = [
    "my-container1",
    "my-container2",
    "my-container3",
    "my-container4"
  ]
}

About

A simple nagios/icinga2 plugin for checking docker containter state

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages