Blog Just another tech site

11Apr/150

Zabbix User Parameters For Monitoring OSX Battery

Zabbix Graph
UserParameter=ChargeRemaining,system_profiler SPPowerDataType | grep "Charge Remaining" | awk '{print $4}'
UserParameter=FullyCharged,system_profiler SPPowerDataType | grep -m 1 "Fully Charged" | awk '{print $3}' | awk '{ gsub("No","0"); gsub("Yes","1"); print $1}'
UserParameter=ChargingStatus,system_profiler SPPowerDataType | grep -m 1 "Charging" | awk '{print $2}' | awk '{ gsub("No","0"); gsub("Yes","1"); print $1}'
UserParameter=FullChargeCapacity,system_profiler SPPowerDataType | grep "Full Charge Capacity" | awk '{print $5}'
UserParameter=CycleCount,system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'
UserParameter=Condition,system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}'
UserParameter=Amperage,system_profiler SPPowerDataType | grep "Amperage" | awk '{print $3}'
UserParameter=Voltage,system_profiler SPPowerDataType | grep "Voltage" | awk '{print $3}'

Calculated item within zabbix for battery percentage:

last(ChargeRemaining)/last(FullChargeCapacity)*100

Leave a Reply

Your email address will not be published. Required fields are marked *