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

system.sw.packages fails to recognize 'all' filter in regex parameter

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.33, 6.0.14, 6.2.9, 6.4.0, 7.0.0alpha1
    • Agent2 plugin (N)
    • None
    • Any Linux distribution with a supported package manager.

      The system.sw.packages item accepts a regular expression as its first parameter. The exception to this is the keyword all, which should result in all found packages passing the filter[1]. This, however, is not the case, and the agent uses the keyword just like any other regular expression.

      On my Fedora 36 machine, without specifying a regular expression, all packages are listed as described by docs:

      % zabbix_agent2 -f -c zabbix_agent2.conf -t 'system.sw.packages[,rpm]'
      system.sw.packages[,rpm]                      [s|[rpm] Box2D-2.4.1-8.fc37.x86_64, GConf2-3.2.6-36.fc37.x86_64, GeoIP-1.6.12-12.fc37.x86_64, GeoIP-GeoLite-data-2018.06-10.fc37.noarch, ImageMagick-6.9.12.82-1.fc37.x86_64, ImageMagick-c++-6.9.12.82-1.fc37.x86_64, ImageMagick-libs-6.9.12.82-1.fc37.x86_64, LibRaw-0.20.2-7.fc37.x86_64 ...]

      Specifying the regular expression parameter to be the all keyword, we get packages matching it as an expression, instead of the described behavior:

      % zabbix_agent2 -f -c zabbix_agent2.conf -t 'system.sw.packages[all,rpm]'
      system.sw.packages[all,rpm]                   [s|[rpm] arm-image-installer-3.7-1.fc37.noarch, firewall-config-1.2.3-1.fc37.noarch, firewalld-1.2.3-1.fc37.noarch, firewalld-filesystem-1.2.3-1.fc37.noarch ...]

      Unfortunately, this has been the case since at least 5.0.33 (as on the stable release/5.0 branch). Prior to that, the code moved in the tree and building it is a bit tricky, so I didn't bother to bisect for the bug commit too much.

      [1]: Item manual

            zabbix.dev Zabbix Development Team
            jlambda Juris Lambda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: