Difference between revisions of "User talk:Pavels Gurskis"

Jump to navigation Jump to search
1,425 bytes added ,  15:35, 23 December 2014
no edit summary
 
(5 intermediate revisions by the same user not shown)
Line 18: Line 18:


PS: This might require entering command in interface (rather than global) context.
PS: This might require entering command in interface (rather than global) context.
PPS: Not sure if works everywhere... '''write mib-data''' might be needed as well
=== SNMP Instance Discovery ===
Let's say we want to collect status of all interfaces on a node.
Put OID of interest in "Parameter" field on "General" tab with {instance} suffix (.1.3.6.1.2.1.2.2.1.8.{instance}).
Put something meaningful in "Description" filed on "General" tab, use {instance-name} macro to make this human-readable ("Interface status ({instance-name})").
Go to "Instance Discovery" tab.
Pick "SNMP Walk - Values" as discovery method.
Pick proper base OID as described in [[Creating SNMP table DCI]] (.1.3.6.1.2.1.2.2.1.1).
Add instance discovery filter script:
snmp = CreateSNMPTransport($node);
ifName = SNMPGetValue(snmp,".1.3.6.1.2.1.2.2.1.2." . $1);
ifType = SNMPGetValue(snmp,".1.3.6.1.2.1.2.2.1.3." . $1);
return %((ifType==6), $1, ifName);
{instance-name} in "Description" filed will be replaced with 3rd parameter returned from the filter script (ifName in that case).


== Node interface ==
== Node interface ==
Line 38: Line 62:


Note, that different set of macros available for Activation and De-activation of alarms. For example, if you use unique DCI ID for alarm generation ('''%5'''), you should use different macro to de-activate this alarm ('''%3''')
Note, that different set of macros available for Activation and De-activation of alarms. For example, if you use unique DCI ID for alarm generation ('''%5'''), you should use different macro to de-activate this alarm ('''%3''')
== NXSL scripting ==
==== Referring scripts from Script Library ====
Calling scripts from Script Library:
myVariable=Name::In::Script::Library/functionName
==== Event Processing Policy ====
Calling Script Library scripts from Action in Event Processing Policy:
%[Name::In::Script::Library/functionName]
NB: you can not pass any parameters when calling scripts from EPP Actions, however you have access to $event and $node object

Navigation menu