Modify plugin output in Service object

I have been happily using the “dummy” check to programmaticaly determine states for things like internal Icinga cluster states or combined services. The “dummy” check allows manipulating the “plugin output” by assigning a dynamic value to vars.dummy_output.

Now I am wondering if we can also programmatically manipulate the plugin output for regular services. We have some plugins that give confusing output or are simply behaving badly (i.e. outputting NaN in the perf data, which confuses InfluxDBWriter) and unfortunately the issue will not be fixed upstream. In stead of writing and maintaining a wrapper check command, we were thinking of using a simple find and replace filter in the Icinga Service definition itself on service.output, is that possible?

Hi @prupert ! i read your question to resolve my issue but i don’t know if i can help you. I thinh you need filter your service.output with tags, for example i was needing filter my websites with status codes like 200, 404, 500 etc. so i edited my influxdbwriter /etc/icinga2/features-enabled/influxdb.conf and added some macros: Monitoring Basics - Icinga 2

service_template = {
measurement = “$service.check_command$”
tags = {
hostname = “$$”
service = “$$”
svoutput = “$service.output$”

so now in my grafana i can show all my websites with 200 or 500 websites,etc, manupalting the svoutput tag.