Is it possible to display interface alias in title of graphs?

Started by ckenny, April 14, 2016, 07:36:58 AM

Previous topic - Next topic

ckenny

Hi there,

I've gone over the docs and searched the forum, but cannot find much info regarding the use of interface aliases.  Can someone please help?

I have instance discovery working and I'm getting the instance names Fa0/1, Fa0/2, etc.  These are being displayed correctly in the performance tab by using: Interface {instance} in the title.  However, I was hoping to include the interface alias as well.  I've enabled UseInterfaceAliases=3 and I now see the interface name + alias combined, ie: Gi0/1 (Core Uplink)  Is there some way to get both these values into the title of graph and/or in the performance tab?


Thanks,
Charles

Victor Kirhenshtein

Hi,

{instance} will be replaced with whatever is set as instance in DCI configuration. If you create DCIs using network discovery you can use filtering script to amend instance names as needed (there should be examples on the forum).

Best regards,
Victor

ckenny

Hi Victor,
Thanks for your help.  It's greatly appreciated.
I've found reference to Aliases showing up in the "Interfaces" tab, however I'm not sure how to utilize that data in a graph.

Currently I'm using the following DCI settings:

Parameter: .1.3.6.1.2.1.31.1.1.1.6.{instance}
Base OID:   .1.3.6.1.2.1.31.1.1.1.1

The aliases are located at .1.3.6.1.2.1.31.1.1.1.18
If I'm already using {instance} to poll "bit/s IN", how can I also use {instance} to poll the "Aliases" within the same DCI?  Or do I have to set the Parameter to be 1 level higher and then use a script to sort through the massive data that is returned?

Thanks,
Charles

ckenny

Ok, I think I get it now.  Please confirm if I'm on the right track.  I need to use the instance filter script to manually poll the interface Alias, combine the result with $2 (Fa0/1, Fa0/2, etc.) and return that... ie. return %(true, $1, $combinedresult);

ckenny

Ok, so I finally got this working.  Here's the code I used in case it can help someone else:

// filter out interfaces
if ($2 == "Nu0" || $2 == "Vl1" || $2 == "Vl100")
return false;

snmp = CreateSNMPTransport($node);

if (snmp == null)
return -1;

ifAlias = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.18." . $1);

if (ifAlias != "")
   $2 = $2 . " - " . ifAlias;
   
// trace(0, "Newname is ". $2);

return %(true, $1, $2);