Monitoring Chef Automate

[edit on GitHub]

Use the authenticated https endpoint /status to monitor your Chef Automate installation.

Checking the Status Endpoint

The authenticated endpoint /status provides status for the overall Chef Automate installation as well as for its component services. When all Chef Automate component services are up, /status returns a response code of 200. Otherwise, /status returns 500.

The status of a service can be OK, UNKNOWN, or CRITICAL, and is reflected in the JSON output:

    {
      "ok": false,
      "service_status": [
       {
       "service": "deployment-service",
       "status": "OK"
     },  
     {
       "service": "config-mgmt-service",
       "status": "UNKNOWN"
     },
     {
       "service": "ingest-service",
       "status": "CRITICAL"
     },
      ]
    }

To use /status, set up an authentication token for use with your monitoring system by following the steps below:

  1. Generate a token:

    chef-automate iam token create --id <token-id> <token-name>
    
  2. Create a policy that allows your created token to access the /status endpoint.

    curl -k -H "api-token: <admin-token>" -d '{ "name": "Monitoring", "id": "monitoring", "members": [ "token:<token-id>" ], "statements": [ { "effect": "ALLOW", "actions": [ "system:status:get" ], "projects": [ "*" ] } ] }' -X POST https://automate.example.com/apis/iam/v2/policies?pretty
    
  3. Test that your token and policy give you access to the /status endpoint by running the following command:

    curl -k -H "api-token: <token-id>" https://automate.example.com/api/v0/status?pretty
    

    The output appears in the following JSON format:

        {
          "ok": true,
          "services": [
            {
              "name": "deployment-service",
              "status": "OK"
            },
            {
              "name": "backup-gateway",
              "status": "OK"
            },
            {
              "name": "automate-postgresql",
              "status": "OK"
            },
          ]
        }
    
  4. After establishing your authentication token and confirming access, connect to the /status endpoint.

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/automate/monitoring/