Plugin returns a pipe in status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Plugin returns a pipe in status

Post by BanditBBS »

I have a custom plugin that run s a sql command and then returns the data. Unfortunately, some of the values of the db columns contain pipes. So when it hits the first one it start adding from that point into the perf data field. Is there a way to escape them so nagios doesn't start processing as perf data? I tried wrapping in ' and " with no luck. Short term fix was to regex and replace the | with -, but I'd much rather it show the true values.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Plugin returns a pipe in status

Post by tmcdonald »

Yea, that's the easy way.

The hard but more fun way would be to write a NEB module that lets you specify certain checks to catch, and allow a different separator for those, but that's a little absurd :)
Former Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Plugin returns a pipe in status

Post by BanditBBS »

Thanks Trevor, feel free to close this up!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked