mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 03:34:22 +00:00
feat: rework notifications
This commit is contained in:
@@ -27,8 +27,8 @@ send_notification "$(
|
||||
usage = $5;
|
||||
gsub("%", "", usage);
|
||||
if (usage > max) {
|
||||
printf "<b>🚨 WARNING:</b>\nDisk usage is at %d%%. which exceed the treshold of %d%%.\n\n", usage, max;
|
||||
}
|
||||
printf "<b>💾 Disk Usage Information:</b>\nTotal Size: %s, Used: %s, Available: %s\n\n", $2, $3, $4;
|
||||
printf "<b>Warning:</b>\nDisk usage is at <code>%d%%</code>, which exceeds the threshold of <code>%d%%</code>.\n\n", usage, max;
|
||||
}
|
||||
printf "<b>Disk Usage Information:</b>\nTotal: <code>%s</code>, Used: <code>%s</code>, Available: <code>%s</code>\n", $2, $3, $4;
|
||||
}'
|
||||
)"
|
||||
|
||||
@@ -30,12 +30,12 @@ fi
|
||||
source /usr/local/bin/libs/notifications.sh
|
||||
|
||||
case "$PAM_TYPE" in
|
||||
open_session)
|
||||
PAYLOAD="$PAM_USER logged in (remote host: $PAM_RHOST) at $(date)."
|
||||
;;
|
||||
close_session)
|
||||
PAYLOAD="$PAM_USER logged out (remote host: $PAM_RHOST) at $(date)."
|
||||
;;
|
||||
open_session)
|
||||
PAYLOAD="<b>Login Event</b>\nUser <code>$PAM_USER</code> logged in from <code>$PAM_RHOST</code> at <i>$(date)</i>."
|
||||
;;
|
||||
close_session)
|
||||
PAYLOAD="<b>Logout Event</b>\nUser <code>$PAM_USER</code> logged out from <code>$PAM_RHOST</code> at <i>$(date)</i>."
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$PAYLOAD" ] ; then
|
||||
|
||||
Reference in New Issue
Block a user