send_gauge
Function description
The send_gauge function should be used to send a 32-bit integer
gauge value to the master agent.
Function parameters
$1 - The OID to send before the data.
$2 - The integer value to send.
Example use
Listing 1
# Function to send device attribute
#
# @in_param $1 - The STRING to search for
# @in_param $2 - R to send RAW value, L to send LIFETIME value
# @in_param $3 - The OID to send before this data
# @in_param $4 - The index value
#
function send_device_attr
{
local DEVFNAME VALUES
# Make the device info filename
get_device_file_basepath ${4} DEVFNAME
DEVFNAME="${DEVFNAME}_attr"
# Find the entry in above file
VALUES=($(grep "${1}" < ${DEVFNAME}))
case ${2} in
"R")
send_gauge ${3} ${VALUES[9]}
;;
"L")
send_gauge ${3} $((${VALUES[3]##0} - ${VALUES[5]##0}))
;;
*)
send_gauge ${3} -1
;;
esac
}