Daniel Gibbs
4 years ago
No known key found for this signature in database
GPG Key ID: 2EBB36015C6D78E2
6 changed files with
22 additions and
15 deletions
-
lgsm/functions/alert_gotify.sh
-
lgsm/functions/alert_ifttt.sh
-
lgsm/functions/alert_pushbullet.sh
-
lgsm/functions/alert_pushover.sh
-
lgsm/functions/alert_slack.sh
-
lgsm/functions/alert_telegram.sh
|
|
@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" |
|
|
|
json=$(cat <<EOF |
|
|
|
{ |
|
|
|
"title": "${alertemoji} ${alerttitle} ${alertemoji}", |
|
|
|
"message": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nCurrent Players\n${alertplayers}\n\nMap\n${alertmap}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nVersion\n${alertversion}\n\nMore info\n${alertmoreinfourl}", |
|
|
|
"message": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nMap\n${alertmap}\n\nCurrent Players\n${alertplayers}\n\nVersion\n${alertversion}\n\nCountry\n${country}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alertmoreinfourl}", |
|
|
|
"priority": 5 |
|
|
|
} |
|
|
|
EOF |
|
|
|
|
|
@ -11,7 +11,7 @@ json=$(cat <<EOF |
|
|
|
{ |
|
|
|
"value1": "${selfname}", |
|
|
|
"value2": "${alertemoji} ${alerttitle} ${alertemoji}", |
|
|
|
"value3": "<b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Map</b><br>${alertmap}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Version</b><br>${alertversion}<br><br><b>More Info</b><br>${alertmoreinfourl}" |
|
|
|
"value3": "<b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Map</b><br>${alertmap}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Version</b><br>${alertversion}<br><br><b>Country</b><br>${country}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More Info</b><br>${alertmoreinfourl}" |
|
|
|
} |
|
|
|
EOF |
|
|
|
) |
|
|
|
|
|
@ -12,7 +12,7 @@ json=$(cat <<EOF |
|
|
|
"channel_tag": "${channeltag}", |
|
|
|
"type": "note", |
|
|
|
"title": "${alertemoji} ${alerttitle} ${alertemoji}", |
|
|
|
"body": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nCurrent Players\n${alertplayers}\n\nMap\n${alertmap}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nVersion\n${alertversion}\n\nMore Info\n${alertmoreinfourl}" |
|
|
|
"body": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nMap\n${alertmap}\n\nCurrent Players\n${alertplayers}\n\nVersion\n${alertversion}\n\nCountry\n${country}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore Info\n${alertmoreinfourl}" |
|
|
|
} |
|
|
|
EOF |
|
|
|
) |
|
|
|
|
|
@ -22,7 +22,7 @@ else |
|
|
|
alertpriority="0" |
|
|
|
fi |
|
|
|
|
|
|
|
pushoversend=$(curl --connect-timeout 10 -sSL -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alerttitle} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Map</b><br>${alertmap}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Version</b><br>${alertversion}<br><br><b>More Info</b><br>${alertmoreinfourl}" "https://api.pushover.net/1/messages.json" | grep errors) |
|
|
|
pushoversend=$(curl --connect-timeout 10 -sSL -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alerttitle} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Map</b><br>${alertmap}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Version</b><br>${alertversion}<br><br><b>Country</b><br>${country}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More Info</b><br>${alertmoreinfourl}" "https://api.pushover.net/1/messages.json" | grep errors) |
|
|
|
|
|
|
|
if [ -n "${pushoversend}" ]; then |
|
|
|
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" |
|
|
|
|
|
@ -58,12 +58,19 @@ json=$(cat <<EOF |
|
|
|
"alt_text": "${alertimagealt}" |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "section", |
|
|
|
"text": { |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Game*\n${gamename}" |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "section", |
|
|
|
"fields": [ |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Game*" |
|
|
|
"text": "*Map*" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
@ -71,7 +78,7 @@ json=$(cat <<EOF |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "${gamename}" |
|
|
|
"text": "${alertmap}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
@ -84,19 +91,19 @@ json=$(cat <<EOF |
|
|
|
"fields": [ |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Map*" |
|
|
|
"text": "*Version*" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Server IP*" |
|
|
|
"text": "*Country*" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "${alertmap}" |
|
|
|
"text": "${alertversion}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "${alertip}:${port}" |
|
|
|
"text": "${country}" |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
@ -105,19 +112,19 @@ json=$(cat <<EOF |
|
|
|
"fields": [ |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Hostname*" |
|
|
|
"text": "*Server IP*" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*Version*" |
|
|
|
"text": "*Hostname*" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "${HOSTNAME}" |
|
|
|
"text": "${alertip}:${port}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "${alertversion}" |
|
|
|
"text": "${HOSTNAME}" |
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
@ -11,7 +11,7 @@ json=$(cat <<EOF |
|
|
|
{ |
|
|
|
"chat_id": "${telegramchatid}", |
|
|
|
"parse_mode": "HTML", |
|
|
|
"text": "<b>${alertemoji} ${alerttitle} ${alertemoji}</b>\n\n<b>Server name</b>\n${servername}\n\n<b>Trigger Message</b>\n${alerttriggermessage}\n\n<b>Game</b>\n${gamename}\n\n<b>Current Players</b>\n${alertplayers}\n\n<b>Map</b>\n${alertmap}\n\n<b>Server IP</b>\n${alertip}:${port}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>Version</b>\n${alertversion}\n\n<b>More info</b>\n${alertmoreinfourl}", |
|
|
|
"text": "<b>${alertemoji} ${alerttitle} ${alertemoji}</b>\n\n<b>Server name</b>\n${servername}\n\n<b>Trigger Message</b>\n${alerttriggermessage}\n\n<b>Game</b>\n${gamename}\n\n<b>Map</b>\n${alertmap}\n\n<b>Current Players</b>\n${alertplayers}\n\n<b>Version</b>\n${alertversion}\n\n<b>Country</b>\n${country}\n\n<b>Server IP</b>\n${alertip}:${port}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>More info</b>\n${alertmoreinfourl}", |
|
|
|
"disable_web_page_preview": "yes" |
|
|
|
} |
|
|
|
EOF |
|
|
|