2009-09-24 Sancho Lerena <slerena@artica.es>

* modules/pandora_module_tcpcheck.cc: WSAStartup memory management
        was leaking memory, so we will create and destroy in each loop the WSA
        structure. Tested and leak-proof :-))

        * modules/pandora_module_inventory.cc: Fixed typo with string label of
        services inventory module.

        * bin/PandoraAgent.exe: New binary (woah, compiled from linux!).

        * pandora_windows_service.cc: Fixed problem in os XML Tag, was os_name 
        not os. Fixed problem with windows version, now is passwd full string to xml.
        Tentacle call is passwd between quotes, because tentacle could be
        in paths with blank spaces (by default \program files\pandora_agent).

        * pandora.cc: Build updated. 



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1969 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-09-24 16:29:25 +00:00
parent 7358747348
commit d5b14dab3b
6 changed files with 42 additions and 14 deletions

View File

@ -1,3 +1,21 @@
2009-09-24 Sancho Lerena <slerena@artica.es>
* modules/pandora_module_tcpcheck.cc: WSAStartup memory management
was leaking memory, so we will create and destroy in each loop the WSA
structure. Tested and leak-proof :-))
* modules/pandora_module_inventory.cc: Fixed typo with string label of
services inventory module.
* bin/PandoraAgent.exe: New binary (woah, compiled from linux!).
* pandora_windows_service.cc: Fixed problem in os XML Tag, was os_name
not os. Fixed problem with windows version, now is passwd full string to xml.
Tentacle call is passwd between quotes, because tentacle could be
in paths with blank spaces (by default \program files\pandora_agent).
* pandora.cc: Build updated.
2009-09-23 Ramon Novoa <rnovoa@artica.es>
* windows/pandora_wmi.h, modules/pandora_module_inventory.cc: Changed

View File

@ -217,7 +217,7 @@ Pandora_Module_Inventory::run () {
}
rows.clear();
}
found = this->options.find(module_inventory_software_str);
found = this->options.find(module_inventory_services_str);
if (found != string::npos){
pandoraDebug(" Launching Services Query WMI\n");
num_results = Pandora_Wmi::getServices(rows);

View File

@ -35,10 +35,8 @@ using namespace Pandora_Modules;
Pandora_Module_Tcpcheck::Pandora_Module_Tcpcheck (string name, string address, string port, string timeout)
: Pandora_Module (name) {
int rc;
WSADATA wsa_data;
// Initialize Winsock
WSAStartup (MAKEWORD(2,2), &wsa_data);
this->address = address;
this->port = atoi (port.c_str ());
@ -56,7 +54,6 @@ Pandora_Module_Tcpcheck::Pandora_Module_Tcpcheck (string name, string address, s
* Pandora_Module_Tcpcheck destructor.
*/
Pandora_Module_Tcpcheck::~Pandora_Module_Tcpcheck () {
WSACleanup ();
}
void
@ -68,6 +65,13 @@ Pandora_Module_Tcpcheck::run () {
fd_set socket_set;
timeval timer;
WSADATA wsa_data;
// Initialize Winsock
WSAStartup (MAKEWORD(2,2), &wsa_data);
// Run
try {
Pandora_Module::run ();
@ -76,6 +80,7 @@ Pandora_Module_Tcpcheck::run () {
}
if (this->address.empty ()) {
WSACleanup ();
return;
}
@ -83,6 +88,7 @@ Pandora_Module_Tcpcheck::run () {
sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock == SOCKET_ERROR) {
pandoraLog ("Error %d creating socket", WSAGetLastError ());
WSACleanup ();
return;
}
@ -96,6 +102,7 @@ Pandora_Module_Tcpcheck::run () {
host = gethostbyname(this->address.c_str ());
if (host == NULL) {
pandoraLog ("Could not resolve address for %s", this->address.c_str ());
WSACleanup ();
return;
}
@ -111,6 +118,7 @@ Pandora_Module_Tcpcheck::run () {
rc = WSAGetLastError ();
if (rc != WSAEWOULDBLOCK) {
pandoraLog ("connect error %d", rc);
WSACleanup ();
return;
}
}
@ -124,8 +132,10 @@ Pandora_Module_Tcpcheck::run () {
rc = select(0, NULL, &socket_set, NULL, &timer);
if (rc == 0) {
this->setOutput ("0");
WSACleanup ();
return;
}
WSACleanup ();
this->setOutput ("1");
}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("3.0(Build 090224)")
#define PANDORA_VERSION ("3.0(Build 090924)")
string pandora_path;
string pandora_dir;

View File

@ -197,9 +197,9 @@ Pandora_Windows_Service::getXmlHeader () {
agent->SetAttribute ("interval", value);
value = Pandora_Windows_Info::getOSName ();
agent->SetAttribute ("os", value);
agent->SetAttribute ("os_name", value);
value = Pandora_Windows_Info::getOSVersion ();
value = value + Pandora_Windows_Info::getOSVersion ();
agent->SetAttribute ("os_version", value);
return agent;
@ -245,7 +245,7 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
tentacle_cmd += " " + opts;
}
tentacle_cmd += " " + filepath;
tentacle_cmd += " \"" + filepath + "\"";
/* Copy the file */
pandoraDebug ("Remote copying XML %s on server %s",