Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITL: add --extra-opts to plugins supporting it #8010

Merged

Conversation

netphantm
Copy link
Contributor

@netphantm netphantm commented May 14, 2020

Adding --extra-opts to nagios plugins

fixes #7630
fixes #10001

Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @netphantm and thank you for contributing!

While updating the documentation you have indented the table columns of some new rows not as the others and re-indented the table columns of some existing rows not as the others and needlessly.

Please fix that.

Best,
AK

doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • git reset --soft HEAD~3
  • git commit --amend --no-edit
  • git push -f

@netphantm netphantm force-pushed the feature/itl-enable-extra-opts-7630 branch from 6d92c32 to 77d2c58 Compare May 18, 2020 11:02
@netphantm
Copy link
Contributor Author

I wanted to change also line 758, to escape the asterisk, since it changes the way it's rendered by vim w/ syntax highlighting from there onward (it makes all text italic), but changed it back to how it was initially..

@Al2Klimov Al2Klimov added this to the 2.13.0 milestone May 18, 2020
@Al2Klimov Al2Klimov requested a review from htriem May 18, 2020 11:10
@Al2Klimov Al2Klimov requested review from julianbrost and removed request for htriem October 29, 2020 14:43
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering where you added the new option in the documentation is a bit inconsistent, see the individual comments.

Personal opinion (i.e. you don't have to change this, but in case you agree, feel free to do so): The existing options don't seem to follow a particular order in general, most likely it's based of the order in the usage output in the corresponding plugin. --extra-opts seems to be some kind of "feature of last resort", i.e. you use it if you find no other way, therefore maybe it would make sense to always put it last?

doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
@julianbrost
Copy link
Contributor

* [ ]  `git reset --soft HEAD~3`
* [ ]  `git commit --amend --no-edit`
* [ ]  `git push -f`

@Al2Klimov Looks like this has been addressed, do you mind updating your review?

@julianbrost julianbrost modified the milestones: 2.13.0, 2.14.0 May 31, 2021
@netphantm netphantm requested a review from julianbrost July 8, 2021 08:54
julianbrost
julianbrost previously approved these changes Aug 4, 2021
@julianbrost julianbrost requested a review from Al2Klimov August 4, 2021 12:49
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. no need for rebasing or squashing – we'll take care.

doc/10-icinga-template-library.md Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Show resolved Hide resolved
doc/10-icinga-template-library.md Show resolved Hide resolved
doc/10-icinga-template-library.md Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
@cla-bot
Copy link

cla-bot bot commented Aug 5, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@netphantm netphantm requested a review from Al2Klimov August 6, 2021 06:14
@cla-bot
Copy link

cla-bot bot commented Aug 16, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

3 similar comments
@cla-bot
Copy link

cla-bot bot commented Aug 16, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Aug 16, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Aug 30, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@netphantm
Copy link
Contributor Author

@Al2Klimov I changed the email address, what do I have to do now to get the checks to be successful now?

@Al2Klimov
Copy link
Member

You have to change it in all commits here.

Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. no need for rebasing or squashing – we'll take care.

The CLA bot seems to disagree with me. Please

  1. Checkout the branch
  2. git reset --soft d5d89b7f398a0c8700fe36a64602a3e1bf3f52e0
  3. Commit all the stuff

@julianbrost julianbrost removed this from the 2.14.0 milestone Jan 23, 2023
@Al2Klimov Al2Klimov added the area/itl Template Library CheckCommands label May 27, 2024
@julianbrost
Copy link
Contributor

I'll try to resolve the remaining open points myself as there was a customer request for this (in particular for check_snmp).

Though when resolving the conflicts, I got confused about the http check now already supporting that argument and its use of set_if:

"--extra-opts" = {
set_if = {{ string(macro("$http_extra_opts$")) != "" }}
value = "$http_extra_opts$"
description = "Read extra plugin options from an ini file"
}

@yhabteab Looks like this was added based on your review. I don't see why this should be necessary though, like shouldn't arguments only be passed if the argument is set anyways?

ref/IP/57417

@yhabteab
Copy link
Member

I don't see why this should be necessary though, like shouldn't arguments only be passed if the argument is set anyways?

Yes, I was thinking of a situation where a user might assign a value such as vars.http_extra_opts = host.vars.something, which could result in an empty string (Icinga 2 would pass that as an argument to the plugin). However, since pretty much everywhere else do it without the extra set_if, I guess you can remove it, if you see any problems in it.

@julianbrost julianbrost force-pushed the feature/itl-enable-extra-opts-7630 branch from aaa518e to f9e117b Compare January 20, 2025 13:09
Copy link

cla-bot bot commented Jan 20, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bruno Lingner.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@julianbrost
Copy link
Contributor

I force pushed to squash the commits and rebased to resolve the conflicts.

@julianbrost julianbrost force-pushed the feature/itl-enable-extra-opts-7630 branch from f9e117b to daf36ae Compare January 20, 2025 13:13
Copy link

cla-bot bot commented Jan 20, 2025

Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA).

Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA.

After that, please reply here with a comment and we'll verify.

Contributors that have not signed yet: @netphantm

  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Please contact us if you think this is the case.

  • If you signed the CLA as a corporation, your GitHub username may not have been submitted to us. Please reach out to the responsible person in your organization.

@julianbrost
Copy link
Contributor

And another force push to switch to the author's other e-mail address (there were commits with two different addresses on the branch, I changed it so that the one that's already in the AUTHORS file is used).

The PR will be accepted without the CLA due to the trivial nature of the change (approved by @bobapple, see internal ticket ref/IP/57417).

@julianbrost julianbrost changed the title Feature/itl enable extra opts 7630 ITL: add --extra-opts to plugins supporting it Jan 20, 2025
@julianbrost julianbrost requested a review from Al2Klimov January 20, 2025 13:19
@bobapple
Copy link
Member

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Jan 21, 2025
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other plugins list --extra-opts last as it's often some kind of feature of last
resort as it provides an option that can't be set in another way. For
consistency, this also moves it to the end for the curl check command.
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared the documentation list against the CheckCommands and they seem to fit. Furthermore, I think we have not forgotten any check. Thanks everyone!

@julianbrost julianbrost merged commit f308bb1 into Icinga:master Feb 10, 2025
23 checks passed
@netphantm
Copy link
Contributor Author

thanks guys, sorry I left this unfinished! I had a lot to deal with lately and also just simply forgot about it..
I'm glad it finally got done, so now I don't have to manually edit the command-plugins file after each update of icinga where this is overwritten

@julianbrost
Copy link
Contributor

No worries! Thank you for starting it and already doing a lot of the work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing argument for ITL command mysql_query ITL: Adding Extra-Opts to nagios plugins
6 participants