[ZBXNEXT-2580] Agent item "system.sw.packages" detail mode Created: 2014 Nov 10 Updated: 2024 Apr 10 Resolved: 2023 Jan 23 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G) |
Affects Version/s: | None |
Fix Version/s: | 6.4.0beta5, 6.4 (plan) |
Type: | Change Request | Priority: | Trivial |
Reporter: | Arthur Ivanov | Assignee: | dimir |
Resolution: | Fixed | Votes: | 12 |
Labels: | None | ||
Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
Issue Links: |
|
|||||||||||||||
Sub-Tasks: |
|
|||||||||||||||
Epic Link: | DEV-680 | |||||||||||||||
Team: | ||||||||||||||||
Sprint: | Sprint 60 (Jan 2020), Sprint 61 (Feb 2020), Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020), Sprint 68 (Sep 2020), Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 93 (Oct 2022), Sprint 94 (Nov 2022), Sprint 95 (Dec 2022), Sprint 96 (Jan 2023) | |||||||||||||||
Story Points: | 9 |
Description |
Please add format "detail" mode to system.sw.packages[<package>,<manager>,<format>] Would be greate if detail mode will send packages with thier versions. for example, |
Comments |
Comment by richlv [ 2014 Nov 10 ] |
hmm, that might not be easy to trigger on, though - there isn't really any substring extraction and subsequent matching in triggers |
Comment by Arthur Ivanov [ 2014 Nov 10 ] |
trigger based on regexp is not problem, for example i can check "if version regexp 2014[a-i] then alarm" or "if version regexp 201[0-3][a-z] then alarm" |
Comment by Arthur Ivanov [ 2014 Nov 18 ] |
Looks like "dpkg --get-selections" is used for check installed packages: static ZBX_PACKAGE_MANAGER package_managers[] = , , , , {NULL}}; my suggest is to use "dpkg-query --show " because respoanse include version of package |
Comment by Arthur Ivanov [ 2014 Nov 18 ] |
RHEL/OL/CENTOS
DEBIAN/UBUNTU
my suggestion:
in this case UBUNTU response will be more similar to RHEL/OL/CENTOS |
Comment by Arthur Ivanov [ 2015 Jan 28 ] |
any news? dpkg --get-selections and some small modification of dpkg_parser as result you can see [package]-[version] in response. right now only [package] returned from ubuntu. all other OSes return [package]-[version] |
Comment by Arthur Ivanov [ 2015 Jan 28 ] |
or just implement system.sw.packageversion[package] that return version of package it can be used for lot of things. for example - i just want to catch all hosts that have this weakness by checking package version |
Comment by Robert McLay [ 2017 Jan 05 ] |
Is there a possibility of using an alternative function on Debian based systems until this is fixed...? I have templates which cannot collect package versions due to this bu/issue. Presently, I've had to enable a lot of external scripts in order to make this work. My preference for Zabbix over Nagios is partially due to not having to run a lot of external scripts to get functionality such as this. Happy to provide templates and logs if needed. |
Comment by Самосват Николай [ 2018 Jul 02 ] |
For rpm-based distrо - return the package version: [rpm] GeoIP-1.5.0-11.el7.x86_64, NetworkManager-1.4.0-17.el7_3.x86_64... For debian-based Linux does not return the package version: [dpkg] acl, acpi, acpi-support-base, acpid, adduser... It would be cool to be able to specify the format of the returned package list. Or just have versions of deb-packages, for example in this format: dpkg-query -W -f='${Package} ${Version} ${Architecture}' |
Comment by Vladislavs Sokurenko [ 2022 Oct 31 ] |
Required functionality could also be achieved by user parameter and CSV to JSON preprocessing step. UserParameter=system.sw.packages.get,echo 'Package,Version,Architecture' ; dpkg-query -W -f='${Package},${Version},${Architecture}\n' |
Comment by dimir [ 2022 Nov 22 ] |
C Agent ready for code review in development branch. New item key system.sw.packages.get[<regexp>,<manager>] available on GNU/Linux systems. It returns JSON in format: [ { "name": "util-linux-core", "manager": "rpm", "version": "2.37.4-3.el9", "size": 1296335, "arch": "x86_64", "buildtime": { "timestamp" : 1653552239, "value" : "Sep 20 01:39:40 2021 UTC" }, "installtime": { "timestamp" : 1660780885, "value" : "Aug 18 00:01:25 2022 UTC" } }, [...] ] |
Comment by dimir [ 2022 Dec 07 ] |
Go agent part implemented in development branch (PR) |
Comment by dimir [ 2022 Dec 13 ] |
Fixed in
New agent and agent2 metric system.sw.packages.get[<regex>, <manager>] (both parameters optional) can be used to monitor details of the installed packages. After this change current template Template Module Linux generic by Zabbix agent will be modified:
For those that want to try the feature until it's documented, the output is in JSON format, containing array of objects, each object describing a package. E. g. [ { "name": "util-linux-core", "manager": "rpm", "version": "2.37.4-3.el9", "size": 1296335, "arch": "x86_64", "buildtime": { "timestamp" : 1653552239, "value" : "Sep 20 01:39:40 2021 UTC" }, "installtime": { "timestamp" : 1660780885, "value" : "Aug 18 00:01:25 2022 UTC" } }, { "name": "xfonts-base", "manager": "dpkg", "version": "1:1.0.5", "arch": "all", "size": 7337984, "buildtime": { "timestamp": 0, "value": "" }, "installtime": { "timestamp": 0, "value": "" } } ] If build time or install time is not available, their timestamp is 0 and the value (human-readable representation of the datetime) is empty string. Size is in bytes. |
Comment by Martins Valkovskis [ 2022 Dec 16 ] |
Updated documentation: |