[j-nsp] Generating events based on day of week

Alexander Shikoff minotaur at crete.org.ua
Thu Oct 29 02:49:25 EDT 2009


On Thu, Oct 29, 2009 at 01:32:43AM -0400, Phil Shafer wrote:
> Alexander Shikoff writes:
> >I'm wondering is it possible to generate events based on day of week, i.e.
> >every Friday or Sunday etc.?
> >"set event-options generate-event" allows configuration of time of day only.
> >Any ideas? Thanks in advance!
> 
> No, we don't have day-of-week support.  You can have you AM open
> an ER for this.  What sorts of things are you looking to trigger?
> 
> Of course, you can make a daily event and then check the day of
> the week inside your script before proceeding.

I need to change policer on an interface. Now all that stuff configured 
as follows:
minotaur at br1-gdr.ki> show configuration event-options 
generate-event {
    Start-Business-Time time-of-day "08:00:00 +0200";
    End-Business-Time time-of-day "20:00:00 +0200";
}
policy Business-Time {
    events Start-Business-Time;
    then {
        event-script change-policer.slax {
            arguments {
                interface ge-0/0/0;
                unit 400;
                policer-in pol-30Mbit;
                policer-out pol-30Mbit;
            }
        }
    }
}
policy Non-Business-Time {
    events End-Business-Time;
    then {
        event-script change-policer.slax {
            arguments {
                interface ge-0/0/0;
                unit 400;
                policer-in pol-50Mbit;
                policer-out pol-50Mbit;
            }
        }
    }
}
event-script {
    file change-policer.slax;
}



Now I wish to add here days-off, national holidays etc.
Event script change-policer.slax is very simple, it accepts 4 params,
and I suppose that placing checks of day of week/month in it is not
right way.

-- 
MINO-RIPE


More information about the juniper-nsp mailing list