send_boolean

Function description

The send_boolean function should be used to send a boolean value to the master agent.

Function parameters

$1 - The OID to send before the data.

$2 - The value to send (T for true, F for false)

Example use

Listing 1
  1. # Function to send device health
  2. #
  3. #   @in_param   $1 - The OID to send before this data
  4. #   @in_param   $2 - The index value
  5. #
  6. function send_device_hlth
  7. {
  8.     local DEVFNAME VALUES
  9.    
  10.     # Make the device info filename
  11.     get_device_file_basepath ${2} DEVFNAME
  12.     DEVFNAME="${DEVFNAME}_state"
  13.    
  14.     # Find the entry in above file
  15.     VALUES=($(grep "result:" < ${DEVFNAME}))
  16.     [[ "${VALUES[5]}" == "PASSED" ]] && send_boolean ${1} "T" || send_boolean ${1} "F"
  17. }
Example code demonstrating use of the send_boolean function