Ok, so I finally got this working. Here's the code I used in case it can help someone else:
Code Select
// 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);