How to shorten too long interface names

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
KateWalker
Posts: 4
Joined: Sat Feb 24, 2018 2:41 pm

How to shorten too long interface names

Post by KateWalker »

Hello everyone!
I've made graphs for couple of HP switches, but interface names are too long
IF-MIB::ifName.1 = STRING: Ten-GigabitEthernet1/0/1
IF-MIB::ifName.2 = STRING: Ten-GigabitEthernet1/0/2
IF-MIB::ifName.3 = STRING: Ten-GigabitEthernet1/0/3
is it possible to make some kind of regexp in cacti that turn, for example, Bridge-Aggregation4 into BAGG4, GigabitEthernet1/0/25 into Gi1/0/25, Ten-GigabitEthernet1/0/2 into Te1/0/2, etc.?
P.S.: it's impossible to give short aliases to this interfaces, because it will disrupt work of some scripts.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to shorten too long interface names

Post by netniV »

Can you set the alias/description of the interface? That way you could use the alias instead of what you currently are?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
KateWalker
Posts: 4
Joined: Sat Feb 24, 2018 2:41 pm

Re: How to shorten too long interface names

Post by KateWalker »

netniV wrote:Can you set the alias/description of the interface? That way you could use the alias instead of what you currently are?
No, I can't use alias or descr of interface instead interface's name.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to shorten too long interface names

Post by netniV »

I would suggest opening an issue on the github repo (https://github.com/cacti/cacti/issues) and I'll add a suggestion I have in mind for this.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
KateWalker
Posts: 4
Joined: Sat Feb 24, 2018 2:41 pm

Re: How to shorten too long interface names

Post by KateWalker »

netniV wrote:I would suggest opening an issue on the github repo (https://github.com/cacti/cacti/issues) and I'll add a suggestion I have in mind for this.
https://github.com/Cacti/cacti/issues/1404
KateWalker
Posts: 4
Joined: Sat Feb 24, 2018 2:41 pm

Re: How to shorten too long interface names

Post by KateWalker »

I've added this template (it must take only 2 first letters of interface name and all last digits and "/"):
<ifNameHP>
<name>Name (IF-MIB)</name>
<method>walk</method>
<source>VALUE/REGEXP:^[A-Za-z]{2}|[0-9/]{1,7}$</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.31.1.1.1.1</oid>
</ifNameHP>
` to interface.xm, set name and title "|\|host_description\| - Unicast Packets - \|query_ifNameHP\|" for In/Out Unicast Packets in Data Queries, but nothing nad happened - titles for graphs are all the same.
dixitarjun
Posts: 4
Joined: Tue Feb 27, 2018 8:29 am

Re: How to shorten too long interface names

Post by dixitarjun »

I've already submitted a ticket on github repo but no responses :(
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to shorten too long interface names

Post by netniV »

Titles will remain the same until you update the suggested names. To do so, highlight the graphs you want to apply it to, and then click Apply Suggested names (or something similar .- not in front of my cacti right now)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest