Skip to content

Instantly share code, notes, and snippets.

@drwahl
Created January 7, 2020 20:10
Show Gist options
  • Save drwahl/19ec7bcf58ec4f0e2e13d42562d84212 to your computer and use it in GitHub Desktop.
Save drwahl/19ec7bcf58ec4f0e2e13d42562d84212 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# $1 should be one of:
# SpdAvg
# SpdGst
# DirAvg
# DirGst
result=$(wget -q -O - 'http://rwis.mdt.mt.gov/scanweb/RPUStatus.asp?Pageid=RPUStatus&Units=English&Groupid=564000&Siteid=564005' | \
grep -A6 $1 | \
tail -1 | \
cut -d'>' -f2 | \
cut -d' ' -f1 | \
cut -d'<' -f1)
case $1 in
SpdAvg)
zbxkey=wind.spdavg
;;
SpdGst)
zbxkey=wind.spdgst
;;
DirAvg)
zbxkey=wind.diravg
;;
DirGst)
zbxkey=wind.dirgst
;;
esac
zabbix_sender -z zabbixserver -s 'host' -k $zbxkey -o $result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment