Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was 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

@kovyrin

Description

@kovyrin

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>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions