Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- MODEM_HOST="Cable Modem"
- MODEM_IP="192.168.100.1"
- SIGNAL_URL="http://$MODEM_IP/RgSignal.asp"
- ZABBIX_SERVER="127.0.0.1"
- curl --silent "$SIGNAL_URL" |
- sed -n -e '
- /Downstream/,/Upstream/ {
- # 0,/Downstream/ { s/<[^>]*>/ /g p }
- /Frequency/ { s/<[^>]*>/ /g ; s/[^0-9]*\([0-9.]*\).*/- surfboard.downstream.frequency \1/ p }
- /Power Level/ { /snapshot/ ! { s/<[^>]*>/ /g ; s/[^0-9]*\([0-9.]*\).*/- surfboard.downstream.power \1/ p } }
- /Signal To Noise Ratio/ { s/<[^>]*>/ /g ; s/[^0-9]*\([0-9.]*\).*/- surfboard.downstream.snr \1/ p }
- }
- /Upstream/,/Downstream/ {
- # 0,/Upstream/ { s/<[^>]*>/ /g p }
- # /Channel/ { s/<[^>]*>/ /g p }
- /Frequency/ { s/<[^>]*>/ /g ; s/[^0-9]*\([0-9.]*\).*/- surfboard.upstream.frequency \1/ p }
- /Power/ { s/<[^>]*>/ /g ; s/[^0-9]*\([0-9.]*\).*/- surfboard.upstream.power \1/ p }
- }' |
- zabbix_sender --zabbix-server "$ZABBIX_SERVER" --host "$MODEM_HOST" --input-file -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement