DX NetOps

  • 1.  Deactivate an alarm on sundays

    Posted Oct 25, 2016 05:24 AM

    Someone know if is possible to create an alarm that it not be activated the sunday ?
    Not putting the maintenance the device.
    Not erase the alarma.
    Only this alarm and only the sundays from 00:00 to 08:00 will be supressed.

     

    Thank you!



  • 2.  Re: Deactivate an alarm on sundays

    Posted Oct 25, 2016 07:30 AM

    Have you tried to schedule maintenance mode for the certain period ?



  • 3.  Re: Deactivate an alarm on sundays

    Posted Oct 25, 2016 07:51 AM

    No, that not the situation that I need. All the alarms for this devices must be activated, except one of them and only for sundays. If I put the device in maintenance any alarm will be suppressed.



  • 4.  Re: Deactivate an alarm on sundays

    Broadcom Employee
    Posted Oct 25, 2016 08:33 AM
      |   view attached

    You’ll probably need to create a duplicate /custom/Events/EventDisp file that has your changes and cron a script that moves it in.  After it’s moved your script will need to run update action=0x100a2 on the VNM model which will force the SS to re-read the EventDisp files.  Then at the time you need it changed back, have the script put your original file back in and run the update action=0x100a2 on the VNM model again.

     

    Cheers

    Jay



  • 5.  Re: Deactivate an alarm on sundays

    Posted Oct 25, 2016 07:41 AM

    The event procedure outline in knowledge document TEC518230 "Using a SPECTRUM Event Procedure to assert event based on time" gives a good example based on time but I do not see a way based one the day of week and time.

     

    Joe



  • 6.  Re: Deactivate an alarm on sundays

    Broadcom Employee
    Posted Oct 25, 2016 10:28 AM

    Maybe you can do something with the GetCurrentTime, FormatDateTime, and parse the result for Sunday?

     

    -Rob



  • 7.  Re: Deactivate an alarm on sundays
    Best Answer

    Posted Oct 25, 2016 10:56 AM

    Very thankful by the help everybody.

     

    Finally I found a document publicated by Lalit Tyagi (thank you so much Lalit ) and I created the follow procedure:

     

    0xfff00663 E 20 P "If( And( GreaterOrEqual( FormatDateTime ( GetCurrentTime(), {S \"%H\"} ), { U 00 } ), And( LessOrEqual( FormatDateTime ( GetCurrentTime(), {S \"%H\"} ), { U 08 } ), Or( Equals ( FormatDateTime ( GetCurrentTime(), {S\"%w+\"} ), {S \"Sunday\"} ) ) ) ) , CreateEventWithVariables( \ { C CURRENT_MODEL }, { H 0xfff00664 }, GetEventVariableList() ),  CreateEventWithVariables( { C CURRENT_MODEL }, { H 0xfff00665 }, GetEventVariableList() ) )"
    0xfff00665 A 3,0x4500006



  • 8.  Re: Deactivate an alarm on sundays

    Posted Aug 08, 2017 08:30 AM

    Hello,

    Aren't there 2 errors in these lines?

     

    Here and here :

    errors

    Spectrum doesn't like that.

     

    Furthermore, GreaterOrEquat as LessOrEqual compare numbers while FormatDateTime returns a string.

     

     

    This Event Procedure should not work in my opinion.

     

    Regards.



  • 9.  Re: Deactivate an alarm on sundays

    Posted Aug 08, 2017 10:23 AM

    0xfff00663 E 50 P "If(\
    And(\
    Less(GetHour(GetCurrentTime()),{U 7})\
    ,\
    Equals(FormatDateTime(GetCurrentTime(),{S \"%w+\"}),{S \"Sunday\"})\
    )\
    ,\
    CreateEventWithVariables({C CURRENT_MODEL},{H 0xfff00664},GetEventVariableList())\
    ,\
    CreateEventWithVariables({C CURRENT_MODEL},{H 0xfff00665},GetEventVariableList())\
    )"

     

    no_alarms_on_sunday

     

    0xfff00663 E 50 P "If(And(Less(GetHour(GetCurrentTime()),{U 7}),Equals(FormatDateTime(GetCurrentTime(),{S \"%w+\"}),{S \"Sunday\"})),CreateEventWithVariables({C CURRENT_MODEL},{H 0xfff00664},GetEventVariableList()),CreateEventWithVariables({C CURRENT_MODEL},{H 0xfff00665},GetEventVariableList()))"

    0xfff00665 A 3,0x4500006