{"id":16564594,"url":"https://github.com/techspence/xymontoslack","last_synced_at":"2026-05-06T01:35:03.634Z","repository":{"id":134886086,"uuid":"278085528","full_name":"techspence/xymontoslack","owner":"techspence","description":"Send Xymon alerts to Slack","archived":false,"fork":false,"pushed_at":"2020-07-08T14:53:02.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T21:23:56.118Z","etag":null,"topics":["bash","slack","slackbot","xymon"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/techspence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-08T12:38:58.000Z","updated_at":"2023-02-28T20:59:17.000Z","dependencies_parsed_at":"2023-04-18T14:00:17.421Z","dependency_job_id":null,"html_url":"https://github.com/techspence/xymontoslack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspence%2Fxymontoslack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspence%2Fxymontoslack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspence%2Fxymontoslack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspence%2Fxymontoslack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techspence","download_url":"https://codeload.github.com/techspence/xymontoslack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241991509,"owners_count":20054136,"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":["bash","slack","slackbot","xymon"],"created_at":"2024-10-11T20:44:33.668Z","updated_at":"2025-10-28T14:12:56.108Z","avatar_url":"https://github.com/techspence.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xymon to Slack\nThis script sends Xymon alerts to a specified slack channel using the Slack API \u0026 Bots feature. The alert contains a short message about which service is down, for how long, the full xymon message and a tag for a specific alert group (described below).\n\n# Details\nThis script takes 1 parameter (channel name, $channel) and sends Xymon alerts/notifications to the specified slack channel. The reason I went with a Bot over Incoming Webhooks was because I plan to add more functionality to the xymon alerts, such as querying the bot for more information about the alert or acknowledging the alerts.\n\n# Prerequisites\n- Slack Workspace\n- Slack App with the Bots feature \u0026 functionality enabled\n- Bot User OAuth Access Token\n- curl\n\n# Slack Configuration\n**Slack App Information \u0026 Bot Access Token**\n- The Xymon Bot Access Token can be found by logging into your slack workspace and navigating to:\n\t- https://api.slack.com/\n- Then click Your Apps in the top right corner\n- Click the appropriate app for your Workspace\n- From here you will find information relevant to your app\n- To view the Bot Access Token, click on OAuth \u0026 Permissions under the Features section\n\t- _Note: The BOT Use OAuth Access Token is a considered a secret key and should not be placed in public code repositories or client-side code like JavaScript._\n\n**Security \u0026 Scope**\n- Make sure your app has the following permissions in **Scopes**:\n\t- chat:write\n\t- chat:write:customize\n\t- users:write\n- For additional security I recommend configuring the **Restrict API Token Usage** to your WAN IP\n\n# Slack Emojis\nIn this script I use several emojis not native to slack. I made my own emojis for my use cases. Feel free to make your own \u0026 be creative! To add custom emojis in slack go to your Slack Workspace and go to **Settings \u0026 administration** \u003e **Customize [workspace name]** \u003e **Add Custom Emoji**\n\n# Sample Xymon Alerts Config\n$: /etc/xymon/alerts.cfg\n```\n## Example alert for testing/debugging\nHOST=%.* COLOR=red SERVICE=conn,cpu,disk,http,mem,memory,pagefile,procs,smtp,svcs,ssh,snapshots\n        SCRIPT /home/user/xymontoslack.sh alerts REPEAT=2 RECOVERED\n\n## Example \"production\" alert\nHOST=%.* COLOR=red SERVICE=conn,cpu,disk,http,mem,memory,pagefile,procs,smtp,svcs,ssh,snapshots\n        SCRIPT /home/user/xymontoslack.sh alerts\n```\n\n# Example Slack Alert\n![image](https://user-images.githubusercontent.com/7014376/86933883-0d495e80-c109-11ea-9921-c6208266d986.png)\n\n\n# Disabling Xymon Alerts\n**Why would you want to disable alerts?**\nWell, maybe you are running windows updates, and you don’t want the alert spam to bother those who are subscribed to xymon alerts.\n\n**To disable alerts**\n\n1.\tLaunch a web browser and navigate to Xymon\n2.\tGo to Administration -\u003e Enable/disable\n3.\tOn the right side under Select what to disable, under the Hosts column, select the hosts you want to disable alerts for\n\t- Note: you can select all by using Ctrl + a\n4.\tThen on the Tests column, select the specific alert type or select ALL\n5.\tThen check the radio box next to Disable for ---\n6.\tEnter how long you want to disable alerts for\n\t- You can pick minutes, hours, days or weeks from the dropdown\n7.\tYou can then use the default Disable now or you can schedule the disabling of alerts\n8.\tThen click Apply\n\n**To enable alerts**\n1.\tLaunch a web browser and navigate to Xymon\n2.\tGo to Administration -\u003e Enable/disable\n3.\tYou will see all the hosts you have disabled alerts for on the left-hand side\n4.\tUnder All hosts select all the hosts\n5.\tclick All\n6.\tClick Enable\n\n\n# Resources\n- http://xymon.sourceforge.net/xymon/help/xymon-alerts.html\n- https://tryshift.com/blog/apps-hub/slack-text-formats-bold-quote-more/\n- https://api.slack.com/methods/chat.postMessage/test\n- https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages\n- https://www.linuxquestions.org/questions/programming-9/bash-simple-math-division-question-632776/\n- https://stackoverflow.com/questions/42068/how-do-i-handle-newlines-in-json\n- https://stackoverflow.com/questions/11931857/urlencode-with-curl-in-bash-with-newlines\n- https://stackoverflow.com/questions/17029902/using-curl-post-with-variables-defined-in-bash-script-functions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechspence%2Fxymontoslack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechspence%2Fxymontoslack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechspence%2Fxymontoslack/lists"}