Example of hanotify command

Following is an example of hanotify command:

    hanotify -i 1.3.6.1.4.1.1302.3.8.10.2.8.0.10 -l Warning -n
    agentres -T 7 -t "custom agent" -o 4 -S sys1 -L mv -p 
      sys2 -P mv -c MyAgent -C 7 -O johndoe -m "Custom message"

In this example, the number 1.3.6.1.4.1.1302.3.8.10.2.8.0.10 is the OID (Object Identifier) for the message being sent. Because it is a user-defined message, HAD has no way of knowing the OID associated with the SNMP trap corresponding to this message. Users must provide the OID.

The message severity level is set to Warning. The affected systems are sys1 and sys2. Running this command generates a custom notification with the message "Custom message" for the resource agentres.