mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Added disable_logfile token to Windows Agent
This commit is contained in:
parent
161921be3d
commit
d30ad049c8
@ -65,6 +65,9 @@ server_port 41121
|
|||||||
# In case of using FTP or tentacle with password. User is always "pandora"
|
# In case of using FTP or tentacle with password. User is always "pandora"
|
||||||
#server_pwd pandora
|
#server_pwd pandora
|
||||||
|
|
||||||
|
# If set to 1 disables log writing into pandora_agent.log
|
||||||
|
#disable_logfile 1
|
||||||
|
|
||||||
# Debug mode do not copy XML data files to server.
|
# Debug mode do not copy XML data files to server.
|
||||||
# debug 1
|
# debug 1
|
||||||
|
|
||||||
@ -75,9 +78,6 @@ remote_config 0
|
|||||||
# XML encoding (ISO-8859-1 by default). Most windows servers experience problems when you set to UTF-8. Other special codepages may be specified here.
|
# XML encoding (ISO-8859-1 by default). Most windows servers experience problems when you set to UTF-8. Other special codepages may be specified here.
|
||||||
#encoding ISO-8859-1
|
#encoding ISO-8859-1
|
||||||
|
|
||||||
# Config file encoding. Some windows text editors has ANSI default and others UTF-8
|
|
||||||
#config_file_encoding UTF-8
|
|
||||||
|
|
||||||
# If set to 1 start Drone Agent's Proxy Mode
|
# If set to 1 start Drone Agent's Proxy Mode
|
||||||
# proxy_mode 1
|
# proxy_mode 1
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ using namespace Pandora_Strutils;
|
|||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
bool pandora_debug;
|
bool pandora_debug;
|
||||||
|
bool pandora_log_disable;
|
||||||
string pandora_version = PANDORA_VERSION;
|
string pandora_version = PANDORA_VERSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,6 +144,7 @@ pandoraWriteLog (string filename, string line) {
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Pandora::pandoraLog (const char *format, ...) {
|
Pandora::pandoraLog (const char *format, ...) {
|
||||||
|
if (!pandora_log_disable) {
|
||||||
va_list args;
|
va_list args;
|
||||||
char msg[5000];
|
char msg[5000];
|
||||||
|
|
||||||
@ -151,6 +153,8 @@ Pandora::pandoraLog (const char *format, ...) {
|
|||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
pandoraWriteLog ("pandora_agent.log", (char *) msg);
|
pandoraWriteLog ("pandora_agent.log", (char *) msg);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -275,6 +279,18 @@ Pandora::getPandoraDebug () {
|
|||||||
return pandora_debug;
|
return pandora_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the disable logfile flag.
|
||||||
|
*
|
||||||
|
* If the flag is true no logs will be written.
|
||||||
|
*
|
||||||
|
* @param dbg Turns the debug flag on/off.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
Pandora::setPandoraLogDisable (bool dbg) {
|
||||||
|
pandora_log_disable = dbg;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the version of the agent.
|
* Get the version of the agent.
|
||||||
|
@ -76,6 +76,7 @@ namespace Pandora {
|
|||||||
string getPandoraInstallPath ();
|
string getPandoraInstallPath ();
|
||||||
void setPandoraDebug (bool dbg);
|
void setPandoraDebug (bool dbg);
|
||||||
bool getPandoraDebug ();
|
bool getPandoraDebug ();
|
||||||
|
void setPandoraLogDisable (bool dbg);
|
||||||
string getPandoraAgentVersion ();
|
string getPandoraAgentVersion ();
|
||||||
|
|
||||||
void pandoraDebug (const char *format, ...);
|
void pandoraDebug (const char *format, ...);
|
||||||
|
@ -205,7 +205,7 @@ Pandora_Windows_Service::check_broker_agents(string *all_conf){
|
|||||||
|
|
||||||
void
|
void
|
||||||
Pandora_Windows_Service::pandora_init () {
|
Pandora_Windows_Service::pandora_init () {
|
||||||
string conf_file, interval, debug, intensive_interval, util_dir, path, env;
|
string conf_file, interval, debug, disable_logfile, intensive_interval, util_dir, path, env;
|
||||||
string udp_server_enabled, udp_server_port, udp_server_addr, udp_server_auth_addr;
|
string udp_server_enabled, udp_server_port, udp_server_addr, udp_server_auth_addr;
|
||||||
string name_agent, name;
|
string name_agent, name;
|
||||||
string proxy_mode, server_ip;
|
string proxy_mode, server_ip;
|
||||||
@ -265,6 +265,9 @@ Pandora_Windows_Service::pandora_init () {
|
|||||||
debug = conf->getValue ("debug");
|
debug = conf->getValue ("debug");
|
||||||
setPandoraDebug (is_enabled (debug));
|
setPandoraDebug (is_enabled (debug));
|
||||||
|
|
||||||
|
disable_logfile = conf->getValue ("disable_logfile");
|
||||||
|
setPandoraLogDisable (is_enabled(disable_logfile));
|
||||||
|
|
||||||
if (first_run == 1) {
|
if (first_run == 1) {
|
||||||
first_run = 0;
|
first_run = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user