I have a Nagios check_log style perl script that is called via check_by_ssh. The log file entries can contain characters like '>' and '$', which are dangerous and not allowed in SERVICEOUTPUT or LONGSERVICEOUTPUT. The output is stripping these characters making the alerts hard to read. Is there a workaround for escaping characters in SERVICEOUTPUT, or an option to tun on this dangerous activity?
You can bypass Nagios macros and use system variables
in command definition. This trick utilizes fact that there exists system variable
Try escaping the output with a perl function. Without the scripts I can't provide a solution to you but here is an example:
or to just remove them: