How does one reference the proper registry (reg) variable (var) to indicate in the cmd line action which servername is associated with the event?
This event driven FATAL rule works correctly by triggering on the FATAL events.
Condition: @event.getInt("change/value")==0&&@event.get("severityName")=="Fatal"
It appears the scope.get(agent/host/name) reg var doesn't return the hostname since the event may not be a particular agent which is associated with the alert.
There are four Event Types that event.get() can access.
The example below can be implemented in your rule's action to display the hostname.
Regarding obtaining the hostname for an alert which may not be based on an agent.
From a few of these fields in AlarmSystemEvent, and the ServiceLevel API (http://<yourfms>:8080/console/script-help/index.html), we're providing this expression example used as a variable and passed to the command action:
server.TopologyService.getObject(server.AlarmService.getAlarm(@event.get("alarmID")).getTopologyObjectID()).monitoredHost.name
The command action result outputs text like this: (replaced actual hostname below with [MYHOST] for this support case purpose.
Error on host [MYHOST].prod.quest.corp - Agent AppMonitor windows@[MYHOST].prod.quest.corp
(id: 29) is broken (health state: Broken)
Error on host [MYHOST].prod.quest.com - The network device [styx] is not available from {MYHOST.EN}.prod.quest.com. This may be caused by severe network congestion, a network failure, or the disconnection/powerdown of the device.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center