Instance Discovery Filter Script - and display name
-
hi guys and girls,
bit of a question I have about setting the display name based of another SNMP query the data is as follows1.3.6.1.4.1.14988.1.1.19.1.1.2.11 [STRING] = sfp11 1.3.6.1.4.1.14988.1.1.19.1.1.2.12 [STRING] = sfp12 1.3.6.1.4.1.14988.1.1.19.1.1.3.11 [INTEGER] = 0 1.3.6.1.4.1.14988.1.1.19.1.1.3.12 [INTEGER] = 1 1.3.6.1.4.1.14988.1.1.19.1.1.4.11 [INTEGER] = 0 1.3.6.1.4.1.14988.1.1.19.1.1.4.12 [INTEGER] = 0 1.3.6.1.4.1.14988.1.1.19.1.1.5.11 [GAUGE32] = 131000 1.3.6.1.4.1.14988.1.1.19.1.1.5.12 [GAUGE32] = 85000 1.3.6.1.4.1.14988.1.1.19.1.1.6.11 [GAUGE32] = 30 1.3.6.1.4.1.14988.1.1.19.1.1.6.12 [GAUGE32] = 41 1.3.6.1.4.1.14988.1.1.19.1.1.7.11 [GAUGE32] = 3290 1.3.6.1.4.1.14988.1.1.19.1.1.7.12 [GAUGE32] = 3256 1.3.6.1.4.1.14988.1.1.19.1.1.8.11 [GAUGE32] = 17 1.3.6.1.4.1.14988.1.1.19.1.1.8.12 [GAUGE32] = 4 1.3.6.1.4.1.14988.1.1.19.1.1.9.11 [INTEGER] = -5468 1.3.6.1.4.1.14988.1.1.19.1.1.9.12 [INTEGER] = -6800 1.3.6.1.4.1.14988.1.1.19.1.1.10.11 [INTEGER] = -1407 1.3.6.1.4.1.14988.1.1.19.1.1.10.12 [INTEGER] = 0I have tried this to get something but all I get is an error: Minor netxms1 SYS_SCRIPT_ERROR Script (DCI::TheDevice::8963::InstanceFilter) execution error: Error 15 in line 1: Unknown object's attribute
dd = $node.createSNMPTransport()?.getValue(".1.3.6.1.4.1.14988.1.1.19.1.1.2.".$1); if(dd!=NULL) { return [true, $1, dd]; } return [true, $1, $1];if I try getting the data via a seperate script and replace $node with the device it works any help would be great im new to Netxms and Scripting.
Thanks
Rhodri


-
right after a bit of digging and feeling like a total tit..
It turns out I was missing a . from the Concatenation operator simple mistake so this now seems to work
getoid = ".1.3.6.1.4.1.14988.1.1.19.1.1.2."; instance = $1; walk = $node.createSNMPTransport()?.getValue(getoid .. instance); if(walk == NULL) { walk = $1; } return [true, instance, walk];and this now effects the {instance-name} as intended.
hope it helps someone in the future!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login