Improve the "power" of REGEXPs in Data Queries

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Improve the "power" of REGEXPs in Data Queries

Post by twelzy »

Hi everybody!

Many of the Graph Templates that I developed on my Cacti server had to use Script Queries.
That's because with SNMP Queries isn't possible to match more than one value in the <source> field, or because isn't possible to replace one (or more) matched value by another value in the <source> field!

I think that would be great if Cacti have some kind of "VALUE/REGEXP_REPLACE" option in the <source> field!
And it would be great too if using "VALUE/REGEXP" we have the possibility to match more than one value in the <source> field!

Thanks in advance!
(And sorry for my poor English...)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

May you please post an example?
Reinhard
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Post by twelzy »

Hi lvm!

Revisiting my post, I think that another kind of regexp would be a great addition: some kind of "VALUE/REGEXP" in the <oid_index_parse> field!

I work in a VERY BIG Telco/Service Provider in Brazil.
The ifAlias of (almost) all of our equipments is standardized with some mandatory and optional fields.
We need:
  • - "VALUE/REGEXP" in the <oid_index_parse> field,
    - "VALUE/REGEXP" in the <source> field, with the possibility to match more than one value
    - "VALUE/REGEXP_REPLACE" in the <source> field, with the possibility to match and replace more than one value,
I will try to give you some examples:
Example 1: Internet Links in our Border Routers

We have 2 kinds of agreements in our Internet Links: transit and peering links.
And we classify these links in 2 categories: national and international links.
These classifications are shortened in the ifAlias as following:
  • (TRANS|PEER)_(NAC|INTL)_.*
We have here 2 input fields: AGGREMENT and NATIONALITY.
So we need to match and replace:
  • TRANS by Transit, in the AGGREMENT input field;
    PEER by Peering, in the AGGREMENT input field;
    NAC by National, in the NATIONALITY input field;
    INTL by International, in the NATIONALITY input field,
respectively!
In this case, we need a "VALUE/REGEXP_REPLACE" in the <source> field, with the possibility to match and replace more than one value!

And if we want to make a Data/Graph template that will list only these Internet links of our Border Routers, we need a "VALUE/REGEXP" in the <oid_index_parse> field, that matches only the ifAlias that begin with (TRANS|PEER)!
Thanks in advance!
(And sorry for my poor English...)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests