Active IQ Unified Manager Discussions

How can I use "dfm event generate" to trigger a custom dfm event?

pierrek
6,540 Views

Dear All,

I am currently defining dfm alarms, calling the execution of a powershell script. In this script, I am parsing the DFM environment variables provided by DFM, to take conditional actions (send some nagios alerts,...) based on the nature of the event.

For some of those events, I would like to be able to call dfm inside my script to generate customized events, to which I could associate other alarms for instance.

From what I understood, I should first create a custom event (one that is not in the list of builtin events), and then use the command dfm event generate to trigger the creation of this custom event, that will then appear in DFM and execute associated alarms...

I have not been able to find any working example of such a customization. Could someone share some experience with me?

Thanks in advance

Pierre

7 REPLIES 7

adaikkap
6,540 Views

Hi Pierre,

     In order to first use dfm event generate you will need to define custom event first. I am pasting xml to define the same,

Input xml.

<?xml version="1.0" encoding="UTF-8"?>

<netapp  xmlns="http://www.netapp.com/filer/admin" version="1.0">

  <eventclass-add-custom>

    <about-message>This event is custom created</about-message>

    <event-class-name>CloneSavings</event-class-name>

    <event-names>

      <event-name-info>

        <event-name-pretty>Clone Space Saving Is Low </event-name-pretty>

        <event-name-short>LowCloneSpaceSaving</event-name-short>

        <severity>Error</severity>

      </event-name-info>

    </event-names>

    <event-namespace-name>OpsMgr</event-namespace-name>

    <is-allow-duplicates>Yes</is-allow-duplicates>

    <is-multi-current>Yes</is-multi-current>

  </eventclass-add-custom>

</netapp>

output xml

<?xml version='1.0' encoding='UTF-8' ?>

<netapp version='1.0' xmlns='http://www.netapp.com/filer/admin'>

          <results status='passed'>

                    <event-class-id>1</event-class-id>

          </results>

</netapp>

[root@ ~]# dfm eventtype list OpsMgr:CloneSavings:LowCloneSpaceSaving

Event Name                                         Severity     Class

-------------------------------------------------- ------------ ------------------

OpsMgr:CloneSavings:LowCloneSpaceSaving       Error        OpsMgr:CloneSavings

[root@~]#

[root@vmlnx ~]# dfm event generate "OpsMgr:CloneSavings:LowCloneSpaceSaving" 258 "The clone has divluged from the parent and there is no more space savings"

Event OpsMgr:CloneSavings:LowCloneSpaceSaving for source amir generated.

[root@vmlnx ~]# dfm report view events 258

Severity    Event ID Event                                     Triggered    Ack'ed By Ack'ed       Source ID Source

----------- -------- ----------------------------------------- ------------ --------- ------------ --------- ----------------

Error       3861     OpsMgr:CloneSavings:CloneSpaceSavingIsLow 05 Oct 20:07                        258       mpo-vsim10:/amir

Information 178      Scheduled Snapshots Disabled              13 Sep 09:47                        258       mpo-vsim10:/amir

[root@vmlnx~]#

Hope this example of the alarm create.

[root@ ~]# dfm alarm create -E "abc@xyz.com" -h "OpsMgr:CloneSavings:LowCloneSpaceSaving"

Created alarm 1 with 1 email recipient.

[root@ ~]# dfm alarm list

Alarm                1

Group                Global

Event Severity       All

Event Name           OpsMgr:CloneSavings:LowCloneSpaceSaving

Email Addresses      abc@xyz.com

[root@ ~]#

Regards

adai

pierrek
6,540 Views

Thanks a lot Adai.

We are now using this functionality to extend DFM monitoring capability, using powershell scripts. It's working perfectly.

Kind regards

Pierre

adaikkap
6,540 Views

Hi Pierre,

     Happy to help you. Good to know that you could achieve what you wanted with this feature.

Regards

adai

GARDINEC_EBRD
6,540 Views

Hi Adai,

Quick question: What/Where does the xml go to define custom events and event classes on OC?  Today I run a script manually to check my snapmirror destination vols are >= the autosize max set on the source vols, and I'd like to generate custom alerts/alarms in Ops Manager if the script finds any that are non-conformant.  One of many possibilities!!

Thanks,

Craig

MARTIN_NETAPP
6,540 Views

Hi Everyone Id like to know where this XML goes to generate the custom event too.

adaikkap
6,540 Views

Hi Martin,

     You will have to make an API call against your dfm server. Use the NMSDK it has to api, documentation and also the tool to run it.

Once the API is run an entry is made in the embedded sybase database.

Regards

adai

matthewt
6,540 Views

If you package your script, help file and XML in a zip file of the same name as the script, you can use the script installation tools in OnCommand Unified Manager to "install" your script as a plugin.  At that time the custom events in the XML file will appear in places such as dfm eventtype list along with all the default events.

Public