diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index f0d9f66cbc..f179dcb42d 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,11 @@ +2012-05-03 Sergio Martin + + * win32/windows/pandora_wmi.cc: Added to the windows + agent inventory module for patches the service pack + column + + Merged from 4.0.2 + 2012-04-27 Dario Rodriguez * unix/plugins/inventory: Fixed a small error related to inventory plugin diff --git a/pandora_agents/win32/windows/pandora_wmi.cc b/pandora_agents/win32/windows/pandora_wmi.cc index 1cadf90557..bae1960605 100644 --- a/pandora_agents/win32/windows/pandora_wmi.cc +++ b/pandora_agents/win32/windows/pandora_wmi.cc @@ -1016,7 +1016,7 @@ int Pandora_Wmi::getPatchInfo (list &rows) { CDhInitialize init; CDispPtr wmi_svc = NULL, patch_info = NULL; - char *hot_fix_id = NULL, *description = NULL, *comments = NULL; + char *hot_fix_id = NULL, *description = NULL, *comments = NULL, *service_pack = NULL; string ret = ""; int num_objects = 0; try { @@ -1027,7 +1027,7 @@ Pandora_Wmi::getPatchInfo (list &rows) { dhCheck (dhGetValue (L"%o", &patch_info, wmi_svc, L".ExecQuery(%S)", - L"SELECT HotFixID, Description, FixComments FROM Win32_QuickFixEngineering ")); + L"SELECT HotFixID, Description, FixComments, ServicePackInEffect FROM Win32_QuickFixEngineering ")); FOR_EACH (patch_info_item, patch_info, NULL) { num_objects++; @@ -1050,7 +1050,14 @@ Pandora_Wmi::getPatchInfo (list &rows) { if (comments != NULL) { ret += comments; } - dhFreeString(comments); + ret += inventory_field_separator; + dhFreeString (comments); + dhGetValue (L"%s", &service_pack, patch_info_item, + L".ServicePackInEffect"); + if (service_pack != NULL) { + ret += service_pack; + } + dhFreeString(service_pack); rows.push_back(ret); ret.clear(); } NEXT_THROW (patch_info_item);