Skip to content

Instantly share code, notes, and snippets.

@ttlequals0
Created October 6, 2016 23:53
Show Gist options
  • Save ttlequals0/0cbb35d7b0c32d97d8cb8a878afb641d to your computer and use it in GitHub Desktop.
Save ttlequals0/0cbb35d7b0c32d97d8cb8a878afb641d to your computer and use it in GitHub Desktop.
Grab HP server power usage via snmp
for i in $(seq 31 70); do host="10.143.8.$i" ; rawwatts=$(snmpwalk -v1 -c <comstring> 10.143.8.$i .1.3.6.1.4.1.232.6.2.9.3.1.7.0.1 2>/dev/null); watts=$(echo $rawwatts | awk -F ":" '{print $4}'); echo "$host $watts Watts" ; done
output:
10.143.8.31 141 Watts
10.143.8.32 146 Watts
10.143.8.33 150 Watts
10.143.8.34 156 Watts
10.143.8.35 145 Watts
10.143.8.36 163 Watts
10.143.8.37 141 Watts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment