Re: [j-nsp] srx event-options

2013-03-18 Thread Luca Salvatore
Thanks all, I have it working now with the slax script.

It seems my original config won't work in the current version, but should be 
support in 12.1.  Looks like the syntax has changed slightly but juniper doco 
states we don't need a script and can do it straight from the CLI in 12.1 and 
above,

Luca


-Original Message-
From: juniper-nsp-boun...@puck.nether.net 
[mailto:juniper-nsp-boun...@puck.nether.net] On Behalf Of Alex Arseniev
Sent: Tuesday, 19 March 2013 4:30 AM
To: juniper-nsp@puck.nether.net
Subject: Re: [j-nsp] srx event-options

The OP has already tried it with the event-script but did not tell us :-)
http://forums.juniper.net/t5/Junos-Automation-Scripting/disable-interface-slax-script-not-running-not-configured/td-p/183237
I provided him with final hints and he should be able to use the script as 
published - or maybe after changing the interface name in the script itself.
Thanks
Alex


- Original Message - 
From: "Brian Johnson" 
To: "Diogo Montagner" ; "Luca Salvatore" 

Cc: 
Sent: Monday, March 18, 2013 1:28 PM
Subject: Re: [j-nsp] srx event-options


> Diogo,
>
> I believe he is shutting down his external interface when a neighbor on 
> the internal interface is down.
>
> Alex: This script looks interesting and I'd like to see the final solution 
> when you get it.
>
> Thanks.
>
> - Brian
>
>
>> -Original Message-
>> From: juniper-nsp-boun...@puck.nether.net [mailto:juniper-nsp-
>> boun...@puck.nether.net] On Behalf Of Diogo Montagner
>> Sent: Monday, March 18, 2013 7:25 AM
>> To: Luca Salvatore
>> Cc: juniper-nsp@puck.nether.net
>> Subject: Re: [j-nsp] srx event-options
>>
>> I think you need to review your logic. How do you expect the OSPF 
>> adjacency
>> to come up if you have shutdown the interface ?
>>
>> On Monday, 18 March 2013, Luca Salvatore wrote:
>>
>> > I'm playing around with some event-options on a SRX.  I'm trying to 
>> > make
>> > the SRX shutdown an interface when a specific OSPF neighbour is 
>> > detected
>> as
>> > down, then bring the interface back up once OSPF has re-established.
>> >
>> >
>> > I have this:
>> >
>> > [edit event-options]
>> > lsalvatore@FWL001# show
>> > policy shutdown_internet_if_core_down {
>> > events rpd_ospf_nbrdown;
>> > attributes-match {
>> > rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
>> > }
>> > then {
>> > execute-commands {
>> > commands {
>> > "set interface ge-0/0/3 disable";
>> > commit;
>> > }
>> > }
>> > }
>> > }
>> > policy bring_up_internet_when_core_is_back {
>> > events rpd_ospf_nbrup;
>> > attributes-match {
>> > rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
>> > }
>> > then {
>> > execute-commands {
>> > commands {
>> > "delete interface ge-0/0/3 disable";
>> > commit;
>> > }
>> > }
>> >
>> > Should this work?  I haven't been able to test it yet but it seems like 
>> > it
>> > may do what I need.
>> > Luca
>> >
>> > ___
>> > juniper-nsp mailing list juniper-nsp@puck.nether.net 
>> > https://puck.nether.net/mailman/listinfo/juniper-nsp
>> >
>>
>>
>> --
>> ./diogo -montagner
>> JNCIE-SP 0x41A
>> ___
>> juniper-nsp mailing list juniper-nsp@puck.nether.net
>> https://puck.nether.net/mailman/listinfo/juniper-nsp
>
> ___
> juniper-nsp mailing list juniper-nsp@puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp
> 

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] srx event-options

2013-03-18 Thread Alex Arseniev

The OP has already tried it with the event-script but did not tell us :-)
http://forums.juniper.net/t5/Junos-Automation-Scripting/disable-interface-slax-script-not-running-not-configured/td-p/183237
I provided him with final hints and he should be able to use the script as 
published - or maybe after changing the interface name in the script itself.

