Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Ben Dale
On 10 Sep 2014, at 11:32 am, Ben Dale bd...@comlinx.com.au wrote:

 Failing that, I just hacked up an op script to only show a summarised version 
 from each peer - output here:
 
 https://github.com/dfex/DFEXjunoscripts/blob/master/show-bgp-neat.md
 
 Code here:
 
 https://github.com/dfex/DFEXjunoscripts/blob/master/show-bgp-neat.slax
 
 The script *should* sum all the prefixes from each RIB into a single 
 summarised number per peer, but I haven't had a chance to test it too 
 thoroughly yet.  Feedback/Pull Requests welcome.
 

Okay, looks like I managed to upload an incomplete non-working script instead 
of the one I was actually testing on my router.  

Thanks to those who pointed this out!

Corrected version is now up on Github - tested on SRX, ACX and MX (all single 
RE) 

Hey Phil, when can we have git native in Junos?!  ; )


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


Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Phil Shafer
Ben Dale writes:
 https://github.com/dfex/DFEXjunoscripts/blob/master/show-bgp-neat.slax

Very cool!

Hey Phil, when can we have git native in Junos?!  ; )

How about:

op url 
https://raw.githubusercontent.com/dfex/DFEXjunoscripts/master/show-bgp-neat.slax

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


[j-nsp] juniper traffic policer/shapping

2014-09-22 Thread Dennis Bernic
Hi all,
Is it possible on Junos (mx-80) to assign a policer/shapper on different
interfaces logical/phisical
no matter , so that this policer would work in aggregated mode, so that we
had a common limit for  traffic going through these interfaces?

Let's say the policer limits traffic to 100mbps. We need a particular
traffic to respect this policer
no matter on what interface it is coming.

Is it possible to place the policer on the entire vrf?

Thank you .


-- 
Dennis Bernic
CCNP, Ip Network Engineer
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] juniper traffic policer/shapping

2014-09-22 Thread sthaug
 Is it possible on Junos (mx-80) to assign a policer/shapper on different
 interfaces logical/phisical
 no matter , so that this policer would work in aggregated mode, so that we
 had a common limit for  traffic going through these interfaces?

You can gather subinterfaces under one physical interface into an
interface-set, which can be policed/shaped as a unit. See for
instance

http://www.juniper.net/techpubs/en_US/junos12.3/topics/usage-guidelines/cos-configuring-interface-sets.html

As far as I know this doesn't work across several physical interfaces.

Steinar Haug, Nethelp consulting, sth...@nethelp.no
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Eugeniu Patrascu
On Mon, Sep 22, 2014 at 4:24 PM, Phil Shafer p...@juniper.net wrote:

 Ben Dale writes:
  https://github.com/dfex/DFEXjunoscripts/blob/master/show-bgp-neat.slax

 Very cool!

 Hey Phil, when can we have git native in Junos?!  ; )

 How about:

 op url
 https://raw.githubusercontent.com/dfex/DFEXjunoscripts/master/show-bgp-neat.slax


--- JUNOS 12.1X44-D35.5 built 2014-05-19 22:11:33 UTC

 op url
https://raw.githubusercontent.com/dfex/DFEXjunoscripts/master/show-bgp-neat.slax


error: ^


error:
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax:35:
error:
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax:34:
parse error, unexpected T_BARE before 'set':


error: ^


error: error:
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax:
2 errors detected during parsing


error: error reading stylesheet:
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax


error:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax:31:
error:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax:30:
parse error, unexpected T_BARE before 'mvar':

error: ^

error:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax:35:
error:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax:34:
parse error, unexpected T_BARE before 'set':

error: ^

error: error:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax:
2 errors detected during parsing

error: error reading stylesheet:
/var/tmp/tmp_op3U0IX1/...transferring.file.ZOzdCd/show-bgp-neat.slax


Any idea how to fix this?

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


Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Ben Dale


On 23 Sep 2014, at 5:57 am, Eugeniu Patrascu 
eu...@imacandi.netmailto:eu...@imacandi.net wrote:

On Mon, Sep 22, 2014 at 4:24 PM, Phil Shafer 
p...@juniper.netmailto:p...@juniper.net wrote:
Ben Dale writes:
 https://github.com/dfex/DFEXjunoscripts/blob/master/show-bgp-neat.slax

Very cool!

Hey Phil, when can we have git native in Junos?!  ; )

How about:

op url 
https://raw.githubusercontent.com/dfex/DFEXjunoscripts/master/show-bgp-neat.slax



--- JUNOS 12.1X44-D35.5 built 2014-05-19 22:11:33 UTC

 op url 
 https://raw.githubusercontent.com/dfex/DFEXjunoscripts/master/show-bgp-neat.slax

error: ^


error: 
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax:35:
 error: 
/var/tmp/tmp_opzhxmSf/...transferring.file.DdJl9A/show-bgp-neat.slax:34:
 parse error, unexpected T_BARE before 'set':

SNIP

Okay, one small caveat to this script - it looks like the use of mutable 
variables (mvar and set) was only introduced in SLAX 1.1 / Junos 12.2, so it's 
actually not going to work on older versions of Junos.

I know 11.4 is the trusted choice for most people on MX at the moment, so when 
I get some time I'll attempt a mind-bending re-write using the older immutable 
var format.

Stay tuned, and thanks again for all the direct feedback!

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


Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Phil Shafer
Ben Dale writes:
Okay, one small caveat to this script - it looks like the use of mutable 
variables (mvar
 and set) was only introduced in SLAX 1.1 / Junos 12.2, so it's actually not 
 going to wo
rk on older versions of Junos.

I know 11.4 is the trusted choice for most people on MX at the moment, so when 
I get som
e time I'll attempt a mind-bending re-write using the older immutable var 
format.

In this case, you don't need the mvars.  Let sum() do the iteration:

for-each ($neighbour-list/bgp-peer) {
output jcs:printf(%-20s%-15s%-12s%-10s%-10s%-10s%-10s%-5s,
peer-address,
peer-as,
peer-state,
elapsed-time,
sum(bgp-rib/active-prefix-count),
sum(bgp-rib/received-prefix-count),
sum(bgp-rib/accepted-prefix-count),
description);   
}

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


Re: [j-nsp] BGP Peer formatting

2014-09-22 Thread Ben Dale

On 23 Sep 2014, at 1:48 pm, Phil Shafer p...@juniper.net wrote:

 Ben Dale writes:
 Okay, one small caveat to this script - it looks like the use of mutable 
 variables (mvar
 and set) was only introduced in SLAX 1.1 / Junos 12.2, so it's actually not 
 going to wo
 rk on older versions of Junos.
 
 I know 11.4 is the trusted choice for most people on MX at the moment, so 
 when I get som
 e time I'll attempt a mind-bending re-write using the older immutable var 
 format.
 
 In this case, you don't need the mvars.  Let sum() do the iteration:
 
for-each ($neighbour-list/bgp-peer) {
output jcs:printf(%-20s%-15s%-12s%-10s%-10s%-10s%-10s%-5s,
peer-address,
peer-as,
peer-state,
elapsed-time,
   sum(bgp-rib/active-prefix-count),
   sum(bgp-rib/received-prefix-count),
   sum(bgp-rib/accepted-prefix-count),
description);   
}
 
 Thanks,
 Phil

Love your work Phil : )

That's a heck of a lot simpler/cleaner than the recursive monstrosity I've been 
putting together!

Changes have been pulled into github, so if you're running 11.4 or earlier, 
give it another try now.

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