Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Values containing \n (two characters: slash and 'n') break the status parser #6

Open
kovyrin opened this issue Sep 8, 2013 · 0 comments

Comments

@kovyrin
Copy link

kovyrin commented Sep 8, 2013

Nagios status files could contain '\n' in long_plugin_output field. Those values are interpreted as line breaks by the status parser, which leads to plugin output info after '\n' to being processed by the parser as key=value data and all kinds of weird errors being thrown.

Example status:

servicestatus {
        long_plugin_output=foo\nbar\n
        }

Throws an exception:

/usr/lib64/ruby/1.9.1/racc/parser.rb:351:in `on_error':  (Racc::ParseError)
parse error on value "bar" (VALUE)
    from (eval):3:in `_racc_do_parse_c'
    from (eval):3:in `do_parse'
    from parser.y:78:in `parse'
    from parser.y:72:in `parse'
    from ./nagios-status-failure.rb:13:in `<main>'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant