DX NetOps

Expand all | Collapse all

Notifier to Sendmail only when the alarm is acknowledged

  • 1.  Notifier to Sendmail only when the alarm is acknowledged

    Posted Nov 30, 2015 07:28 AM

    Hello Everyone,

     

    I need help to make a Script that allow me to use the UpdateScript to send e-mails only when someone ack's the alarm.

     

    By default the UpdateScript is triggered by three factors:

    whenever a troubleshooter is assigned

    whenever status information is entered

    whenever acknowledge is set

     

    My idea is to use a script like this:

     

    if acknowledge=true

    then Sendmail=true

    else

    sendmail=false

     

    Of course the other two conditions may not trigger the sendmail, what could make me add some other conditions, but i don't know how to do so.

     

    Appreciate all the help and ideas.



  • 2.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Nov 30, 2015 11:46 AM

    why not use AO profile for this and select Message assigned to and check mark it. When someone acks an alarm the email will go out as long as use setup something in the emailgtw probe.



  • 3.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Broadcom Employee
    Posted Nov 30, 2015 11:50 AM

    Nice idea but wrong product.  The original post is referring to Spectrum, not UIM/Nimsoft.



  • 4.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Nov 30, 2015 01:20 PM

    I don't have an answer, but I think the problem is very interesting:

    Is there a chance to  get the cause for an alarm update and use this in the update script?



  • 5.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 01, 2015 06:29 AM

    You mean add the attribute that triggers the UpdateScript to the output (NOTIFIER.OUT, e-mail)?

    If i understood right, i guess it should help:

     

    http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec516900.aspx



  • 6.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 01, 2015 07:34 AM

    If I'm right, so you want to  send the mail as the result of the acknowledge action.

    So, you have not to check: Is the alarm acknolewdged?

    You have to check: Did the UpdateScript start as the result of the acknowledge action?

    And I don't know, how to get this information.



  • 7.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 02, 2015 08:25 AM

    There's already an attribute for acknowledge, his variabe is $ACKD and have two conditions True or False

    My idea that whenever the updatescript is triggered, no matter wich condition caused it, to check if the $ACKD is True, if yes the Sendmail

    attribute becomes True and it will notify by e-mail everyone i want, but if the $ACKD is False the sendmail stays False and no e-mail is sent.



  • 8.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 03, 2015 10:07 AM

    I think, this will work, but after the alarm was acknowledged you will get a mail for every update of this alarm.



  • 9.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 08, 2015 10:27 AM

    Frank is correct. When the alarm is acknowledged, the $ACKD variable is set to TRUE. After that, if the alarm is updated for any reason, the alarm status is updated for example, this will cause the Update Script to be executed again. $ACKD will still be TRUE and an e-mail will be sent.

     

    When an alarm is updated, (acknowledged, status, trouble shooter, trouble ticket etc) Spectrum logs event 0x10707.

     

         

    Created OnNameEventCreated ByEvent Type
    Dec 8, 2015 10:02:04 AM ESTSwitchAlarm number 1503 has been updated for device Switch of type HubCat29xx by User spectrum@spectrum.  New Alarm_Status - Test.spectrum@spectrum0x10707
    Dec 8, 2015 9:54:42 AM ESTSwitchAlarm number 1503 has been updated for device Switch of type HubCat29xx by User spectrum@spectrum.  New Acknowledged - TRUE.spectrum@spectrum0x10707

     

     

    Unfortunately, the 0x10707 event is not passed to AlarmNotifier.



  • 10.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Posted Dec 15, 2015 11:27 AM

    Guys,

    I managed to make a script that is working fine so far.

    As some expected i was having problems with any updates that can occur to the alert after we acknowledge it.

     

    I succeeded to create a script that allowed me to insert a Status, TroubleTicketID and send e-mails only after i Acknowledged the alert, which was nice, but Spectrum considers the clear as an update to the alarm, so when the alert was cleared, as the alert was already ack'd i was also sending an e-mail.

     

    if [ -n "$STATUS" ] && [ "$ACKD" = TRUE ]

    then

    SENDMAIL=True              #True or False

    else

    SENDMAIL=False              #True or False

    fi

     

    So i had to find a way to also prevent the sendmail to happen when the alert clears.

    After researching a little and studying the other Set and Clear Scripts and how they work , i discovered a condition named $MODEL_CONDITION, that shows the condition of the device in the moment the script (Set, Update or Clear) is triggered.

     

    When the %MODEL_CONDITION is "0" it means that is no alert and it's the value that comes when the clear triggers the Update Script. So i improved my script:

     

    if [ -n "$STATUS" ] && [ "$ACKD" = TRUE ] && [ "$MODEL_CONDITION" != "0" ]

    then

    SENDMAIL=True              #True or False

    else

    SENDMAIL=False              #True or False

    fi

     

    And so far, it is working as Intended  . The only time the UpdateScript send e-mails is when we Acknowledge the alert.



  • 11.  Re: Notifier to Sendmail only when the alarm is acknowledged

    Broadcom Employee
    Posted Jun 26, 2017 02:25 PM

    Thanks for using the CA Community!  It looks like your question has been answered so we are closing this thread out.  If you have additional questions, please feel free to contact us again.