From 1eb46d5843a9be2025a1574045a1b0ec7c3027a0 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 1 Apr 2013 01:32:14 +0000 Subject: [PATCH] 2013-04-01 Sancho Lerena * unix/plugins/inventory: Improved software inventory in RPM format. Removed dupes and "orphan" lines. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7903 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 5 +++++ pandora_agents/unix/plugins/inventory | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 715096c225..a75547811a 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,8 @@ +2013-04-01 Sancho Lerena + + * unix/plugins/inventory: Improved software inventory in RPM format. + Removed dupes and "orphan" lines. + 2013-03-11 Dario Rodriguez * win32/bin/util/curl.exe: Added curl binary for diff --git a/pandora_agents/unix/plugins/inventory b/pandora_agents/unix/plugins/inventory index a121632f07..90c588359c 100755 --- a/pandora_agents/unix/plugins/inventory +++ b/pandora_agents/unix/plugins/inventory @@ -184,8 +184,8 @@ sub get_software_module_data ($$) { if ($distrib_id eq 'DEBIAN') { @soft = `dpkg -l | grep ii`; } else { - - @soft = `rpm -q -a --qf "ii %{NAME} %{VERSION} %{SUMMARY}\n"`; + # Sometimes rpm return data splitted in two lines, and with dupes. Thats bad for our inventory system + @soft = `rpm -q -a --qf "ii %{NAME} %{VERSION} %{SUMMARY}\n" | grep "^ii" | sort -u`; }