send_integer

Function description

The send_integer function should be used to send an integer 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
  1. # Function to send the index value
  2. #
  3. #   @in_param   $1 - The OID to send before this data
  4. #   @in_param   $2 - The index value
  5. #
  6. function send_index
  7. {
  8.     # If we were passed an index...
  9.     if (( $# > 1 )); then
  10.         # ...and the index is in range...
  11.         if (( ${2} <= ${#DEVICES[@]} )); then
  12.             # Send the OID and the index number.
  13.             send_integer ${1} ${2}
  14.             return
  15.         fi
  16.     fi
  17.  
  18.     # Send the OID and NONE.
  19.     send_none ${1}
  20. }
Example code demonstrating use of the send_integer function