Wrong handler in sensu plugin file

Solution In Progress - Updated -

Issue

  • There is one custom plugin in Sensu, check-docker-health, that has a different handler configured than the rest of the Sensu alarms.

  • This is the default file (see that it has no handler defined):

[root@overcloud-compute-0 checks]# cat check-docker-health.json 
{
    "checks": {
        "check-docker-health": {
            "command": "output=''\nfor i in $(docker ps --format '{{.ID}}'); do\n  if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then\n    if [ \"$result\" != 'healthy' ]; then\n      output=\"${output} ; $(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{(index .State.Health.Log 0).Output}}' $i)\";\n    fi\n  fi\ndone\nif [ ! -z \"${output}\" ]; then\n  echo ${output:3} && exit 2;\nfi\n",
            "handlers": [

            ],
            "interval": 10,
            "occurrences": 3,
            "refresh": 90,
            "standalone": true
        }
    }
}
  • This is how it should look like:
[root@overcloud-compute-1 checks]# cat check-docker-health.json 
{
    "checks": {
        "check-docker-health": {
            "command": "output=''\nfor i in $(docker ps --format '{{.ID}}'); do\n  if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then\n    if [ \"$result\" != 'healthy' ]; then\n      output=\"${output} ; $(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{(index .State.Health.Log 0).Output}}' $i)\";\n    fi\n  fi\ndone\nif [ ! -z \"${output}\" ]; then\n  echo ${output:3} && exit 2;\nfi\n",
            "handlers": [
                "default"
            ],
            "interval": 10,
            "occurrences": 3,
            "refresh": 90,
            "standalone": true
        }
    }
}

Environment

  • Red Hat OpenStack Platform 13.0 (RHOSP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content