X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fscripts.git;a=blobdiff_plain;f=home%2Fpvmon2opsgenie.sh;fp=home%2Fpvmon2opsgenie.sh;h=d1384b9084f04f01af9e6ab48570ef59bbe3ee00;hp=c5b970e78f8597d8653d18c798e2ff4d1cb1ba46;hb=de948ddb204597c6abd5b1403f83a9cbac71a8f0;hpb=28b33f9ee6d08b99e99b8158bb593c7dfd7e8365 diff --git a/home/pvmon2opsgenie.sh b/home/pvmon2opsgenie.sh index c5b970e..d1384b9 100755 --- a/home/pvmon2opsgenie.sh +++ b/home/pvmon2opsgenie.sh @@ -5,6 +5,23 @@ # a LTE Router with either OpenWRT or Teltonika RutOS. # Requires curl other stock sh/cut/cat/test are enough. +### path to the suntime / check for daylight script +checkdaylight="./suntime.lua" + +### opsgenie configuration +API_HOST="api.eu.opsgenie.com" +API_KEY="" + +# adjust meteocontrol default password and IPs +# meteocontrol devices must be added to the main loop as well +mc1="http://admin:ist02@192.168.1.2/html/de/onlineOverWr.html" +mc2="http://admin:ist02@192.168.1.3/html/de/onlineOverWr.html" + + +### check for daylight, otherwise exit early +${checkdaylight} || exit 3 + + # createAlert createAlert() { local alias="${1}" @@ -143,14 +160,6 @@ checkAlertState() { return 0 } -### main configuration -API_HOST="api.eu.opsgenie.com" -API_KEY="" - -# adjust meteocontrol default password and IPs -mc1="http://admin:ist02@192.168.1.2/html/de/onlineOverWr.html" -mc2="http://admin:ist02@192.168.1.3/html/de/onlineOverWr.html" - ### main loop for dev in mc1 mc2; do outfile="/tmp/${dev}.html"