2012-05-03 Sergio Martin <sergio.martin@artica.es>

* win32/windows/pandora_wmi.cc: Added to the windows
	agent inventory module for patches the service pack
	column

	Merged from 4.0.2



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6251 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-05-03 14:45:42 +00:00
parent a64560c081
commit 5f1f45cf43
2 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2012-05-03 Sergio Martin <sergio.martin@artica.es>
* 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 <dario.rodriguez@artica.es> 2012-04-27 Dario Rodriguez <dario.rodriguez@artica.es>
* unix/plugins/inventory: Fixed a small error related to inventory plugin * unix/plugins/inventory: Fixed a small error related to inventory plugin

View File

@ -1016,7 +1016,7 @@ int
Pandora_Wmi::getPatchInfo (list<string> &rows) { Pandora_Wmi::getPatchInfo (list<string> &rows) {
CDhInitialize init; CDhInitialize init;
CDispPtr wmi_svc = NULL, patch_info = NULL; 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 = ""; string ret = "";
int num_objects = 0; int num_objects = 0;
try { try {
@ -1027,7 +1027,7 @@ Pandora_Wmi::getPatchInfo (list<string> &rows) {
dhCheck (dhGetValue (L"%o", &patch_info, wmi_svc, dhCheck (dhGetValue (L"%o", &patch_info, wmi_svc,
L".ExecQuery(%S)", 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) { FOR_EACH (patch_info_item, patch_info, NULL) {
num_objects++; num_objects++;
@ -1050,7 +1050,14 @@ Pandora_Wmi::getPatchInfo (list<string> &rows) {
if (comments != NULL) { if (comments != NULL) {
ret += comments; 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); rows.push_back(ret);
ret.clear(); ret.clear();
} NEXT_THROW (patch_info_item); } NEXT_THROW (patch_info_item);