Thanks
Alex


- Original Message - 
From: "Brian Johnson" 
To: "Diogo Montagner" ; "Luca Salvatore" 


Cc: 
Sent: Monday, March 18, 2013 1:28 PM
Subject: Re: [j-nsp] srx event-options



Diogo,

I believe he is shutting down his external interface when a neighbor on 
the internal interface is down.


Alex: This script looks interesting and I'd like to see the final solution 
when you get it.


Thanks.

- Brian



-Original Message-
From: juniper-nsp-boun...@puck.nether.net [mailto:juniper-nsp-
boun...@puck.nether.net] On Behalf Of Diogo Montagner
Sent: Monday, March 18, 2013 7:25 AM
To: Luca Salvatore
Cc: juniper-nsp@puck.nether.net
Subject: Re: [j-nsp] srx event-options

I think you need to review your logic. How do you expect the OSPF 
adjacency

to come up if you have shutdown the interface ?

On Monday, 18 March 2013, Luca Salvatore wrote:

> I'm playing around with some event-options on a SRX.  I'm trying to 
> make
> the SRX shutdown an interface when a specific OSPF neighbour is 
> detected

as
> down, then bring the interface back up once OSPF has re-established.
>
>
> I have this:
>
> [edit event-options]
> lsalvatore@FWL001# show
> policy shutdown_internet_if_core_down {
> events rpd_ospf_nbrdown;
> attributes-match {
> rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
> }
> then {
> execute-commands {
> commands {
> "set interface ge-0/0/3 disable";
> commit;
> }
> }
> }
> }
> policy bring_up_internet_when_core_is_back {
> events rpd_ospf_nbrup;
> attributes-match {
> rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
> }
> then {
> execute-commands {
> commands {
> "delete interface ge-0/0/3 disable";
> commit;
> }
> }
>
> Should this work?  I haven't been able to test it yet but it seems like 
> it

> may do what I need.
> Luca
>
> ___
> juniper-nsp mailing list juniper-nsp@puck.nether.net 
> https://puck.nether.net/mailman/listinfo/juniper-nsp
>


--
./diogo -montagner
JNCIE-SP 0x41A
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp



___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] srx event-options

2013-03-18 Thread Brian Johnson
Diogo,

I believe he is shutting down his external interface when a neighbor on the 
internal interface is down.

Alex: This script looks interesting and I'd like to see the final solution when 
you get it.

Thanks.

- Brian


> -Original Message-
> From: juniper-nsp-boun...@puck.nether.net [mailto:juniper-nsp-
> boun...@puck.nether.net] On Behalf Of Diogo Montagner
> Sent: Monday, March 18, 2013 7:25 AM
> To: Luca Salvatore
> Cc: juniper-nsp@puck.nether.net
> Subject: Re: [j-nsp] srx event-options
> 
> I think you need to review your logic. How do you expect the OSPF adjacency
> to come up if you have shutdown the interface ?
> 
> On Monday, 18 March 2013, Luca Salvatore wrote:
> 
> > I'm playing around with some event-options on a SRX.  I'm trying to make
> > the SRX shutdown an interface when a specific OSPF neighbour is detected
> as
> > down, then bring the interface back up once OSPF has re-established.
> >
> >
> > I have this:
> >
> > [edit event-options]
> > lsalvatore@FWL001# show
> > policy shutdown_internet_if_core_down {
> > events rpd_ospf_nbrdown;
> > attributes-match {
> > rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
> > }
> > then {
> > execute-commands {
> > commands {
> > "set interface ge-0/0/3 disable";
> > commit;
> > }
> > }
> > }
> > }
> > policy bring_up_internet_when_core_is_back {
> > events rpd_ospf_nbrup;
> > attributes-match {
> > rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
> > }
> > then {
> > execute-commands {
> > commands {
> > "delete interface ge-0/0/3 disable";
> > commit;
> > }
> > }
> >
> > Should this work?  I haven't been able to test it yet but it seems like it
> > may do what I need.
> > Luca
> >
> > ___
> > juniper-nsp mailing list juniper-nsp@puck.nether.net 
> > https://puck.nether.net/mailman/listinfo/juniper-nsp
> >
> 
> 
> --
> ./diogo -montagner
> JNCIE-SP 0x41A
> ___
> juniper-nsp mailing list juniper-nsp@puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] srx event-options

2013-03-18 Thread Diogo Montagner
I think you need to review your logic. How do you expect the OSPF adjacency
to come up if you have shutdown the interface ?

On Monday, 18 March 2013, Luca Salvatore wrote:

> I'm playing around with some event-options on a SRX.  I'm trying to make
> the SRX shutdown an interface when a specific OSPF neighbour is detected as
> down, then bring the interface back up once OSPF has re-established.
>
>
> I have this:
>
> [edit event-options]
> lsalvatore@FWL001# show
> policy shutdown_internet_if_core_down {
> events rpd_ospf_nbrdown;
> attributes-match {
> rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
> }
> then {
> execute-commands {
> commands {
> "set interface ge-0/0/3 disable";
> commit;
> }
> }
> }
> }
> policy bring_up_internet_when_core_is_back {
> events rpd_ospf_nbrup;
> attributes-match {
> rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
> }
> then {
> execute-commands {
> commands {
> "delete interface ge-0/0/3 disable";
> commit;
> }
> }
>
> Should this work?  I haven't been able to test it yet but it seems like it
> may do what I need.
> Luca
>
> ___
> juniper-nsp mailing list juniper-nsp@puck.nether.net 
> https://puck.nether.net/mailman/listinfo/juniper-nsp
>


-- 
./diogo -montagner
JNCIE-SP 0x41A
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] srx event-options

2013-03-18 Thread Alex Arseniev

This part won't work:
 execute-commands {
   commands {
   "set interface ge-0/0/3 disable";
   commit;

Same holds true for "delete interface disable".
You will need a commit script.
HTH
Thanks
Alex


- Original Message - 
From: "Luca Salvatore" 

To: 
Sent: Monday, March 18, 2013 4:56 AM
Subject: [j-nsp] srx event-options


I'm playing around with some event-options on a SRX.  I'm trying to make 
the SRX shutdown an interface when a specific OSPF neighbour is detected 
as down, then bring the interface back up once OSPF has re-established.



I have this:

[edit event-options]
lsalvatore@FWL001# show
policy shutdown_internet_if_core_down {
   events rpd_ospf_nbrdown;
   attributes-match {
   rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
   }
   then {
   execute-commands {
   commands {
   "set interface ge-0/0/3 disable";
   commit;
   }
   }
   }
}
policy bring_up_internet_when_core_is_back {
   events rpd_ospf_nbrup;
   attributes-match {
   rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
   }
   then {
   execute-commands {
   commands {
   "delete interface ge-0/0/3 disable";
   commit;
   }
   }

Should this work?  I haven't been able to test it yet but it seems like it 
may do what I need.

Luca

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp



___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


[j-nsp] srx event-options

2013-03-17 Thread Luca Salvatore
I'm playing around with some event-options on a SRX.  I'm trying to make the 
SRX shutdown an interface when a specific OSPF neighbour is detected as down, 
then bring the interface back up once OSPF has re-established.


I have this:

[edit event-options]
lsalvatore@FWL001# show
policy shutdown_internet_if_core_down {
events rpd_ospf_nbrdown;
attributes-match {
rpd_ospf_nbrdown.neighbor-address matches 10.255.255.86;
}
then {
execute-commands {
commands {
"set interface ge-0/0/3 disable";
commit;
}
}
}
}
policy bring_up_internet_when_core_is_back {
events rpd_ospf_nbrup;
attributes-match {
rpd_ospf_nbrup.neighbor-address matches 10.255.255.86;
}
then {
execute-commands {
commands {
"delete interface ge-0/0/3 disable";
commit;
}
}

Should this work?  I haven't been able to test it yet but it seems like it may 
do what I need.
Luca

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp