Active IQ Unified Manager Discussions

Unified Manager 6.3 Alert scripts


Has anyone had any luck in passing environment variables from OCUM 6.3 to a script? Long story short, I am working with BPPM Msend.exe to create incident tickets when we have alerts. In DFM 5.2 I was able to pass the DFM_EVENT_SEVERITY, DFM_SOURCE_TYPE, and so forth to the script. This allowed me to set the priority of incident tickets and also customize the alert messages. In 6.3, I found a very short piece of information, but it has very limited items passed and does not state if they are always passed with the same ARGV[x] number. 



This is what I have found so far. 









Example for obtaining arguments from scripts

print "$ARGV[0] : $ARGV[1]\n"

print "$ARGV[2] : $ARGV[3]\n"


When an alert is generated, this script is executed and the following output is displayed:


-eventID : 290 

-eventSourceID : 4138


Unfortunately, this is not telling me (or anyone else) much of anything. I have communications in with the OCUM developers, but not sure how long that will take. As of right now, we have 8.3.1 Systems that are not being alerted on when we have issues. 


My current 5.2 script is in powershell, and although I do not like powershell, I would like to keep the 6.3 script in the same.


Any help or sample scripts would be greatly appreciated!!





I've a had a closer look and totally agree with you that this is very poorly implemented and documented in OCUM 6.X compared with environment variable flexibilty and simplicity available in DFM 5.X. EG:


Note: I tried using environment variables in this method for OCUM6.X but it's not implemented (Adding to my list for engineering developement requests).


From a powershell perspective the "-eventID" parameter value is $args[1]. EG the parameter name "eventID" = $args[0] and the parameter value is $args[1] (eventID = X)

So with this in mind i had a look at what you might be able to do if you get the script which is attached to your alarm to invoke a MySQL using the EventID as basis. Something like...



SELECT AS 'event_id',
   event.eventTimeStamp AS 'event_time_stamp',
   event.impactArea AS 'event_impact',
   event.source_fullName AS 'source_full_name',
   eventtypevalue.internalName AS 'internal_name',
   vserverlivelistdtoview.clusterName AS 'cluster_name', AS 'vserver_name'
WHERE = 20006
   vserverlivelistdtoview.clusterId = event.cluster_id
AND = event.vserver_id
AND = event.value_id

(where = 20006 in the powershell code would be " = $eventID" or " = $args[1]")


With a some modification this will probably return the type of detail are looking for. The above SQL query was for a test i put together for an alert setting a volume state to offline. EG:


20006,2016-03-03 17:03:29,AVAILABILITY,,vserver1/volume_001,offline,cluster1,vserver1

Hope that gives you some ideas. When i get some time i'll post a more comprehsive example in powershell.






If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post