{"id":21470029,"url":"https://github.com/sensu-plugins/sensu-plugins-slack","last_synced_at":"2025-04-07T10:28:46.098Z","repository":{"id":27389283,"uuid":"30865430","full_name":"sensu-plugins/sensu-plugins-slack","owner":"sensu-plugins","description":"Sensu Slack chat handlers","archived":false,"fork":false,"pushed_at":"2021-04-29T15:04:53.000Z","size":121,"stargazers_count":30,"open_issues_count":20,"forks_count":54,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-09-20T07:17:38.720Z","etag":null,"topics":["alerting","handler","notification","ruby","sensu-plugins","slack"],"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":null,"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-16T11:30:18.000Z","updated_at":"2024-01-30T17:25:42.000Z","dependencies_parsed_at":"2022-08-20T07:30:26.461Z","dependency_job_id":null,"html_url":"https://github.com/sensu-plugins/sensu-plugins-slack","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensu-plugins%2Fsensu-plugins-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensu-plugins","download_url":"https://codeload.github.com/sensu-plugins/sensu-plugins-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247635039,"owners_count":20970653,"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":["alerting","handler","notification","ruby","sensu-plugins","slack"],"created_at":"2024-11-23T09:21:18.349Z","updated_at":"2025-04-07T10:28:46.043Z","avatar_url":"https://github.com/sensu-plugins.png","language":"Ruby","readme":"## Sensu-Plugins-slack\n\n[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-slack.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-slack)\n[![Gem Version](https://badge.fury.io/rb/sensu-plugins-slack.svg)](https://badge.fury.io/rb/sensu-plugins-slack)\n[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)\n[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)\n[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-slack.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-slack)\n[![Community Slack](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/badge)\n\n\n## Functionality\n\n## Files\n * bin/handler-slack.rb\n * bin/handler-slack-multichannel.rb\n\n## Usage for handler-slack.rb\n```\n{\n  \"slack\": {\n    \"webhook_url\": \"webhook url\",\n    \"dashboard\": \"uchiwa url, add link to slack notification. Format: http://sensu.com/#/client/$DataCenter/, optional\",\n    \"channel\": \"#notifications-room, optional defaults to slack defined\",\n    \"message_prefix\": \"optional prefix - can be used for mentions\",\n    \"surround\": \"optional - can be used for bold(*), italics(_), code(`) and preformatted(```)\",\n    \"bot_name\": \"optional bot name, defaults to slack defined\",\n    \"link_names\": \"optional - find and link channel names and usernames\",\n    \"message_template\": \"optional description erb template file - /some/path/to/template.erb\",\n    \"payload_template\": \"optional json payload template file (note: overrides most other template options.)\",\n    \"template\": \"backwards-compatible alias for message_template\",\n    \"proxy_address\": \"The HTTP proxy address (example: proxy.example.com)\",\n    \"proxy_port\": \"The HTTP proxy port (if there is a proxy)\",\n    \"proxy_username\": \"The HTTP proxy username (if there is a proxy)\",\n    \"proxy_password\": \"The HTTP proxy user password (if there is a proxy)\",\n    \"icon_url\": \"https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png\",\n    \"icon_emoji\": \":snowman:\",\n    \"fields\": [\n      \"list\",\n      \"of\",\n      \"optional\",\n      \"clientkeys\",\n      \"to_render\"\n    ]\n  }\n}\n```\n## Usage for handler-slack-multichannel.rb\n```\n{\n  \"slack\": {\n    \"webhook_urls\": {\n      \"no-team-alerts\": \"https://hooks.slack.com/services/AAAAAAA\",\n      \"all-alerts\": \"https://hooks.slack.com/services/BBBBBB\"\n    },\n    \"channels\": {\n      \"default\": [ \"no-team-alerts\" ],\n      \"compulsory\": [ \"all-alerts\" ]\n    }\n    \"message_prefix\": \"optional prefix - can be used for mentions\",\n    \"surround\": \"optional - can be used for bold(*), italics(_), code(`) and preformatted(```)\",\n    \"bot_name\": \"optional bot name, defaults to slack defined\",\n    \"link_names\": \"optional - find and link channel names and usernames\",\n    \"message_template\": \"optional description erb template file - /some/path/to/template.erb\",\n    \"payload_template\": \"optional json payload template file (note: overrides most other template options.)\",\n    \"template\": \"backwards-compatible alias for message_template\",\n    \"proxy_address\": \"The HTTP proxy address (example: proxy.example.com)\",\n    \"proxy_port\": \"The HTTP proxy port (if there is a proxy)\",\n    \"proxy_username\": \"The HTTP proxy username (if there is a proxy)\",\n    \"proxy_password\": \"The HTTP proxy user password (if there is a proxy)\",\n    \"icon_url\": \"https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png\",\n    \"icon_emoji\": \":snowman:\",\n    \"custom_field\": [\n      \"list\",\n      \"of\",\n      \"optional\",\n      \"check_fields\",\n      \"to_render\"\n    ]\n  }\n}\n```\n\n\n## Installation\n\n[Installation and Setup](https://sensu-plugins.io/docs/installation_instructions.html)\n\n## Notes\n\n### payload_template example\n\n```\n{\n  \"username\": \"sensu alarms\",\n  \"icon_emoji\": \":bell:\",\n  \"channel\": channel,\n  \"attachments\": [\n    {\n      \"fallback\": \"\u003c%= @event[\"check\"][\"output\"].gsub('\"', '\\\\\"') %\u003e\",\n      \"color\": \"\u003c%= color %\u003e\",\n      \"title\": \"\u003c%= @event[\"check\"][\"name\"] %\u003e (\u003c%= @event[\"client\"][\"name\"] %\u003e)\",\n      \"text\": \"\u003c%= @event[\"check\"][\"output\"].gsub('\"', '\\\\\"') %\u003e\"\n    }\n  ]\n}\n```\n\nYou can also use `to_json`\n\n```\n\u003c%=\n  {\n    :text =\u003e \"Some text\"\n  }.to_json\n-%\u003e\n```\n\nSee https://api.slack.com/incoming-webhooks and https://api.slack.com/docs/attachments\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensu-plugins%2Fsensu-plugins-slack/lists"}