-
Documentation task
-
Resolution: Fixed
-
Minor
-
5.0.14, 5.4.2
-
None
-
Sprint 80 (Sep 2021), Sprint 81 (Oct 2021)
-
0.125
According to the documentation, version key should have a default value of 2 (SNMPv2c):
version integer SNMP interface version.
Posibile values are:
1 - SNMPv1;
2 - (default) - SNMPv2c;
3 - SNMPv3
However making an API call with version key unset results in "Incorrect arguments passed to function".
/** * Check if SNMP version is valid. Valid versions: SNMP_V1, SNMP_V2C, SNMP_V3. * * @param array $interface * * @throws APIException if "version" value is incorrect. */ protected function checkSnmpVersion(array $interface) { if (!array_key_exists('version', $interface['details']) || !in_array($interface['details']['version'], [SNMP_V1, SNMP_V2C, SNMP_V3])) { self::exception(ZBX_API_ERROR_PARAMETERS, _('Incorrect arguments passed to function.')); } }