Giter Site home page Giter Site logo

Comments (6)

vsr2158 avatar vsr2158 commented on May 31, 2024

Okay. I came across this "full xpath expressions do not seem to be supported #39" and understand the issue.. Let me try the workaround to use rfc-compliant netconf.

from open-nti.

 avatar commented on May 31, 2024

Did the workaround work? could you share it with me :) ?

from open-nti.

rpetracic avatar rpetracic commented on May 31, 2024

Did someone find a solution for this? Still not working correctly. From the logs it is obvious show-interfaces-media parser is not ok...used a workaround like this for now:
parser:
regex-command: show\s+interfaces\s+media\s+ae1\s+|\s+display\s+xml
matches:
-
type: single-value
method: xpath
xpath: //*[local-name() = 'physical-interface']/traffic-statistics/input-bps
variable-name: $host.interfaces.ae1.input-bps

from open-nti.

3fr61n avatar 3fr61n commented on May 31, 2024

Hi @rpetracic

The problem is the xpath expression when there are namespaces, could you please try this parser?

juniper@naraku:~/scripts/upgrade-grafana/open-nti$ cat data/junos_parsers/show-interfaces-media.parser.yaml 
parser:
    regex-command: show\s+interfaces\s+media\s+\|\s+display\s+xml
    matches:
    -
        type: multi-value
        method: xpath
        xpath: //*[local-name() = 'physical-interface']
        loop:
            key: ./*[local-name() = 'name']
            sub-matches:
            -
                xpath: ./*[local-name() = 'traffic-statistics']/*[local-name() = 'input-bps']
                variable-name:  $host.interface.$key.input-bps



juniper@naraku:~/scripts/upgrade-grafana/open-nti$ make cli
docker exec -i -t opennti_con /bin/bash
root@59e1645fc9a0:/# python /opt/open-nti/open-nti.py -c -s --tag test
Collector Thread-1 scheduled with following hosts: ['172.30.137.140']
Connecting to host: 172.30.137.140
[172.30.137.140]: Executing command: show version | display xml
[172.30.137.140]: Host will now be referenced as : PE1-tf-m320-1-re1
[PE1-tf-m320-1-re1]: Executing command: show interfaces media | display xml
[PE1-tf-m320-1-re1]: Parser found and processed, going to next comand.
[PE1-tf-m320-1-re1]: timestamp_tracking - CLI collection 5
Inserting into database the following datapoints:
[{'fields': {'delta_str': 'N/A', 'value_str': 'm320'},
  'measurement': 'base-info',
  'tags': {'device': 'PE1-tf-m320-1-re1',
           'kpi': 'base-info',
           'product-model': 'm320',
           'version': '13.3R9-S2.1'}},
 {'fields': {'delta': 0, 'value': 0},
  'measurement': 'PE1-tf-m320-1-re1.interface.gr-0/0/0.input-bps',
  'tags': {'device': 'PE1-tf-m320-1-re1',
           'key': 'gr-0/0/0',
           'kpi': 'PE1-tf-m320-1-re1.interface.gr-0/0/0.input-bps',
           'product-model': 'm320',
           'version': '13.3R9-S2.1'}},
 {'fields': {'delta': 0, 'value': 0},
  'measurement': 'PE1-tf-m320-1-re1.interface.ip-0/0/0.input-bps',
  'tags': {'device': 'PE1-tf-m320-1-re1',
           'key': 'ip-0/0/0',
           'kpi': 'PE1-tf-m320-1-re1.interface.ip-0/0/0.input-bps',
           'product-model': 'm320',
           'version': '13.3R9-S2.1'}},
 {'fields': {'delta': 0, 'value': 0},
.....

Regards
Efrain

from open-nti.

rpetracic avatar rpetracic commented on May 31, 2024

Thanks Efrain, this is working now. I wonder if there is an easy way to get graphs for all interfaces from one device in Grafana or they have to be added one by one.

from open-nti.

3fr61n avatar 3fr61n commented on May 31, 2024

If you don't mind I open a new issue to talk about it

from open-nti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.