Junos Automation (Scripting)
Junos Automation (Scripting)

Open-NTI How to get tx rx in Mbps for multiple interfaces

08.29.17   |  
‎08-29-2017 09:04 PM

Not quite the correct area, so mods move if you need to.


Im using Open-NTI and my main aim is to get RX and TX on Ge0/0/2 and ge0/0/6 in mbps from an SRX. Ideally i would have it end up with a stacked graph to give the total bandwidth for the site, while seeing it split 4x ways with TX and RX for each segment.


I followed the lldp stats tutorial so once I have the Junos command I should be able to get it into the parser then DB fine. Any tips on the grafana query would be appreciated though.

Junos Automation (Scripting)

Re: Open-NTI How to get tx rx in Mbps for multiple interfaces

[ Edited ]
09.11.17   |  
‎09-11-2017 08:41 PM

Ok, so I can see the bps rate in 

show interfaces statistics ge-0/0/0 | display xml

And the response in part is:

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.1X46/junos">
    <interface-information xmlns="http://xml.juniper.net/junos/12.1X46/junos-interface" junos:style="normal">
            <admin-status junos:format="Enabled">up</admin-status>
            <interface-flapped junos:seconds="13448072">2017-04-09 10:18:19 UTC (22w1d 15:34 ago)</interface-flapped>
            <traffic-statistics junos:style="brief">

I can see the input-bps and output-bps so now I just need to construct the Parser. This is what I have so far:

    regex-command: show\s+lldp\s+statistics\s+ge-0/0/0\s+\|\s+display\s+xml
        type: multi-value
        method: xpath
        xpath: //physical-interface/
            key: ./name
                xpath: ./traffic-statistics junos:style="brief"/input-bps
                variable-name:  $host.bandwidth.$key.input-bps
                xpath: ./traffic-statistics junos:style="brief"/output-bps
                variable-name:  $host.bandwidth.$key.output-bps

So any ideas if this will work or where I will see errors if it doesnt?