#!/bin/sh
#
# Plugin to monitor MGE battery state.

if [ "$1" = "config" ]; then
        echo 'host_name pulsar.crans.org'
	echo 'graph_category Batteries'
	echo 'graph_title Autonomie'
	echo 'graph_vlabel t (minutes)'
        echo 'remain.label Autonomie restante'
#	echo 'charg.label Temps de recharge'
	exit 0
fi

cmd="snmpget -O vq -v1 -c public pulsar.adm.crans.org SNMPv2-SMI::enterprises.705.1."

remain=$(${cmd}5.1.0) # autonomie restante
#charg=$(${cmd}5.8.0) # temps avant charge complère des batteries
echo "remain.value $(($remain/60)).$(($remain%60*10/6))"
#echo "charg.value $(($charg/60)).$(($charg%60*10/6))"

