mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
RC1 pandoraFMS windows agent with omnishell reference
This commit is contained in:
parent
3bed8a7efa
commit
beac005a44
@ -1704,7 +1704,7 @@ Pandora_Windows_Service::checkConfig (string file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
Pandora_Windows_Service::sendXml (Pandora_Module_List *modules, string extra /* = ""*/) {
|
||||||
int rc = 0, rc_sec = 0, xml_buffer;
|
int rc = 0, rc_sec = 0, xml_buffer;
|
||||||
string data_xml;
|
string data_xml;
|
||||||
string xml_filename, random_integer;
|
string xml_filename, random_integer;
|
||||||
@ -1786,6 +1786,9 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Write extra content (omnishell, for instance) */
|
||||||
|
data_xml += extra;
|
||||||
|
|
||||||
/* Close the XML header */
|
/* Close the XML header */
|
||||||
data_xml += "</agent_data>";
|
data_xml += "</agent_data>";
|
||||||
|
|
||||||
@ -2018,7 +2021,7 @@ Pandora_Windows_Service::pandora_run () {
|
|||||||
void
|
void
|
||||||
Pandora_Windows_Service::pandora_run (int forced_run) {
|
Pandora_Windows_Service::pandora_run (int forced_run) {
|
||||||
Pandora_Agent_Conf *conf = NULL;
|
Pandora_Agent_Conf *conf = NULL;
|
||||||
string server_addr, conf_file, *all_conf;
|
string server_addr, conf_file, *all_conf, omnishell_output, omnishell_path;
|
||||||
int startup_delay = 0;
|
int startup_delay = 0;
|
||||||
int i, num;
|
int i, num;
|
||||||
static bool startup = true;
|
static bool startup = true;
|
||||||
@ -2055,6 +2058,15 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
|
|||||||
this->checkCollections ();
|
this->checkCollections ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Execute omnishell commands */
|
||||||
|
omnishell_path = Pandora::getPandoraInstallDir ();
|
||||||
|
omnishell_path += "util\\omnishell_client.exe \"" + conf_file+"\"";
|
||||||
|
if (getPandoraDebug () != false) {
|
||||||
|
pandoraLog ("Omnishell: Running");
|
||||||
|
}
|
||||||
|
omnishell_output = getValueFromCmdExec(omnishell_path.c_str(), 6000000);
|
||||||
|
|
||||||
server_addr = conf->getValue ("server_ip");
|
server_addr = conf->getValue ("server_ip");
|
||||||
|
|
||||||
execution_number++;
|
execution_number++;
|
||||||
@ -2126,7 +2138,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
|
|||||||
|
|
||||||
// Send the XML
|
// Send the XML
|
||||||
if (!server_addr.empty ()) {
|
if (!server_addr.empty ()) {
|
||||||
this->sendXml (this->modules);
|
this->sendXml (this->modules, omnishell_output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ namespace Pandora {
|
|||||||
const char *svc_description);
|
const char *svc_description);
|
||||||
|
|
||||||
void start ();
|
void start ();
|
||||||
int sendXml (Pandora_Module_List *modules);
|
int sendXml (Pandora_Module_List *modules, string extra = "");
|
||||||
void sendBufferedXml (string path, copy_func_p copy_func, bool secondary_buffer);
|
void sendBufferedXml (string path, copy_func_p copy_func, bool secondary_buffer);
|
||||||
Pandora_Agent_Conf *getConf ();
|
Pandora_Agent_Conf *getConf ();
|
||||||
string getEHKey (string ehorus_conf);
|
string getEHKey (string ehorus_conf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user