Skip to content

Add closing quotationmarks in Validator for influxdb writer config#10174

Merged
yhabteab merged 2 commits intoIcinga:masterfrom
open-i-gmbh:fix/influxdbwriter-validator-add-closing-quotation-marks
Sep 26, 2024
Merged

Add closing quotationmarks in Validator for influxdb writer config#10174
yhabteab merged 2 commits intoIcinga:masterfrom
open-i-gmbh:fix/influxdbwriter-validator-add-closing-quotation-marks

Conversation

@SebastianOpeni
Copy link
Copy Markdown
Contributor

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:
#10074 (comment)

@cla-bot cla-bot bot added the cla/signed label Sep 25, 2024
Al2Klimov
Al2Klimov previously approved these changes Sep 25, 2024
@Al2Klimov Al2Klimov added bug Something isn't working area/influxdb Metrics to InfluxDB labels Sep 25, 2024
@Al2Klimov Al2Klimov added this to the 2.15.0 milestone Sep 25, 2024
@SebastianOpeni
Copy link
Copy Markdown
Contributor Author

SebastianOpeni commented Sep 25, 2024

I set my mail address as not private now.

@SebastianOpeni
Copy link
Copy Markdown
Contributor Author

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

@yhabteab
Copy link
Copy Markdown
Member

yhabteab commented Sep 26, 2024

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 <[email protected]>

@SebastianOpeni SebastianOpeni force-pushed the fix/influxdbwriter-validator-add-closing-quotation-marks branch from fcf2f5c to 90c76ad Compare September 26, 2024 08:04
@SebastianOpeni
Copy link
Copy Markdown
Contributor Author

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

@yhabteab yhabteab enabled auto-merge September 26, 2024 08:29
@yhabteab yhabteab merged commit 0fff415 into Icinga:master Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/influxdb Metrics to InfluxDB bug Something isn't working cla/signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants