Skip to content

Instantly share code, notes, and snippets.

@jazzl0ver
Last active April 7, 2016 14:06
Show Gist options
  • Save jazzl0ver/63888c4dde543925ad99 to your computer and use it in GitHub Desktop.
Save jazzl0ver/63888c4dde543925ad99 to your computer and use it in GitHub Desktop.
Adds VLAN information to MRTG title for Cisco switches
--- cfgmaker.ORG 2012-11-12 06:44:43.000000000 -0500
+++ cfgmaker 2016-03-24 12:29:08.318018921 -0400
@@ -691,7 +691,9 @@
"$$i{Descr} $$i{ifAlias} $$i{CiscolocIfDescr}";
last};
/^name$/ && do {$if_title_desc = "#".$$i{Name} if $$i{Name}; last};
- /^catname$/ && do {$if_title_desc = "$if_port_name"; last};
+ /^catname$/ && do {$if_title_desc = "$if_port_name"." (".$$i{Name}.
+ ($$i{vmVlan} ? " - VLAN ".$$i{vmVlan} : " - dot1q")
+ .")"; last};
/^ppname$/ && do {$if_title_desc = "$if_pp_port_name"; last};
/^type$/ && do {$if_title_desc = "%".$$i{Type} if $$i{Type}; last};
/^nr$/ && do {$if_title_desc = "Interface $ifindex"; last};
@jazzl0ver
Copy link
Author

use --ifdescr=catname cfgmaker's command line option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment