#!/bin/bash

case $1 in
   config)
        cat <<'EOM'
graph_title Agilent current
graph_vlabel current
graph_category environment
agilent_cur1.label Camera current
agilent_cur2.label Interlock current
agilent_cur3.label Bias current
EOM
        exit 0;;
esac

DATA220=( `echo -e -n "meas:curr?\n" | nc 10.0.100.220 5025` )
RC220=$?

if [ "$RC220" == "0" ] ; then
   echo agilent_cur1.value `printf %.3f ${DATA220}`
fi

DATA224=( `echo -e -n "meas:curr?\n" | nc 10.0.100.224 5025` )
RC224=$?

if [ "$RC224" == "0" ] ; then
   echo agilent_cur2.value `printf %.3f ${DATA224}`
fi

DATA222=( `echo -e -n "meas:curr?\n" | nc 10.0.100.222 5025` )
RC222=$?

if [ "$RC222" == "0" ] ; then
   echo agilent_cur3.value `printf %.3f ${DATA222}`
fi

