[ZBX-19710] API: SNMP interface "version" default not set properly Created: 2021 Jul 21  Updated: 2024 Apr 10  Resolved: 2021 Oct 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: 5.0.14, 5.4.2
Fix Version/s: 5.0.17rc1, 5.4.6rc1, 6.0.0alpha4, 6.0 (plan)

Type: Documentation task Priority: Minor
Reporter: Sergey Simonenko (Inactive) Assignee: Valdis Murzins
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Team: Team B
Sprint: Sprint 80 (Sep 2021), Sprint 81 (Oct 2021)
Story Points: 0.125

 Description   

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.'));
                }
        }


 Comments   
Comment by Ivo Kurzemnieks [ 2021 Oct 01 ]

Documentation updated:

Generated at Sun Mar 16 22:10:36 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.