Active IQ Unified Manager Discussions

Unified Manager 6.3 Alert scripts

Livewire18
14,917 Views

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. 

 

Arguments

-eventID

-eventSourceID

-eventSourceName

-eventSourceType

-eventState-eventArgs

 

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!!

1 ACCEPTED SOLUTION

mbeattie
14,648 Views

Hi,

 

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:

 

https://kb.netapp.com/support/index?page=content&id=3012180

 

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
   event.id AS 'event_id',
   event.eventTimeStamp AS 'event_time_stamp',
   event.impactArea AS 'event_impact',
   event.source_type,
   event.source_fullName AS 'source_full_name',
   eventtypevalue.internalName AS 'internal_name',
   vserverlivelistdtoview.clusterName AS 'cluster_name',
   vserverlivelistdtoview.name AS 'vserver_name'
FROM
   ocum.event,
   ocum.eventtypevalue,
   ocum.vserverlivelistdtoview
WHERE
   event.id = 20006
AND
   vserverlivelistdtoview.clusterId = event.cluster_id
AND
   vserverlivelistdtoview.id = event.vserver_id
AND
   eventtypevalue.id = event.value_id

(where event.id = 20006 in the powershell code would be "event.id = $eventID" or "event.id = $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:

 

event_id,event_time_stamp,event_impact,source_type,source_full_name,internal_name,cluster_name,vserver_name
20006,2016-03-03 17:03:29,AVAILABILITY,inventory.ontap.storage.FlexVol,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.

 

/matt

 

 

 

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

View solution in original post

13 REPLIES 13
Public