17 06 2016
LINDY IP Power Switch Classic 8 – SNMP cheat sheet (ipower, remote power)
LINDY’s IP Power Switch Classic 8 is a wonderful device that i really like. Not only does it offer a http Administration (the https panel doesn’t really work for me though, due to ssl protocol fuckup – hopefully they will fix this in a firmware upgrade soon).
Anyways, the more beautiful alternative to the HTTP admin is SNMP as it can be integrated more easily into bash scripts for automation etc.
SNMP short info:
snmpwalk -v1 -c public 192.168.1.9 system
SNMP long info:
snmpwalk -v1 -c public 192.168.1.9 . #or: snmpwalk -v1 -c public 192.168.1.9 iso
SNMP power outlets:
snmpwalk -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.13.0
snmpset data types:
snmpset -h |& tail -4
snmpget example (get power state for all 8 power outlets):
snmpget -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.13.0
snmpset example (rename outlet F to “OutletFnew”):
snmpset -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.14.6.0 s "OutletFnew"
snmpget example (get current total power usage for all ports. Value 1 represents 0.1 Ampere)
snmpget -c public -v 1 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.11.0
=> int 5 = 0.5 Ampere, 0.5*240V = 120 Watts power usage currently. Value updates every few seconds.
lindy_get_power_usage.sh:
#!/bin/bash intval=`snmpwalk -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.11.0 | cut -d ':' -f 2 | tr -d ' '` mamp=$((intval * 100)) watt=$((intval * 240 / 10)) echo "Ampere: $mamp mA" echo "Watt: $watt W"
For reading out the photovoltaic values, see also https://blog.b-nm.at/2016/04/28/linux-prozesse-pausierenresume-durch-solar-photovoltaik-pv-controller-piko-5-5-kostal/
Useful tools & commands for resizing/growing LVM based disks/filesystems … Enable mouse scrolling inside screen sessions
Comments are currently closed.