Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

Add closing quotationmarks in Validator for influxdb writer config #10174

Closed SebastianOpeni closed 1 week ago

SebastianOpeni commented 1 week ago

When having a macro error in the influxdb writer config the error message is missing a closing single-quotation mark.

Before:

Error: Validation failed for object 'influxdb2' of type 'Influxdb2Writer'; Attribute 'host_template' -> 'tags' -> 'foo': Closing $ not found in macro format string 'bar$
Location: in /usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf: 14:3-20:3
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(12):   //flush_threshold = 1024
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(13):   //flush_interval = 10s
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(14):   host_template = {
                                                                      ^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(15):     measurement = "$host.check_command$"
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(16):     tags = {
                                                                    ^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(17):       hostname = "$host.name$"
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(18):       foo = "bar$"
                                                                    ^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(19):     }
                                                                    ^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(20):   }

After:

Error: Validation failed for object 'influxdb2' of type 'Influxdb2Writer'; Attribute 'host_template' -> 'tags' -> 'foo': Closing $ not found in macro format string 'bar$'.
Location: in /usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf: 14:3-20:3
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(12):   //flush_threshold = 1024
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(13):   //flush_interval = 10s
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(14):   host_template = {
                                                                      ^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(15):     measurement = "$host.check_command$"
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(16):     tags = {
                                                                    ^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(17):       hostname = "$host.name$"
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(18):       foo = "bar$"
                                                                    ^^^^^^^^^^^^^^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(19):     }
                                                                    ^^^^^
/usr/local/icinga2/etc/icinga2/features-enabled/influxdb2.conf(20):   }

This is a small fix discussed here: https://github.com/Icinga/icinga2/pull/10074#discussion_r1773046097

SebastianOpeni commented 1 week ago

I set my mail address as not private now.

SebastianOpeni commented 1 week ago

I don't know why the AUTHORS check fails here but accepts the other pull request...

yhabteab commented 1 week ago

Hi, can you please drop the merge commit (fcf2f5c) from this PR as it contains a random email of yours automatically generated by GitHub. This is the reason why GA is also failing. +Sebastian Grund <166400577+SebastianOpeni@users.noreply.github.com>

SebastianOpeni commented 1 week ago

I see, because I accepted the PullRequest from @Al2Klimov in the Github-UI with my mail still hidden. Sorry for the unnecessary delay.