7 Replies Latest reply: Feb 27, 2013 8:26 AM by matthewt RSS

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

pierrek
Currently Being Moderated

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

  • Re: How can I use "dfm event generate" to trigger a custom dfm event?
    adaikkap
    Currently Being Moderated

    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