Skip to content

Commit

Permalink
Fixup on battry charge value in metric
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Oct 29, 2013
1 parent d86dcbe commit d2f502d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions upsilon-serviceChecks/check_power_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
if onAcPower:
exit(OK, None, "On AC Power")
elif hasBattery:
karma = OK if batteryCharge > 25 else CRITICAL
metadata = clsmetadata()
metadata.addMetric("batteryCharge", batteryCharge, OK if batteryCharge > 25 else CRITICAL)
exit(WARNING, metadata, "On Battery, charge is: " + str(batteryCharge) + "%")
metadata.addMetric("batteryCharge", batteryCharge, karma)
exit(karma, metadata, "On Battery, charge is: " + str(batteryCharge) + "%")
else:
exit(CRITICAL, None, "Can't detect power source!")

0 comments on commit d2f502d

Please sign in to comment.