Coder Social home page Coder Social logo

Comments (10)

toni-moreno avatar toni-moreno commented on July 22, 2024

Hello @Naumis1 .

I can not understand why are you indexing by .1.3.6.1.2.1.2.2.1.1 (ifIndex) if you can index by the description (ifDesc) ".1.3.6.1.2.1.2.2.1.2"
As you can see in the following example: https://github.com/toni-moreno/snmpcollector/wiki/Example:-Configuring-Cisco-Catalyst-Switch

You can configure you measurement with indexOID .1.3.6.1.2.1.2.2.1.2 and you can name it as "portName" ,

image

And add all other defined metrics from the Iftable : Example for configure

image

image

Obviously you should create all these SnmpMetrics from the table (https://www.alvestrand.no/objectid/1.3.6.1.2.1.2.2.1.html) and also these other special "STRINGEVAL" if you need it.

hope this can help you

from snmpcollector.

Naumis1 avatar Naumis1 commented on July 22, 2024

For me it does not matter if I do indexing by ifDescr or with ifIndex. I am trying to map port names to manufacturer and model specific ones. e.g 1/0/1, 1/1, 1:1 or just 1. I am doing it so, in order to fit snmpcollector in to exsisting infrastructure. I noticed something interesting here: snmpcollector/conf/lp_file_filter_a.txt. But still can't get it working.

from snmpcollector.

toni-moreno avatar toni-moreno commented on July 22, 2024

Of course you can use the file filters also

But I thought that you had manufacturer port names at "ifDescr". ( it should be standard at SNMP MIB-2 definitions in most of routers and switches)

Anyway. Could you please show us the output from snmpwalk .1.3.6.1.2.1.2.2.1.2 please ?

If you need only a bit of the full response you can use STRINGPARSER metric type to preprocess the response before sent to the backend

from snmpcollector.

Naumis1 avatar Naumis1 commented on July 22, 2024

If you need only a bit of the full response you can use STRINGPARSER metric type to preprocess the response before sent to the backend

Yes i thought about that, but problem, is that I have ~25K different brand and model switches. Mostly D-Link and TP-Link. For example:
TP-link looks good: IF-MIB::ifDescr.49153 = STRING: gigabitEthernet 1/0/1 : copper ---> 1/0/1
D-Link looks not so good: IF-MIB::ifDescr.1 = STRING: D-Link DES-3200-28 R1.89 Port 1 ---> (should be 1/1)
Other D-link: IF-MIB::ifDescr.2 = STRING: D-Link DGS-3000-28SC R5.10.B00 Port 2 on Unit 1 ----> (should be 1:2)

These are quite good examples, So port mapping is the solution for me.

Of course you can use the file filters also

Could you tell here a bit more?

from snmpcollector.

toni-moreno avatar toni-moreno commented on July 22, 2024

Not sure that port mapping will be the best solution for you. File filter has been designed for really edge cases and each file should fit only one device ( not easily maintainable)

In most of our customers we have designed different configurention templates ( measurement groups) for each manufacturer/model and deployed configurarions for hundreds of devices using the snmpcollector API choosing for each device its specific config template.

And , not sure but I think you would be able to look for the appropiate regular expresion for TP-Link and different regexp for D-Link.

If you need a more specific solution we can offer you advanced consultancy for your use case and also custom features develop as part of our commerial support.

Hope these tips could help you.

from snmpcollector.

Naumis1 avatar Naumis1 commented on July 22, 2024

But as I see from webgui it looks like Custom Filters is one filter per device and Measurement Filters with filter type "file" is for multi devices. Am I wrong?

Thanks!

from snmpcollector.

toni-moreno avatar toni-moreno commented on July 22, 2024

Both type of filters could be shared among different devices.

But if I'm not wrong, you could add in this file, one config line per interface for all possible strings in different manufacturer/model ( hundreds or perhaps thousands of different config lines) that you could of course use in all devices.

In my previous approach only one regular expression per manufacturer/model ( perhaps 15/20/30 different regexp ?) It depends on the all existing IfDesc responses

from snmpcollector.

Naumis1 avatar Naumis1 commented on July 22, 2024

Could you please give an example how would regexp look like from my pasted examples?

TP-link looks good: IF-MIB::ifDescr.49153 = STRING: gigabitEthernet 1/0/1 : copper ---> 1/0/1
D-Link looks not so good: IF-MIB::ifDescr.1 = STRING: D-Link DES-3200-28 R1.89 Port 1 ---> (should be 1/1)
Other D-link: IF-MIB::ifDescr.2 = STRING: D-Link DGS-3000-28SC R5.10.B00 Port 2 on Unit 1 ----> (should be 1:2)

from snmpcollector.

sbengo avatar sbengo commented on July 22, 2024

Hi @Naumis1 ,

As @toni-moreno is proposing, I would create a single regex for each kind of device, for all type of interface responses.
I would recommend you to set test the output of ifName query:

Example response ifName query (1.3.6.1.2.1.31.1.1.1.1) over an  DGS-1510-20 Gigabit Ethernet SmartPro Switch

OID | Type | Value
-- | -- | --
.1.3.6.1.2.1.31.1.1.1.1.1 | OctetString | eth1/0/1
.1.3.6.1.2.1.31.1.1.1.1.2 | OctetString | eth1/0/2
.1.3.6.1.2.1.31.1.1.1.1.3 | OctetString | eth1/0/3
...

Following your example:

TP-link looks good: IF-MIB::ifDescr.49153 = STRING: gigabitEthernet 1/0/1 : copper ---> 1/0/1
^\w+ (.*) : .*$ --> $1 capture group will contain 1/0/1
> Model DGS-3000
D-Link looks not so good: IF-MIB::ifDescr.1 = STRING: D-Link DES-3200-28 R1.89 Port 1 ---> (should be 1/1)
.*Port (\d+) --> $1 and set the first index? 
> Model DGS-3200
Other D-link: IF-MIB::ifDescr.2 = STRING: D-Link DGS-3000-28SC R5.10.B00 Port 2 on Unit 1 ----> (should be 1:2)
.*Port (\d+) on Unit (\d+) --> $1 and $2 will contain required info

from snmpcollector.

toni-moreno avatar toni-moreno commented on July 22, 2024

Hello @Naumis1 We hope you can continue working with snmpcollector with all our previous suggestions . If thera are not any update in next hours we will close this issue.
Thank you.

from snmpcollector.

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.