arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
678 stars 143 forks source link

Pushbullet API integration. #839

Open thakyZ opened 6 years ago

thakyZ commented 6 years ago

I would love for there to be Pushbullet notifications for this tool. I already use Linux Game Server Managers for all my other servers but in my personal opinion, this ARK server tool is far greater than LGSM's version. But, the only thing it is missing is Pushbullet API integration. This would be amazing to have when updating the server/mods and when the server stops and starts.

cronner commented 6 years ago

Was about to suggest this also, think it would be great also so that you get notified id the server won't start or crash to minimize downtime

xohudson commented 5 years ago

This would be Great if Server is pushing with Messages what happen.. At this moment we have uptimeRobot but sometimes Server is to fast for a 5min checkup. So i´ve written a little script to Check the PID per Netstat TULPEN to know via PushPullet if Server has change the PID. An integration into the ARKmanager where great.

xohudson commented 5 years ago

`#!/bin/bash PB_TOKEN= [[ -z "${PB_TOKEN}" ]] && echo "=> PB_TOKEN is empty"

CHANGE_LOGFILE=/home/steam/ip_script/ark_s_check.log ADDRESS_LOGFILE=/home/steam/ip_script/ark_s_address.log

touch $ADDRESS_LOGFILE OLD_ADDR=$(cat $ADDRESS_LOGFILE) CUR_ADDR=$(netstat -tulpen|grep 32331)

NOTE_MESSAGE=${NOTE_MESSAGE:-"New PID: $CUR_ADDR"} NOTE_TITLE=${NOTE_TITLE:-"ARK Scorched Earth"}

if [ "$OLD_ADDR" == "$CUR_ADDR" ]; then echo "Address: $CUR_ADDR" else echo "####" echo "INFO: Scorched Earth geändert!" echo "Alt: $OLD_ADDR" echo "Neu: $CUR_ADDR" echo "####"

echo "$(date) :: Changed: Old ($OLD_ADDR), New ($CUR_ADDR)" >> $CHANGE_LOGFILE

curl -s --header "Access-Token: $PB_TOKEN" \ --header 'Content-Type: application/json' \ --data-binary "{\"body\":\"$NOTE_MESSAGE\",\"title\":\"$NOTE_TITLE\",\"type\":\"note\"}" \ --request POST \ https://api.pushbullet.com/v2/pushes

fi

echo "$CUR_ADDR" > $ADDRESS_LOGFILE `