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

Constants

In NetDecision Script Language a constant is a number, character, or character string that can be used as a value in a program. Each constant has special meaning to the script compiler

NetDecision Script Language Constants

Constant Type Value Description
OK integer 0 Used to verify the return status of the function. If a  functions in NetDecision script language returns status, not value the OK constant can be used to verify if function succeeded. 
FAIL integer -1 If the return status of the function is FAIL the execution failed due to a reason specific to this function. See individual functions description to determine a reason of failure.
TRUE integer 1 Used as a value for a logical variable or a conditional expression.
FALSE integer 0
SQLOK integer 1 When working with database connection you can call DBGetSQLStatus function to determine the status of previously executed command. Use this constants to determine if an error occurred. 
SQLFAIL integer 0
T_INT integer 20000 When working with parameter files it might be useful to determine the type of variable in runtime. Use these constants to compare with the return value of GetParameterType function.
T_STRING integer 20001
T_DOUBLE integer 20002
T_SNMPPDU integer 20003
T_SNMPVAR integer 20004
T_XML integer 20005
T_ARRAY integer 20006
T_BYTE integer 20009
T_CHAR integer 20010
CR string "\n" Carriage Return character (hex 0D)
LF string "\r" Linefeed, aka Newline character (hex 0A)
TAB string "\t" Horizontal Tab character (hex 09)
FILE_BEGIN_POS integer 0 When working with file I/O function these constants are used to specify the seek mode. Refer to Seek function article for details.
FILE_CURRENT_POS integer 1
FILE_END_POS integer 2
TFTP_NETASCII integer 0 When working with TFTP functions these constants are used to specify the file transfer mode. Refer to TFTPGet function article for details.
TFTP_OCTET integer 1
TFTP_OK integer 1 When working with TFTP functions these constants are used to check the return status of operation. Refer to TFTPGet function article for details.
TFTP_ERROR integer 2
TFTP_TIMEOUT integer 3
SNMPV1 integer 0 When working with SNMP Get, GetNext, Set functions these constants are used to specify the version of SNMP protocol to be used. Refer to SnmpGet function article for details.
SNMPV2 integer 1
SNMPV3 integer 3
DEFAULT_SNMP_PORT integer 161 Default SNMP port.
SNMP_TIMEOUT integer 2000 Default SNMP tumeout.
MD5 integer 0 When working with SNMPv3 these constants define the authentication protocol to be used. Refer to SnmpGet function article for details.
SHA1 integer 1
DES integer 0 When working with SNMPv3 these constant defines the privacy protocol to be used. Refer to SnmpGet function article for details.
AES integer 1 When working with SNMPv3 these constant defines the privacy protocol to be used. Refer to SnmpGet function article for details.
USM_NOAUTHNOPRIV integer 0 When working with SNMPv3 these constants define the security level used to access the agent. Refer to SnmpGet function article for details.
USM_AUTHNOPRIV integer 1
USM_AUTHPRIV integer 3
EVENT_LOG_SUCCESS integer 0 When working with Event Log functions these constants define event type (severity) of the message. Refer to EventLogWriteRecord function article for details.
EVENT_LOG_INFO integer 4
EVENT_LOG_WARNING integer 2
EVENT_LOG_ERROR integer 1
EVENT_LOG_AUDIT_FAIL integer 16
EVENT_LOG_AUDIT_SUCCESS integer 8
NOPARITY integer 0 When working with serial port functions these constants define the parity - a method of detecting errors in transmission. Refer to OpenSerialPort function article for details.
ODDPARITY integer 1
EVENPARITY integer 2
MARKPARITY integer 3
SPACEPARITY integer 4
ONESTOPBIT integer 0 When working with serial port functions these constants define the number of stop bits sent at the end of every byte transmitted. Refer to OpenSerialPort function article for details.
ONE5STOPBITS integer 1
TWOSTOPBITS integer 2
DOUBLE_NAN double NAN A special "Not a Number" value of a double variable within a script.
ND_BIN_DIR integer 0 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision bin folder (typically "C:\Program Files\NetDecision\Bin" ).
ND_PLUGIN_DIR integer 1 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision plugin folder (typically "C:\Program Files\NetDecision\Plugins" ).
ND_LOG_DIR integer 2 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision log files folder (typically "C:\Program Files\NetDecision\Log" ).
ND_RRD_DIR integer 3 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision RRD databases folder (typically "C:\Program Files\NetDecision\RRD Files" ).
ND_WEB_DIR integer 4 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision web files folder (typically "C:\Program Files\NetDecision\Web" ).
ND_MIBS_DIR integer 5 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision compiled mibs folder (typically "C:\Program Files\NetDecision\Compiled Mibs" ).
ND_ICONS_DIR integer 6 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision icons folder (typically "C:\Program Files\NetDecision\Icons" ).
ND_TOPOLOGY_DIR integer 7 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision topologies folder (typically "C:\Program Files\NetDecision\Topologies" ).
ND_PDU_TRACE_DIR integer 8 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision PDU trace files folder (typically "C:\Program Files\NetDecision\PduTrace" ).
ND_CONFIG_DIR integer 9 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision config files folder (typically "C:\Program Files\NetDecision\Config" ).
ND_SCRIPTS_DIR integer 10 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision script files folder (typically "C:\Program Files\NetDecision\Script Folders" ).
ND_DB_DIR integer 11 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision database files folder (typically "C:\Program Files\NetDecision\Database" ).
ND_PARAMETERS_DIR integer 12 When passed into GetNetDecisionSystemDir function makes it return the path to NetDecision parameter files folder (typically "C:\Program Files\NetDecision\Parameter Files" ).
   
Converted from CHM to HTML with chm2web Pro 2.76 (unicode)