[icinga-users] Any way to modify the output of a Service check from configuration files?

Michael Friedrich michael.friedrich at icinga.com
Fri Oct 26 16:47:56 CEST 2018


Hi,

short answer: no.

Long answer: The output and performance data isn’t modified by the core when running a command and receiving its output. It is split out into various values according to the plugin API specification (output, parsed performance data) but there is no user action allowed here.

If you need values like the hostname, you can pass these attributes as command line argument thus requiring the plugin to read it and add it to the output.

Kind regards,
Michael


> On 26. Oct 2018, at 16:40, Antony Stone <Antony.Stone at icinga.open.source.it> wrote:
> 
> Hi.
> 
> I have three machines being monitored by Icinga2, which maintain a floating IP 
> address between them.
> 
> I'm running service checks on the real machines by having Icinga installed on 
> them, and on the floating address using "by_ssh", so the check gets run on 
> whichever machine has that address at the time the check is run.
> 
> It would be useful to have the name of the machine which currently has the 
> floating address reported back as part of the service check status, so instead 
> of something like:
> 
> 	OK: asterisk openvpn running
> 
> I can see:
> 
> 	Artemis OK: asterisk openvpn running
> 
> or:
> 
> 	OK: asterisk openvpn running on Artemis
> 
> (assuming that Artemis is the name of the server which has the floating IP at 
> the time).
> 
> Is there any way I can prepend or append text such as this to the output of 
> the service check, in the configuration stanza of the Service check object, or 
> the CheckCommand object in Icinga's configration files?
> 
> Obviously if I have the source code of the plugin check command itself, I 
> could modify that to accept an additional parameter and adjust the output 
> accordingly, but:
> 
> a) some plugins are compiled binaries which I don't have the source code for 
> (or maybe the skills / tools to modify it)
> 	and
> b) this gets tedious if I need to modify the output of 30 different checks all 
> in the same way, when they get run using the SSH connector.
> 
> So, it would be nice to be able to define the service check to add some specific 
> text to the check command output before it gets processed by icinga.
> 
> 
> 	Is that possible?
> 
> 
> Antony.
> 
> -- 
> "It would appear we have reached the limits of what it is possible to achieve 
> with computer technology, although one should be careful with such statements; 
> they tend to sound pretty silly in five years."
> 
> - John von Neumann (1949)
> 
>                                                   Please reply to the list;
>                                                         please *don't* CC me.
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users



More information about the icinga-users mailing list