Contents 

Overview
Fundamentals
Variable declaration
Variable assignment
Adding variables
Setting variables
Include function
Evaluate function
Constants
Arrays
If...then...else Statement
For Statement
Foreach Statement
While Statement
Function definition
Operators
Comments
Functions
String processing
Overview
Length
Left
Right
Mid
TrimLeft
TrimRight
ToUpper
ToLower
Find
ReverseFind
WildcardCompare
Tokenize
RegularExpressionMatch
RegularExpressionParse
Operator [ ]
Delete
Remove
Replace
File IO routines
Overview
ReadData
ReadDataToString
WriteData
ReadString
WriteString
AppendString
EOF
CloseFile
CreateDir
RemoveDir
ChangeDir
GetCurrentDir
IsFileExist
FileSize
CopyFile
MoveFile
RemoveFile
Seek
SeekToBegin
SeekToEnd
ListFiles
CountFilesInFolder
Time routines
Overview
Sleep
Millisleep
GetTime
GetTimeString
FormatTime
ConvertToUnixTime
GetTickCount
SNMP management
Overview
SnmpGet
SnmpGetNext
SnmpSet
GetPduErrorStatus
GetPduErrorString
GetPduErrorIndex
GetVarCount
GetVarAt
CreatePdu
AppendVar
GetVarOID
GetVarResolvedName
GetVarValue
GetVarResolvedValue
GetVarResolvedDescription
GetVarSyntax
CreateVar
GetPduIp
GetPduEnterprise
GetPduTrapCode
GetPduTrapName
GetPduResolvedTrapName
GetPduResolvedTrapDescription
GetPduCommunity
SendTrap
ForwardTrap
SNMP MIB functions
Overview
LoadMIB
ResolveOID
GetOidByName
ResolveTrap
UnloadMIB
XML processing
Overview
ReadXml
WriteXml
GetXmlTag
CreateXml
InsertAttr
IsXmlValid
SelectXmlNodes
GetAttrString
GetAttrInt
GetAttrDouble
GetXmlBody
SetXmlBody
AddChild
GetChildrenCount
GetChildAt
FTP functions
Overview
FtpOpen
FtpClose
FtpGetCurrentDir
FtpSetCurrentDir
FtpCreateDir
FtpRemoveDir
FtpGet
FtpPut
FtpRemoveFile
FtpRenameFile
FtpListFiles
FtpCountFilesInFolder
TFTP functions
Overview
TFTPGet
TFTPPut
TCP functions
Overview
HttpPing
HttpGet
OpenTCPConnection
OpenUDPSocket
SendTCPData
SendUDPData
IsDataAvailable
ReadTCPData
ReadUDPData
CloseSocket
GetHostByAddress
GetAddressByName
TestSMTPConnection
GetHostName
GetSocketName
TestPOP3Connection
POP3GetStats
POP3 Mail Client Example
Working with serial ports
Overview
OpenSerialPort
CloseSerialPort
IsSerialDataAvailable
ReadSerialData
WriteSerialData
Handling zip files
Overview
ZipFiles
UnzipFiles
AddFileToZip
RemoveFileFromZip
ListFilesInZip
UnzipFile
Mathematical routines
Overview
abs
acos
asin
atan
CalculateScaleFactor
cos
cosh
exp
IsNAN
log
log10
max
mod
pow
ScaleArray
sin
sinh
sqrt
tan
tanh
Charts
Overview
CreateGauge
CreatePieChart
CreateBarChart
CreateLineChart
CreateXYLineChart
Database Interface
Overview
DBOpen
DBClose
DBExecuteSQL
DBSelect
DBInsertSelect
DBGetSQLStatus
DBGetSQLErrorString
Round Robin Databases
Overview
RrdCreate
RrdUpdate
RrdRemove
RrdFetch
RrdGetCurrentValue
Event Log functions
Overview
EventLogGetNumberOfRecords
EventLogGetOldestRecord
EventLogReadRecord
EventLogWaitForEvent
EventLogWriteRecord
Service Control Manager
Overview
SCMEnumerateServices
SCMGetServiceInfo
SCMStartService
Parameter Files
Overview
GetParameterCount
GetParameterName
GetParameterType
GetParameterValue
GetParameterDisplayName
GetParameterDescription
Process management functions
Overview
FindProcess
GetProcesses
RedirectOpen
RedirectClose
RedirectGetStdOut
RedirectGetStdError
RedirectSendInput
WMI functions
Overview
WMIOpen
WMIClose
WMIQuery
WMIGetErrorStatus
Query functions
Overview
LDAPQuery
REGQuery
CSVQuery
TSVQuery
EventLogQuery
TextLineQuery
TextWordQuery
FSQuery
GetQueryStatus
GetQueryErrorString
Windows Networking
Overview
MapNetworkDrive
DisconnectNetworkDrive
Microsoft Outlook integration
Overview
OpenOutlookSession
CloseOutlookSession
OutlookSendMail
OutlookSendMeetingRequest
OutlookCreateTask
Other routines
Overview
Println
MessageBox
ToString
ToInteger
ToDouble
ToChar
ToByte
GetEnv
GetArraySize
Beep
GetArrayIndex
GetNetDecisionSystemDir
IsArrayElementExist
Ping
SendMail
SendHtmlMail
ExecuteCommand
PlaySound
TextToSpeech
SendSMS
Rand

