14. 02. 2017 Juergen Vigna NetEye

Come inviare notifiche attraverso Telegram o Microsoft Team

Tradizionalmente in un ambiente di monitoraggio le notifiche in caso di eventuali problemi con l’IT vengono inviate via E-Mail o SMS. Ma sono sufficienti questi due canali per raggiungere nel momento giusto la persona esatta?

Ovviamente abbiamo svariate altre possibilità tra le quali ad esempio:

  • Notifiche attraverso l’App di Telegram App (CLI)
  • Notifiche attraverso Office 365 Web API (Microsoft Teams)

Telegram

Come forse già sapete Telegram, l’applicazione simile a WhatsApp, consente di inviare messaggi a contatti, gruppi e anche canali. Al contrario di WhatsApp, Telegram è installabile anche attraverso command line interface (CLI) con il quale è possibile programmare l’invio di messaggi attraverso un computer. Quindi basta installare Telegram sul server di monitoraggio e definire il comando per le notifiche nel seguente modo:

Host Notification: telegram-cli -W -e "msg $CONTACTEMAI$ Host '$HOSTNAME$' is $HOSTSTATE$ - Info: $HOSTOUTPUT$ - Time: $SHORTDATETIME$"

Service Notification: telegram-cli -W -e "msg $CONTACTEMAIL$ NetEye - $NOTIFICATIONTYPE$ - $SERVICEDESC$ - $HOSTNAME$ - $HOSTADDRESS$ - $SERVICESTATE$ - $SHORTDATETIME$ - $SERVICEOUTPUT$"

Ovviamente prima di completare la procedura è necessario registrare il monitoring host come Telegram sender (proprio come avviene sugli smartphone), utilizzando lo stesso numero di telefono che utilizzate anche per gli SMS.

NetEye Telegram Notifications

Office 365

Con Office 365 avrete la possibilità di registrate gruppi per smistare le varie notifiche. Avrete inoltre bisogno esattamente di questa GUID e poi potrete inviare i messaggi attraverso il seguente comando:

Host Notification: curl -H "Content-Type: application/json" -d "{\"title\": \"** $NOTIFICATIONTYPE$ alert - $HOSTNAME$ is $HOSTSTATE$ **\", \"text\": \"***** NetEye *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\", \"themeColor\": \"EA4300\"}" https://outlook.office365.com/webhook/YOURGUIDHERE

Service Notification: curl -H "Content-Type: application/json" -d "{\"title\": \" ** $NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **\", \"text\": \"***** NetEye *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\n[HealthPortalURL]($SERVICENOTESURL$)\nHost: $HOSTNAME$ ($HOSTALIAS$)\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\", \"themeColor\": \"EA4300\"}" https://outlook.office365.com/webhook/YOURGUIDHERE

Office365

Spero che queste due idee vi possano essere d’aiuto per estendere ulteriormente la vostra struttura di notifica.

Juergen Vigna

Juergen Vigna

NetEye Solution Architect at Würth Phoenix
I have over 20 years of experience in the IT branch. After first experiences in the field of software development for public transport companies, I finally decided to join the young and growing team of Würth Phoenix. Initially, I was responsible for the internal Linux/Unix infrastructure and the management of CVS software. Afterwards, my main challenge was to establish the meanwhile well-known IT System Management Solution WÜRTHPHOENIX NetEye. As a Product Manager I started building NetEye from scratch, analyzing existing open source models, extending and finally joining them into one single powerful solution. After that, my job turned into a passion: Constant developments, customer installations and support became a matter of personal. Today I use my knowledge as a NetEye Senior Consultant as well as NetEye Solution Architect at Würth Phoenix.

Author

Juergen Vigna

I have over 20 years of experience in the IT branch. After first experiences in the field of software development for public transport companies, I finally decided to join the young and growing team of Würth Phoenix. Initially, I was responsible for the internal Linux/Unix infrastructure and the management of CVS software. Afterwards, my main challenge was to establish the meanwhile well-known IT System Management Solution WÜRTHPHOENIX NetEye. As a Product Manager I started building NetEye from scratch, analyzing existing open source models, extending and finally joining them into one single powerful solution. After that, my job turned into a passion: Constant developments, customer installations and support became a matter of personal. Today I use my knowledge as a NetEye Senior Consultant as well as NetEye Solution Architect at Würth Phoenix.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive