{"id":21470013,"url":"https://github.com/sensu-plugins/sensu-plugins-chef","last_synced_at":"2025-07-15T06:32:47.289Z","repository":{"id":27376018,"uuid":"30851668","full_name":"sensu-plugins/sensu-plugins-chef","owner":"sensu-plugins","description":"This plugin provides native instrumentation for monitoring Chef, including service health checks (via chef-server-ctl) and chef node status, and a Sensu handler for removing stale Sensu clients.","archived":false,"fork":false,"pushed_at":"2021-05-26T19:07:46.000Z","size":119,"stargazers_count":6,"open_issues_count":5,"forks_count":16,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-06T12:55:30.647Z","etag":null,"topics":["chef","monitoring","sensu","sensu-handler","sensu-plugins","sensu-plugins-chef"],"latest_commit_sha":null,"homepage":"http://sensu-plugins.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"zhoubowen-sky/LingDong","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sensu-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-16T02:58:42.000Z","updated_at":"2021-05-19T00:19:33.000Z","dependencies_parsed_at":"2022-08-20T16:10:46.952Z","dependency_job_id":null,"html_url":"https://github.com/sensu-plugins/sensu-plugins-chef","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-chef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-chef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-chef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-chef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensu-plugins","download_url":"https://codeload.github.com/sensu-plugins/sensu-plugins-chef/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226023779,"owners_count":17561532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","monitoring","sensu","sensu-handler","sensu-plugins","sensu-plugins-chef"],"created_at":"2024-11-23T09:20:37.405Z","updated_at":"2024-11-23T09:20:38.042Z","avatar_url":"https://github.com/sensu-plugins.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Sensu Bonsai Asset](https://img.shields.io/badge/Bonsai-Download%20Me-brightgreen.svg?colorB=89C967\u0026logo=sensu)](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-chef)\n[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-chef.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-chef)\n[![Gem Version](https://badge.fury.io/rb/sensu-plugins-chef.svg)](http://badge.fury.io/rb/sensu-plugins-chef)\n[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chef/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chef)\n[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chef/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chef)\n\n## Sensu Plugins Chef Plugin\n\n- [Overview](#overview)\n- [Files](#files)\n- [Usage examples](#usage-examples)\n- [Configuration](#configuration)\n  - [Sensu Go](#sensu-go)\n    - [Asset registration](#asset-registration)\n    - [Asset definition](#asset-definition)\n    - [Check definition](#check-definition)\n  - [Sensu Core](#sensu-core)\n    - [Check definition](#check-definition)\n- [Installation from source](#installation-from-source)\n- [Additional notes](#additional-notes)\n- [Contributing](#contributing)\n\n### Overview\n\nThis plugin provides native instrumentation for monitoring Chef, including service health checks (via chef-server-ctl) and chef node status, and a Sensu handler for removing stale Sensu clients.\n\n### Files\n * bin/check-chef-node.rb\n * bin/check-chef-nodes.rb\n * bin/check-chef-server.rb\n * bin/handler-chef-node.rb\n \n**check-chef-node**\nChecks if a node exists.\n\n**check-chef-nodes**\nReports nodes from your cluster that were last seen before the specified number of seconds.\n\n**check-chef-server**\nUses Chef Server's `chef-server-ctl` to check whether any component of the Chef Server is not running. You must run this plugin with elevated privileges (sudo) or it will fail with unknown state.\n\n**handler-chef-node**\nRemoves a Sensu client if its Chef node data no longer exists.\n\n## Usage examples\n\n### Help\n\n**check-chef-node.rb**\n```\nUsage: check-chef-node.rb (options)\n    -U, --url CHEF-SERVER-URL        URL of Chef server\n    -C, --client CLIENT-NAME         Client name\n    -i, --ignore-ssl                 Ignore SSL certificate verification\n    -K, --keys CLIENT-KEY            Client's key\n    -n, --node-name NODE-NAME        Check if this node name exists\n```\n\n**handler-chef-node.rb**\n```\nUsage: handler-chef-node.rb (options)\n        --map-go-event-into-ruby     Enable Sensu Go to Sensu Ruby event mapping. Alternatively set envvar SENSU_MAP_GO_EVENT_INTO_RUBY=1.\n\n```\n\n## Configuration\n### Sensu Go\n#### Asset registration\n\nAssets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset: \n\n`sensuctl asset add sensu-plugins/sensu-plugins-chef`\n\nIf you're using an earlier version of sensuctl, you can download the asset definition from [this project's Bonsai asset index page](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-chef).\n\n#### Asset definition\n\n```yaml\n---\ntype: Asset\napi_version: core/v2\nmetadata:\n  name: sensu-plugins-chef\nspec:\n  url: https://assets.bonsai.sensu.io/94e44dc0b89b7cd8318c38db5f64f788642140d8/sensu-plugins-chef_7.0.0_centos_linux_amd64.tar.gz\n  sha512: f468ea0060ab890004a3f5bd09deff5bdd98db9e7a4c9ffc0ad1c8809b0e5a8198737f23ec850e9f5181fd590aafa5b895dd948b264244770c77b5f03fa523ef\n```\n\n#### Check definition\n\n```yaml\n---\ntype: CheckConfig\nspec:\n  command: \"check-chef-nodes.rb\"\n  handlers: []\n  high_flap_threshold: 0\n  interval: 10\n  low_flap_threshold: 0\n  publish: true\n  runtime_assets:\n  - sensu-plugins/sensu-plugins-chef\n  - sensu/sensu-ruby-runtime\n  subscriptions:\n  - linux\n```\n\n### Sensu Core\n\n#### Check definition\n```json\n{\n  \"checks\": {\n    \"check-chef-nodes\": {\n      \"command\": \"check-chef-nodes.rb\",\n      \"subscribers\": [\"linux\"],\n      \"interval\": 10,\n      \"refresh\": 10,\n      \"handlers\": [\"influxdb\"]\n    }\n  }\n}\n```\n\n## Installation from source\n\n### Sensu Go\n\nSee the instructions above for [asset registration](#asset-registration).\n\n### Sensu Core\n\nInstall and setup plugins on [Sensu Core](https://docs.sensu.io/sensu-core/latest/installation/installing-plugins/).\n\n## Additional notes\n\n### Sensu Go Ruby Runtime Assets\n\nThe Sensu assets packaged from this repository are built against the Sensu Ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator, or handler), make sure to include the corresponding [Sensu Ruby Runtime Asset](https://bonsai.sensu.io/assets/sensu/sensu-ruby-runtime) in the list of assets needed by the resource.\n\n### Use this plugin with Sensu Go\n\nTo use `handler-chef-node.rb` with Sensu Go, you will need to use the event mapping command line option. See `handler-chef-node.rb --help` for details. Read the [sensu-plugin README](https://github.com/sensu-plugins/sensu-plugin#sensu-go-enablement) for more information about the event mapping functionality.\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/sensu-plugins/sensu-plugins-chef/blob/master/CONTRIBUTING.md) for information about contributing to this plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-chef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-chef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-chef/lists"}