]>
git.immae.eu Git - perso/Immae/Config/Nix.git/blob - flakes/private/monitoring/plugins/notify_by_apprise
82bc5a35ce3077b3e9f8fd2ae674ec0292a2f788
3 APPRISE_USERNAME
="Naemon"
4 APPRISE_USERICON
="https://assets.immae.eu/monitoring.png"
5 APPRISE_URLS
=$(echo "$2" | sed -e "s/{username}/$APPRISE_USERNAME/g" -e "s@{image_url}@$APPRISE_USERICON@g")
7 if [ "$SERVICESTATE" = "CRITICAL" ]; then
9 elif [ "$SERVICESTATE" = "WARNING" ]; then
11 elif [ "$SERVICESTATE" = "OK" ]; then
13 elif [ "$SERVICESTATE" = "UNKNOWN" ]; then
15 elif [ "$HOSTSTATE" = "UP" ]; then
17 elif [ "$HOSTSTATE" = "DOWN" ]; then
19 elif [ "$HOSTSTATE" = "UNKNOWN" ]; then
21 elif [ "$HOSTSTATE" = "UNREACHABLE" ]; then
27 if [ "$1" = "host" ]; then
28 apprise
--title "${ICON} ${NOTIFICATIONTYPE} ${HOST} is ${HOSTSTATE}" --body "$HOSTOUTPUT" $APPRISE_URLS
30 apprise
--title "${ICON} ${NOTIFICATIONTYPE} ${SERVICEDESC} on ${HOST} is ${SERVICESTATE}" --body "$SERVICEOUTPUT" $APPRISE_URLS