User Tools

Site Tools


сервис_adnanh_webhook

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_adnanh_webhook [2026/05/07 14:21]
val
сервис_adnanh_webhook [2026/11/05 14:24] (current)
val
Line 3: Line 3:
   * [[https://​github.com/​adnanh/​webhook]]   * [[https://​github.com/​adnanh/​webhook]]
  
 +  * [[Сервис Prometheus#​prometheus-alertmanager]]
 +  * [[Средства программирования shell#​Отправка сообщения на все консоли]]
 <​code>​ <​code>​
 +root@server:​~#​ apt install webhook
 +
 root@server:​~#​ cat /​etc/​webhook.conf root@server:​~#​ cat /​etc/​webhook.conf
 +</​code><​code>​
 [ [
   {   {
     "​id":​ "​my-alert-script",​     "​id":​ "​my-alert-script",​
     "​execute-command":​ "/​usr/​local/​bin/​mywall.sh",​     "​execute-command":​ "/​usr/​local/​bin/​mywall.sh",​
 +#    "​execute-command":​ "/​usr/​local/​bin/​mywall_through_llm.sh",​
 +#    "​execute-command":​ "/​usr/​local/​bin/​my-prometheus-xmpp-alerts.sh",​
     "​command-working-directory":​ "/​tmp",​     "​command-working-directory":​ "/​tmp",​
     "​pass-arguments-to-command":​ [     "​pass-arguments-to-command":​ [
Line 18: Line 25:
   }   }
 ] ]
 +</​code><​code>​
 +root@server:​~#​ service webhook restart
  
 +root@server:​~#​ ###webhook -hooks /​etc/​webhook.conf -verbose -port 9000
  
-root@server:~# webhook ​-hooks /etc/webhook.conf ​-verbose ​-port 9000 +$ curl -X POST -H "​Content-Type: application/​json"​ \ 
 +     -d '​{"​alerts":​ "​{\"​status\":​ \"​firing\",​ \"​message\":​ \"​тестовое сообщение\"​}"​}'​ \ 
 +     http://localhost:​9000/​hooks/​my-alert-script
 </​code>​ </​code>​
сервис_adnanh_webhook.1778152898.txt.gz · Last modified: 2026/05/07 14:21 by val