PDA

View Full Version : Escape "#" character in zabbix_agentd.comf (Windows)


dm0nkz
29-01-2005, 03:14
Hi,

Im trying to configure my zabbixW32 agent on a windows 2000 machine.
The machine has two nics and refers to one of the NIC as

"BroadCom NetXtreme Gigabit Ethernet Driver#1" .. thus i would add

PerfCounter=NeTotal,"\Network Interface(BroadCom NetXtreme Gigabit Ethernet Driver#1)\Bytes Total/sec",10

The thing is im getting error when i do a zabbixw32.exe check-config
It says Invalid perfomance counter specifications... I tried removing the "#"
to check if it is causing the problem and it returned "OK"

It seems that i need to escape the "#" character so that it will not be
interpreted as a comment.

Thanks.

dm0nkz

karn
01-07-2005, 20:05
I ran into the same problem with the latest release (1.1alpha10). The proper solution is to have some escape character like you mentioned. However, a quick solution is to do something like this:

On line 215 of zabbix-1.1alpha10/src/zabbix_agent_win32/config.cpp insert this code:

for (int i = 0, n = strlen(buffer); i < n; i++)
if (buffer[i] == '^') buffer[i] = '#';

It will replace any '^' character with the '#' after the comments in the config file have already been removed. Then you can change your zabbix_agentd.conf file to:

PerfCounter=NeTotal,"\Network Interface(BroadCom NetXtreme Gigabit Ethernet Driver^1)\Bytes Total/sec",10

The config parser will read in the line properly, convert the '^' to a '#' and then pass the correct Network Interface name.

Hope that helps.

SparHawk
05-07-2005, 14:29
How do you recompile the .exe after adding the code to line 215

Thanks

SparHawk

dm0nkz
06-07-2005, 02:26
Or can someone with the compiled (.exe) version share or have it uploaded hear? maybe we can standardize it rather than trouble shooting different
implementations..

just a thought.. :o

God bless!

dm0nkz