Jump to content

Tibco Hawk Action=sendHawkUserTrap ability to generate hawkUserTrapId


Recommended Posts

Hello There

When defining a rulebase having action of sendHawkUserTrap i want to generate the hawkUserTrapId for every time the trap is being sent to the SNMP host. I am aware that this field accepts only a Integer literal constant to be specified while defining the rulebase. However my requirement is to generate a unique trapId everytime which the receiving host has the requirement. One of the ways is to get the current timestamp in seconds and use it (expecting no 2 alerts will be within the same second). For this i can invoke a small shell script, however am not getting how to invoke and assign to this field. Any one please if you are aware or any thoughts around this will be really helpful, am attaching the sample rulebase for your reference. Please let me know if any questions. Thanks in Advance.

Link to comment
Share on other sites

  • 1 month later...


One thing you could try is to write a Java program base on Hawk Console API and invokesendHawkUserTrap() method from Java program where a random number could be generated and used forhawkUserTrapId. Also the Java program could accept a String(nextline) as input parameter.

Instead of invokingsendHawkUserTrap() method, you may invoke this Java program as an action and pass the nextline as input parameter.

There is console api sample under example folder.

Hope this helps.


Tristan Chou

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...