Page 1 of 1

Escape | from plugin output

Posted: Tue Dec 15, 2015 9:23 am
by arnab.roy
Hi All,

I have situation as follows:

Our XI servers are monitoring syslog messages and sometimes these messages contain "|" symbol, these are obviously translated as performance data which it is not :(

To give more idea: I have the syslog monitoring setup as follows:

Syslog is picked up by Syslog-ng , a watcher scripts tails the file and tries to obtain pattern matches on match it sends the matching line with the appropriate Nagios return code .

I am assuming in the watcher script I need to escape the | , what I should be doing easiest would be if I put quotes around the whole output ?

Any ideas!

Re: Escape | from plugin output

Posted: Tue Dec 15, 2015 4:59 pm
by ssax
When I did this I just changed them to a backslash (\\), I don't think you can escape them.

Re: Escape | from plugin output

Posted: Wed Dec 16, 2015 5:09 pm
by arnab.roy
ssax wrote:When I did this I just changed them to a backslash (\\), I don't think you can escape them.
I will try this but it can actually be a little more complex as the check result is pushed to check via nrds. The nrds API usually doesnt like it when you have special characters in the output.

Re: Escape | from plugin output

Posted: Thu Dec 17, 2015 1:53 pm
by ssax
Sorry, I should have been more clear, what I really mean was that you can change it to any character you'd like as long as it's not the pipe (|) character.