NetDecision Script Language Reference

Prev Page Next Page

SnmpGet

snmppdu SnmpGet(string ipAddress, string community, intretries, inttimeout,  snmppdupdu)

snmppdu SnmpGet(string ipAddress, string community, intretries, inttimeout,  snmppdupdu, int version)

snmppdu SnmpGet(string ipAddress, intretries, inttimeout, snmppdupdu, int securityLevel, string userName, string contextName)

snmppdu SnmpGet(string ipAddress, intretries, inttimeout, snmppdupdu, int securityLevel, string userName, string contextName, int authProtocol, string authPassword)

snmppdu SnmpGet(string ipAddress, intretries, inttimeout, snmppdupdu, int securityLevel, string userName, string contextName, int authProtocol, string authPassword, int privProtocol, string privPassword)

Return Value

Returns a response SNMP PDU.

Parameters

ipAddress –the IP address of the SNMP agent.

Note: The following syntax of ipAddress provides the ability to specify the SNMP port value: ipAddress:Port

Example: “65.35.64.170:2000”

If SNMP port is not specified explicitly, default value (161) is considered.

community –the community string to access SNMP data on the agent.

retries –the number of retries to repeat operation.

timeout –the operation timeout.

pdu –the SNMP PDU that contains SNMP variables (e.g. 1.3.6.1.2.1.1.1.0 - sysDescr) to execute SNMP GET operation for.

version the version of SNMP protocol to be used. Can be one of the following constants:

  • SNMPV1

  • SNMPV2

  • SNMPV3

securityLevel the security level used to access the agent.Can be one of the following constants:

  • USM_NOAUTHNOPRIV

  • USM_AUTHNOPRIV

  • USM_AUTHPRIV

userName the USM user name - the principal on whose behalf access is requested.

contextName the name of an SNMP Context - the collection of management information accessible by an SNMP entity.

authProtocol the authentication protocol that is used to authenticate the user. Two protocols are currently supported: the HMAC-MD5-96 and HMAC-SHA-96.Can be one of the following constants:

  • MD5

  • SHA1

authPassword the password required for authentication service.

privProtocol the privacy protocol that is used to protect the message from disclosure. Two protocols are currently supported: the CBC-DES Symmetric Encryption Protocol and CFB-AES-128. Can be one of the following constants:

  • DES

  • AES

privPassword the password required for privacy (encryption) service.

Remarks

Call this function to perform SNMP GET. Use GetPduErrorStatus function to check if there was an error during the operation. (e.g. SNMP Timeout, etc.). If there were no errors during the operation the error status will be equal to 0. For more details about possible errors see GetPduErrorStatus description.

Note:If there was a timeout the error status will be equal to 1000.

Example

snmpvar var1 = CreateVar("1.3.6.1.2.1.1.1.0")

snmpvar var2 = CreateVar("1.3.6.1.2.1.1.2.0")

snmppdu pdu = CreatePdu(var1, var2), response

int iVarCount

int iIndex

snmpvar var_tmp

response = SnmpGet("65.35.64.170", "public", 2, 3000, pdu, SNMPV1)

iVarCount = GetVarCount(response)

for (iIndex=0; iIndex < iVarCount; iIndex++)

  var_tmp = GetVarAt(response, iIndex)

 Println("OID: ", GetVarOID(var_tmp))

Println("VALUE: ", GetVarValue(var_tmp))

endfor

 

Output of the example script will look like:

OID: 1.3.6.1.2.1.1.1.0

VALUE: Test

OID: 1.3.6.1.2.1.1.2.0

VALUE: 1.3.6.1.4.1.311.1.1.3.1.1

   
Converted from CHM to HTML with chm2web Pro 2.76 (unicode)