snmpcrypt_setAccessPassPhrase()

The function allows to set a password for the encryption of SNMP access parameters.

Synopsis

int snmpcrypt_setAccessPassPhrase(int drvNum, string appOld, string app)

Parameters

Parameter Description
drvNum Number of the driver for which the password should be set.
appOld Existing pass phrase that should be changed
app New pass phrase

Return value

The function returns following values:

  • 0 => Success

  • -1 => The Access Pass Phrase data point element does not exist

  • -2 => The input does not match the existing pass phrase

Errors

Possible errors are:

  • Wrong function parameters

  • Wrong pass phrase

  • Invalid pass phrase

Description

The function allows to set the Access PassPhrase (APP) for the encrypted SNMP access parameter. The passphrase may contain following letters and numbers: a-z, A-Z, 0-9

To use this function the CTRL library snmpCrypt must be added to the script by adding “#uses snmpCrypt” at the top of the script

To remove the encryption of the access parameters an empty string must be set as new pass phrase, see examples below.

Example

Following example sets the pass phrase for the SNMP access parameter encryption

#uses "snmpCrypt"
encrypt()
{
  //Passwort "SNMPAccessPassPhrase" wird gesetzt
  snmpcrypt_setAccessPassPhrase(1, "",
  "SNMPAccessPassPhrase");
}

Example

Following example removes the access parameter encryption

#uses "snmpCrypt"
decrypt()
{
  //Passwort "SNMPAccessPassPhrase" wird entfernt
  snmpcrypt_setAccessPassPhrase(1, "SNMPAccessPassPhrase",
  "");
}

Assignment

SNMP

Availability

CTRL