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

Add ITL CheckCommands for Thola #8683

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

BausPhi
Copy link
Contributor

@BausPhi BausPhi commented Mar 16, 2021

We wrote CheckCommands for our monitoring tool Thola and we would like to add them to the ITL.
The commands are also documented in the corresponding doc file.
If something needs to be changed, let us know :D
If you are interested in Thola, have a look at our github page.

@icinga-probot icinga-probot bot added this to the 2.13.0 milestone Mar 16, 2021
@Al2Klimov Al2Klimov requested a review from yhabteab March 25, 2021 09:06
Copy link
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

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

So unfortunately the separation of templates and commands doesn't quite fit into the layout. So we should really think about documenting the templates, then it would be easier to put the subcommands underneath.

cc @Al2Klimov.

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 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
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
@BausPhi
Copy link
Contributor Author

BausPhi commented Mar 26, 2021

I applied the change requests, I hope it now fulfills the requirements.

@yhabteab
Copy link
Member

It looks pretty good now. I just need to test the CheckCommands.

@BausPhi
Copy link
Contributor Author

BausPhi commented Mar 26, 2021

Okay, let me know if you need some help using thola.

Copy link
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

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

I could not find any device supported by thola and so it would be very helpful if you would test the CheckCommands and write here as a test protocol.

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

BausPhi commented Mar 29, 2021

We tested all commands on our icinga and all the commands worked flawless.

@yhabteab
Copy link
Member

yhabteab commented Apr 12, 2021

Sorry for the delay!

If I understood it correctly, all the checkcommands are based on a single thola main command namely thola check so the subcommands are always executed like /thola-client check $sub_commands$. Therefore it would be a bit more helpful if there would be only one checkcommand without the templates and all sub commands. The user could then, depending on where he needs them, enter the sub commands as follows vars.sub_command = "cpu-load", vars.sub_command = "memory-usage" etc. then the documentation would be a bit clearer without having to document the templates.

The CheckCommand would then look like as follows.

object CheckCommand "thola-check" {
    import "plugin-check-command"

    command = [ PluginContribDir + "/thola-client" ]

    arguments += {
        "(no key.0)" = {
            order = -2
            required = true
            skip_key = true
            value = "check"
            description = "Thola Check Mode"
        }
        "(no key)" = {
            order = -1
            required = true
            skip_key = true
            value = "$sub_command$"
            description = "Thola check sub commands"
        }
        "(no key.1)" = {
            order = 0
            required = true
            skip_key = true
            value = "$address$"
            description = "Thola Check Device Mode"
        }
        "--target-api" = {
            required = true
            value = "$thola_api_address$"
            description = "Address of the thola API"
        }
        "--snmp-community" = {
            required = false
            value = "$snmp_community$"
            description = "SNMP Community of target"
        }
        "--snmp-version" = {
            required = false
            value = "$snmp_protocol$"
            description = "SNMP Version of target"
        }
    }

    if (vars.sub_command == "cpu-load" || vars.sub_command == "memory-usage") {
        arguments += {
            "--critical" = {
                required = false
                value = "$critical$"
                description = "Critical Threshold"
            }
            "--warning" = {
                required = false
                value = "$warning$"
                description = "Warning Threshold"
            }
        }
    } else if (vars.sub_command == "sbc") {
       The arguments of `sbc` sub command come here
    }
   etc.....

It's just a suggestion, you don't have to change everything right away, and maybe @Al2Klimov can say something about it too.

@Al2Klimov
Copy link
Member

No, @Yonas-net . If the user shall be able to specify the subcommand as custom var at host/service (where else?), you can’t do it this way. Depending on the specific case you can either make several separate commands or one big command like MySQL health with all arguments of all subcommands present (unconditionally).

@BausPhi Do you consider the latter solution reasonable?

@BausPhi
Copy link
Contributor Author

BausPhi commented Apr 15, 2021

Tomorrow I will discuss with my workmates which option is the best for us. I will then let you now what we decided. Sorry for the delay.

@Al2Klimov Al2Klimov added the needs feedback We'll only proceed once we hear from you again label Apr 15, 2021
@BausPhi
Copy link
Contributor Author

BausPhi commented Apr 16, 2021

We came to the conclusion that we would like to stick with a separate command for every sub command. The reason for this is that the possible flags vary a lot for the different sub commands. For example the thola check ups command has 12 flags that don't exist in other sub commands.

Is there still anything that we then have to change?

@Al2Klimov Al2Klimov removed the needs feedback We'll only proceed once we hear from you again label Apr 16, 2021
@BausPhi BausPhi force-pushed the feature/command-template-thola branch from c251bf9 to a08f71a Compare April 16, 2021 12:09
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
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.

What about shortening all this a bit...

itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf 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.

Sure.

itl/plugins-contrib.d/network-components.conf 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.

Indent config w/ tabs, not spaces.

itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
@BausPhi
Copy link
Contributor Author

BausPhi commented May 5, 2021

Is there anything left to do?

@Al2Klimov
Copy link
Member

Yes, #8683 (review) .

@BausPhi
Copy link
Contributor Author

BausPhi commented May 5, 2021

All spaces should now be replaced by tabs.

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
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.

We’re actually moving forward...

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 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
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
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.

@Yonas-net I hope you keep all of my complaints in mind for the next time you review a new check command. 😄

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
itl/plugins-contrib.d/network-components.conf Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf Show resolved Hide resolved
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.

In the doc please use ASCII " and '.

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
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
@Al2Klimov
Copy link
Member

And => '?

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.

We’re almost done...

itl/plugins-contrib.d/network-components.conf Outdated Show resolved Hide resolved
itl/plugins-contrib.d/network-components.conf 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
@Al2Klimov Al2Klimov assigned Al2Klimov and unassigned BausPhi Jun 8, 2021
@Al2Klimov Al2Klimov force-pushed the feature/command-template-thola branch from 28f5717 to 36b8bab Compare June 8, 2021 17:42
@Al2Klimov
Copy link
Member

You seem to have merged the master to resolve conflicts. I'll take care of this, but the next time please rebase:

https://github.com/Icinga/icinga2/blob/master/CONTRIBUTING.md#-rebase-a-branch

@Al2Klimov Al2Klimov removed their assignment Jun 8, 2021
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.

LGTM

@Al2Klimov Al2Klimov requested a review from yhabteab June 8, 2021 17:43
@BausPhi
Copy link
Contributor Author

BausPhi commented Jun 9, 2021

Thank you very much for taking your time to look at all the changes

@Al2Klimov Al2Klimov modified the milestones: 2.13.0, 2.14.0 Jun 21, 2021
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
doc/10-icinga-template-library.md Outdated Show resolved Hide resolved
@Al2Klimov
Copy link
Member

And don't forget I've force-pushed the branch, i.e. perform git pull -f first!

@Al2Klimov Al2Klimov requested a review from yhabteab June 22, 2021 11:29
@Al2Klimov
Copy link
Member

If you request squashing, please w/o rebasing!

@Al2Klimov Al2Klimov modified the milestones: 2.14.0, 2.13.0 Jun 24, 2021
@Al2Klimov Al2Klimov force-pushed the feature/command-template-thola branch from 1428a7d to 0b27c2a Compare June 24, 2021 10:58
@Al2Klimov Al2Klimov merged commit 26588f5 into Icinga:master Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants