The OpenWRT wget implementation aka uci-fetch did not play along
well with the way the meteocontrol weblog HTTP server closes its
connection. To simplify it all just use curl, we need it anyway here.
Also fix up some spaces superflous port definition in the URL.
-# Checks inverter state as repoted by a metecontrol weblog
+# Checks inverter state as repoted by a meteocontrol weblog
# device HTML interface, reports issues via Atlassian
# Opsgenie. Written with the intention to run via cron on
# a LTE Router with either OpenWRT or Teltonika RutOS.
# device HTML interface, reports issues via Atlassian
# Opsgenie. Written with the intention to run via cron on
# a LTE Router with either OpenWRT or Teltonika RutOS.
-# Requires curl for the Opsgenie part, otherwise
-# sh/cut/cat/wget/test are enough.
+# Requires curl other stock sh/cut/cat/test are enough.
# createAlert <alias> <message> <description>
createAlert() {
# createAlert <alias> <message> <description>
createAlert() {
- grep "cLink" "${file}" | while read line; do
+ grep "cLink" "${file}" | while read line; do
result="$(parseMcLine \"${line}\")"
# good case
if [ "${result}" = "OK" ]; then
result="$(parseMcLine \"${line}\")"
# good case
if [ "${result}" = "OK" ]; then
rm -f "${outfile}"
# ready to try to download the data from meteocontrol
rm -f "${outfile}"
# ready to try to download the data from meteocontrol
- if ! wget -q -O "${outfile}" "${url}"; then
+ if ! curl -s -o "${outfile}" "${url}"; then
echo "ERROR: could not download ${url} into ${outfile}"
exit 1
fi
echo "ERROR: could not download ${url} into ${outfile}"
exit 1
fi
API_KEY=""
# adjust meteocontrol default password and IPs
API_KEY=""
# adjust meteocontrol default password and IPs
-mc1="http://admin:ist02@192.168.1.2:80/html/de/onlineOverWr.html"
-mc2="http://admin:ist02@192.168.1.3:80/html/de/onlineOverWr.html"
+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
### main loop
for dev in mc1 mc2; do
createAlert "${dev}" "PV ${dev}" "${failures}"
continue
fi
createAlert "${dev}" "PV ${dev}" "${failures}"
continue
fi
# update alert state close alert on state change
checkAlertState "${statefile}" "OK" && \
closeAlert "${dev}"
# update alert state close alert on state change
checkAlertState "${statefile}" "OK" && \
closeAlert "${dev}"