Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19710

API: SNMP interface "version" default not set properly

XMLWordPrintable

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

            vmurzins Valdis Murzins
            ssimonenko Sergey Simonenko (Inactive)
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: