I've tried, but can't seem to find a way to use the interface alias as collected by Cacti as the label on a node, I was thinking this would work, but didn't
LABEL {node:this:alias}
Is there a way?
(Maybe a way to limit the number of characters displayed (concat it) would be ace too!
Using the Alias (IF-MIB) in a LABEL
Moderators: Developers, Moderators
Re: Using the Alias (IF-MIB) in a LABEL
Hello,
Using this code :
NODE link-ra-gi2
LABEL {node:this:snmp_in_raw}
LABELOFFSET E
LABELOUTLINECOLOR none
TARGET snmp:{node:this:community}:{node:this:ip}:.1.3.6.1.2.1.31.1.1.1.18.{node:this:interface}:-
POSITION 660 443
SET community test
SET ip 172.25.232.33
SET interface 3
Will graph the description you have on that specified interface. I think is what you want.
Using this code :
NODE link-ra-gi2
LABEL {node:this:snmp_in_raw}
LABELOFFSET E
LABELOUTLINECOLOR none
TARGET snmp:{node:this:community}:{node:this:ip}:.1.3.6.1.2.1.31.1.1.1.18.{node:this:interface}:-
POSITION 660 443
SET community test
SET ip 172.25.232.33
SET interface 3
Will graph the description you have on that specified interface. I think is what you want.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Using the Alias (IF-MIB) in a LABEL
Or, if you are already using cacti traffic data for that interface in your map (e.g. for a link connected to this node), then you can either use the dsstats: plugin or enable poller_output support ("SET rrd_use_poller_output 1" at the top of the map file). Both of those take a couple of polls to get going, but after that they will automatically populate a bunch of data as new variables, taken from the Cacti snmp cache.
In theory, it should run a bit faster than reading rrd files the normal way, too.
There's more description of the variables and poller_output mode in the manual:
http://network-weathermap.com/manual/0. ... s.html#rrd
So after that, you'd be able to use:
LABEL {link:relatedlinkname:cacti_ifAlias}
where relatedlinkname is the link that is using the traffic stats for the relevant interface.
In theory, it should run a bit faster than reading rrd files the normal way, too.
There's more description of the variables and poller_output mode in the manual:
http://network-weathermap.com/manual/0. ... s.html#rrd
So after that, you'd be able to use:
LABEL {link:relatedlinkname:cacti_ifAlias}
where relatedlinkname is the link that is using the traffic stats for the relevant interface.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Using the Alias (IF-MIB) in a LABEL
Thanks Howie, LABEL {link:relatedlinkname:cacti_ifAlias} is what I was after!
Is there a way con concat the string so as to make it a fixed number of characters long?
Is there a way con concat the string so as to make it a fixed number of characters long?
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Using the Alias (IF-MIB) in a LABEL
The formatting bit on the end, that is normally used for numbers, is passed straight through to PHP's sprintf() function, if it's not for %k or %t. So you can use the stuff documented here. It's not very intuitive for strings, but I got this to work:
LABEL {node:this:blahblah:%-0.10s}
To get a left-justified string of 0-10 characters, padded with spaces.
LABEL {node:this:blahblah:%-0.10s}
To get a left-justified string of 0-10 characters, padded with spaces.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Who is online
Users browsing this forum: No registered users and 5 guests