The Article "How to use error handling in e2e_appmon scripts (example script)" contains all of the information you need to catch an error and send an alarm. Its attached to that Article and also attached to this Article as well for your convenience. Please also make sure you have the "Dump screen on timeout" option enabled besides what you do in the script to dump any screens, e.g., the desktop so the state of the script run is captured when it fails. VNC/Team Viewer and LAN Manager are excellent for remote viewing purposes and a lot of issues can be identified when a script fails through the use of remote viewing. That said, when scripts fail due to unannounced web site or client app code changes script automation for error handling is highly recommended.
You can apply code in your e2e script to generate an alarm, here's an example:
qostime = nimQoSGetTimer()
if qostime >= 8000 then
nimAlarm(3,"The value exceeds the threshold...","a_suppression_key","1.1.14")
nimAlarm(0,"The value is below the threshold...","a_suppression_key","1.1.14")
Looking at the sample e2e scripts in e2e_scripting\Scripts directory has some script examples, e.g., example-correlation, and Nimbus functions including nimalarm(), nimalarmsimple() are defined in NimBUS-functions file in the same directory.
-- This example will show how to use triggers as part of a correlation rule
-- note that the trigger state may be retrieved by 2 methods.
-- An alarm will be fired if both triggers are active and a failed ping.
if trigger.state ("example.system") and state("example.network") then
if not action.ping("www.nimsoft.com") then
nimbus.alarm (2,"We have a situation here...")
If you need more advanced help, and you just have some more advanced questions you can try and get them answered from the field by posting a question/message in the CA Community Forum.
CA UIM/Nimsoft Professional Services answers questions and also adds to the content there.
On error return should be selected profiles.
On error return
If the option-> "On unexpected return value" is checked, the alarm selected from the pull-down menu will be sent.
See screen shot as well for some of the non-script options.
<Please see attached file for image>