Re: Perl Modul Nagios::Plugin and extra-opts - request for comments
Stephan <[email protected]>
| Newsgroups | gmane.network.nagios.plugins.devel |
|---|---|
| Message-ID | <[email protected]> |
Am 01.06.12 02:01, schrieb William Leibzon: > Yes, get rid of quotes. But please introduce either one multi-line syntax > or the other (and I prefer just \ at the end of line) and document that > use. I'll soon have to write my own implementation compatible with > --extra-opts and I don't want to have to support 3 different ways either. Hmm... The HERE-document and the multiline with backslashes are not interchangeble. With the HERE-document you introduce newlines and indentations into the strings. With multiline you simply break up a longish string for readability. So I'd still like to have both. Let me give you an example. For my current plugin I need to provide to the script an LQL command sequence (see http://mathias-kettner.de/checkmk_livestatus.html for an explanation). So I need to provide something like this: GET services Filter: description = my service Filter: host_custom_variables = _COUNTRY DE Filter: scheduled_downtime_depth = 0 Filter: host_scheduled_downtime_depth = 0 Stats: state = 0 Stats: state = 1 Stats: state = 2 Stats: state > 2 I "solved" this by introducing an option command and putting into extra-opt: command=GET services command=Filter: description = my service command=Filter: host_custom_variables = _COUNTRY DE command=Filter: scheduled_downtime_depth = 0 command=Filter: host_scheduled_downtime_depth = 0 command=Stats: state = 0 command=Stats: state = 1 command=Stats: state = 2 command=Stats: state > 2 While this is feasible, I'd still prefer the way it can be done in Config::General (a module I know for some time now) commands=<<END GET services Filter: description = my service Filter: host_custom_variables = _COUNTRY DE Filter: scheduled_downtime_depth = 0 Filter: host_scheduled_downtime_depth = 0 Stats: state = 0 Stats: state = 1 Stats: state = 2 Stats: state > 2 END ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________________ Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel ::: Please include plugins version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null