PDA

View Full Version : Escape bars in zabbix_get


fast.ryder
29-04-2008, 17:50
Hello, everyone!

I have come across the solution for a problem I have encountered recently.

Using the portuguese version of Server 2003, I was never able to get performance data in shell mode (bash) using zabbix_get.

The command I used for zabbix_agent was:

zabbix_get -s (ip) -k perf_counter[\Sistema\Threads]

However, I enabled logging level 4 for the Zabbix agent and my system complained about:

"cannot find SistemaThreads"

(Something like cannot find SystemThreads, as if the input was badly parsed..)

then I added two more slashes and everything went ok:

zabbix_get -s (ip) -k perf_counter[\\Sistema\\Threads]

So if anyone else has this problem... please try it out.


P.S.: Zabbix team, is this a bug? I "RTFM" but did not find any reference to double slashes... (1.6 version)

Thanks,

Ivo Pereira
IT Consultant
Portugal

niekie
30-04-2008, 19:29
This is not a Zabbix bug, this is your shell on Linux eating your '\'. A '\' in a Linux/Unix shell usually indicates that the very next character should not be interpreted but taken literally. So to have "zabbix_get" actually see a '\' you have to '\' the '\' ("escape the escape character").

Niek.