send_string

Function description

The send_string function should be used to send a string value to the master agent.

Function parameters

$1 - The OID to send before the data.

$2 - The string value to send

Example use

Listing 1
  1. # Function to send device info - called: send_device_info OID DEVICE "Info String"
  2. #
  3. #   @in_param   $1 - The STRING to search for
  4. #   @in_param   $2 - The OID to send before this data
  5. #   @in_param   $3 - The index value
  6. function send_device_info
  7. {
  8.     local DEVFNAME VALUE
  9.    
  10.     # Make the device info filename
  11.     get_device_file_basepath ${3} DEVFNAME
  12.     DEVFNAME="${DEVFNAME}_info"
  13.    
  14.     # Find the entry in above file
  15.     VALUE=$(grep "${1}" < ${DEVFNAME})
  16.     VALUE=${VALUE#${1}}
  17.     send_string ${2} "${VALUE}"
  18. }
Example code demonstrating use of the send_string function