Escape | from plugin output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Escape | from plugin output

Post 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!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Escape | from plugin output

Post by ssax »

When I did this I just changed them to a backslash (\\), I don't think you can escape them.
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Re: Escape | from plugin output

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Escape | from plugin output

Post 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.
Locked