Created
July 10, 2024 13:38
-
-
Save tsettle/111db048cbf83624a34ee4da600dd2cc to your computer and use it in GitHub Desktop.
PA/Teams JSON Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THEME[OK]="good" | |
THEME[UP]="good" | |
THEME[DOWN]="attention" | |
THEME[CRITICAL]="attention" | |
THEME[WARNING]="warning" | |
THEME[ACK]="accent" | |
THEME[UNKNOWN]="default" | |
THEME[UNREACHABLE]="warning" | |
COLOR=${COLOR:=${THEME[${NAGIOS_SERVICESTATE}]}} | |
JSON="{ | |
\"type\":\"message\", | |
\"summary\":\"${NAGIOS_NOTIFICATIONTYPE} - ${NAGIOS_HOSTALIAS} / ${NAGIOS_SERVICEDESC}\", | |
\"attachments\":[ | |
{ | |
\"contentType\":\"application/vnd.microsoft.card.adaptive\", | |
\"contentUrl\":null, | |
\"content\":{ | |
\"\$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\", | |
\"type\":\"AdaptiveCard\", | |
\"msteams\": { \"width\": \"full\" }, | |
\"body\":[ | |
{ | |
\"type\":\"TextBlock\", | |
\"size\":\"large\", | |
\"weight\":\"bolder\", | |
\"text\":\"${NAGIOS_NOTIFICATIONTYPE} - ${NAGIOS_HOSTALIAS} / ${NAGIOS_SERVICEDESC}\", | |
\"color\":\"${COLOR}\" | |
}, | |
{ | |
\"type\":\"FactSet\", | |
\"facts\":[ | |
{ | |
\"title\":\"${NAGIOS_SERVICESTATE}:\", | |
\"value\":\"${NAGIOS_SERVICEOUTPUT}\" | |
}, | |
{ | |
\"title\":\"Host Address:\", | |
\"value\":\"${NAGIOS_HOSTADDRESS}\" | |
} | |
] | |
} | |
], | |
\"actions\":[ | |
{ | |
\"type\":\"Action.OpenUrl\", | |
\"title\":\"View in Nagios\", | |
\"url\":\"${NAGIOS_SERVICEINFOURL}\" | |
}, | |
{ | |
\"type\":\"Action.OpenUrl\", | |
\"title\":\"Host WebUI\", | |
\"url\":\"${NAGIOS_URL}/http/${NAGIOS_HOSTADDRESS}\" | |
}, | |
{ | |
\"type\":\"Action.OpenUrl\", | |
\"title\":\"Host SSH\", | |
\"url\":\"${NAGIOS_URL}/ssh/${NAGIOS_HOSTADDRESS}\" | |
} | |
] | |
} | |
} | |
] | |
}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment