-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
5.0.33, 6.0.14, 6.2.9, 6.4.0, 7.0.0alpha1
-
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