summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsauros <sauros@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-08 08:08:14 +0000
committersauros <sauros@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-08 08:08:14 +0000
commit035b23b9b79987e27a3e32b94024d8d8024cddea (patch)
treef18e41f13a0863552fd30c5499882623360e41ad /src
parent00f991b4a75061a9caa37630c08edf2be40efca5 (diff)
downloadzabbix-035b23b9b79987e27a3e32b94024d8d8024cddea.tar.gz
zabbix-035b23b9b79987e27a3e32b94024d8d8024cddea.tar.xz
zabbix-035b23b9b79987e27a3e32b94024d8d8024cddea.zip
Added config file parameter LogLevel
git-svn-id: svn://svn.zabbix.com/trunk@1470 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rwxr-xr-xsrc/zabbix_agent_win32/Debug/ZabbixW32.exebin327756 -> 327756 bytes
-rwxr-xr-xsrc/zabbix_agent_win32/Release/ZabbixW32.exebin106496 -> 106496 bytes
-rw-r--r--src/zabbix_agent_win32/config.cpp4
-rw-r--r--src/zabbix_agent_win32/doc/ChangeLog5
-rw-r--r--src/zabbix_agent_win32/doc/ReadMe.txt10
-rw-r--r--src/zabbix_agent_win32/log.cpp3
-rw-r--r--src/zabbix_agent_win32/main.cpp1
-rw-r--r--src/zabbix_agent_win32/zabbixw32.h3
8 files changed, 24 insertions, 2 deletions
diff --git a/src/zabbix_agent_win32/Debug/ZabbixW32.exe b/src/zabbix_agent_win32/Debug/ZabbixW32.exe
index a8445a6a..78fc7d71 100755
--- a/src/zabbix_agent_win32/Debug/ZabbixW32.exe
+++ b/src/zabbix_agent_win32/Debug/ZabbixW32.exe
Binary files differ
diff --git a/src/zabbix_agent_win32/Release/ZabbixW32.exe b/src/zabbix_agent_win32/Release/ZabbixW32.exe
index 297f3a79..86bffe73 100755
--- a/src/zabbix_agent_win32/Release/ZabbixW32.exe
+++ b/src/zabbix_agent_win32/Release/ZabbixW32.exe
Binary files differ
diff --git a/src/zabbix_agent_win32/config.cpp b/src/zabbix_agent_win32/config.cpp
index ca06e027..b96c1e09 100644
--- a/src/zabbix_agent_win32/config.cpp
+++ b/src/zabbix_agent_win32/config.cpp
@@ -303,6 +303,10 @@ BOOL ReadConfig(void)
sourceLine,tm);
}
}
+ else if (!stricmp(buffer,"LogLevel"))
+ {
+ g_dwLogLevel = strtoul(buffer, NULL, 0);
+ }
else if (!stricmp(buffer,"PerfCounter"))
{
if (!AddPerformanceCounter(ptr))
diff --git a/src/zabbix_agent_win32/doc/ChangeLog b/src/zabbix_agent_win32/doc/ChangeLog
index c3c7ab52..aa22018d 100644
--- a/src/zabbix_agent_win32/doc/ChangeLog
+++ b/src/zabbix_agent_win32/doc/ChangeLog
@@ -1,3 +1,8 @@
+1.0.1
+
+* Added configuration parameter LogLevel
+
+
1.0.0-beta15
* Fixed bug with memory[xxx] counters on systems with more than 2GB of memory
diff --git a/src/zabbix_agent_win32/doc/ReadMe.txt b/src/zabbix_agent_win32/doc/ReadMe.txt
index 6d69d8a4..424bfc90 100644
--- a/src/zabbix_agent_win32/doc/ReadMe.txt
+++ b/src/zabbix_agent_win32/doc/ReadMe.txt
@@ -1,5 +1,5 @@
- ZabbixW32 version 1.0.0-beta15
+ ZabbixW32 version 1.0.1
******************************************************************************
@@ -81,6 +81,14 @@ LogFile = <path>
be used. You can also specify Event Log as a target for logging implicitly
by setting <path> to "{EventLog}" (without quotes).
+LogLevel = <mask>
+ Sets log level. It's an or'ed value of the following flags:
+ 0x01 - Log critical messages
+ 0x02 - Log warning messages
+ 0x04 - Log informational messages
+ Default value is 0x07, which means "log all messages". Value can be either
+ in decimal or hexadecimal form.
+
Timeout = <number>
Sets the request processing timeout (in seconds). If server request will
not be processed within specified timeout, appropriate error code will be
diff --git a/src/zabbix_agent_win32/log.cpp b/src/zabbix_agent_win32/log.cpp
index ec1c28fa..cc0e3f93 100644
--- a/src/zabbix_agent_win32/log.cpp
+++ b/src/zabbix_agent_win32/log.cpp
@@ -135,6 +135,9 @@ void WriteLog(DWORD msg,WORD wType,char *format...)
int numStrings=0;
DWORD error;
+ if (!((DWORD)wType & g_dwLogLevel))
+ return;
+
memset(strings,0,sizeof(char *)*16);
if (format!=NULL)
diff --git a/src/zabbix_agent_win32/main.cpp b/src/zabbix_agent_win32/main.cpp
index e70a4f7e..58ad1326 100644
--- a/src/zabbix_agent_win32/main.cpp
+++ b/src/zabbix_agent_win32/main.cpp
@@ -39,6 +39,7 @@ DWORD confServerAddr[MAX_SERVERS];
DWORD confServerCount=0;
DWORD confTimeout=3000; // 3 seconds default timeout
DWORD confMaxProcTime=100; // 100 milliseconds is default acceptable collector sample processing time
+DWORD g_dwLogLevel = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
SUBAGENT *subagentList; // List of loaded subagents
SUBAGENT_NAME *subagentNameList=NULL;
diff --git a/src/zabbix_agent_win32/zabbixw32.h b/src/zabbix_agent_win32/zabbixw32.h
index 441ed877..5bab06f5 100644
--- a/src/zabbix_agent_win32/zabbixw32.h
+++ b/src/zabbix_agent_win32/zabbixw32.h
@@ -43,7 +43,7 @@
#else
#define DEBUG_SUFFIX
#endif
-#define AGENT_VERSION "1.0.0" DEBUG_SUFFIX
+#define AGENT_VERSION "1.0.1" DEBUG_SUFFIX
#define ZABBIX_SERVICE_NAME "ZabbixAgentdW32"
#define ZABBIX_EVENT_SOURCE "Zabbix Win32 Agent"
@@ -212,6 +212,7 @@ extern HANDLE eventShutdown;
extern HANDLE eventCollectorStarted;
extern DWORD dwFlags;
+extern DWORD g_dwLogLevel;
extern char confFile[];
extern char logFile[];