Feature #11277

Group hosts and services in the monitoring setup

Added by bertagaz 2016-03-23 14:24:27 . Updated 2016-05-03 07:50:02 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Infrastructure
Target version:
Start date:
2016-03-23
Due date:
% Done:

100%

Feature Branch:
Type of work:
Sysadmin
Blueprint:

Starter:
Affected tool:
Deliverable for:
268

Description

To ease browsing and manipulations, we should use the hostsgroup and servicesgroup feature once we’ve setup the checks we want.


Subtasks


History

#1 Updated by bertagaz 2016-03-23 14:24:49

#2 Updated by bertagaz 2016-03-23 14:25:06

  • blocks #8668 added

#3 Updated by intrigeri 2016-03-25 17:42:00

  • Subject changed from Group hosts and services in the monitoring setup. to Group hosts and services in the monitoring setup

#4 Updated by intrigeri 2016-03-25 17:43:36

  • blocked by deleted (#8668)

#5 Updated by bertagaz 2016-04-26 04:59:34

  • Target version changed from Tails_2.3 to Tails_2.4

#6 Updated by intrigeri 2016-04-26 06:08:28

#7 Updated by bertagaz 2016-04-27 06:06:51

  • Assignee changed from bertagaz to intrigeri
  • % Done changed from 0 to 60
  • QA Check set to Ready for QA

I’ve added some basic service groups (grouping the memory and APT checks), as well as a hostgroup for all lizard’s hosts. That’s commit puppet-tails:537f7fa

I’ve also added a service group for each host, grouping all services running on each one, including the external checks made by ecours. That was a bit tidy. That’s commits puppet-tails:c2be27a, puppet-tails:c9b3001 and commit cfe4296 in our main manifest repo.

So unless I missed some relevant groupings, I think we’re good here, and you can review this ticket. :)

#8 Updated by intrigeri 2016-04-28 14:12:37

  • Assignee changed from intrigeri to bertagaz
  • QA Check changed from Ready for QA to Info Needed

> So unless I missed some relevant groupings, I think we’re good here, and you can review this ticket. :)

I like the UX, great! Two questions:

  • perhaps the implementation would be nicer (less repetitive and error-prone) if the $real_host parameter had $::fqdn as its default value in all relevant classes?
  • In assign where match("*lizard*", host.name): why the leading *?

#9 Updated by bertagaz 2016-04-29 01:28:14

  • Assignee changed from bertagaz to intrigeri

intrigeri wrote:
> I like the UX, great! Two questions:

Yay!

> * perhaps the implementation would be nicer (less repetitive and error-prone) if the $real_host parameter had $::fqdn as its default value in all relevant classes?

Hmmm, I don’t get how it would be less repetitive: this checks are exported resources collected on ecours, so here $::fqdn would be “resolved” by Puppet as ecours.t.b.o, and not the actual hostname we really meant.

I tried to make this parameter default to $::fqdn in all relevant classes in the first implementation, but hit that problem. So I had to make it a mandatory parameter that had to be passed when this classes are declared. That’s commit puppet-tails:c9b3001. But I agree it’s a bit less nice this way.

> * In assign where match("*lizard*", host.name): why the leading *?

To also catch lizard.tails.boum.org?

#10 Updated by intrigeri 2016-04-29 02:15:39

  • Assignee changed from intrigeri to bertagaz

> Hmmm, I don’t get how it would be less repetitive: this checks are exported resources collected on ecours, so here $::fqdn would be “resolved” by Puppet as ecours.t.b.o, and not the actual hostname we really meant.

Oops, you’re right obviously :)

>> * In assign where match("*lizard*", host.name): why the leading *?

> To also catch lizard.tails.boum.org?

I really meant leading, so I don’t get it.

#11 Updated by bertagaz 2016-04-29 03:01:21

  • Assignee changed from bertagaz to intrigeri
  • QA Check changed from Info Needed to Ready for QA

intrigeri wrote:
> >> * In assign where match("*lizard*", host.name): why the leading *?
>
> > To also catch lizard.tails.boum.org?
>
> I really meant leading, so I don’t get it.

Right sorry read too fast. You’re right, I just tried without these * (including trailing ones), and it works. I was confused by other service groups configured by default in Icinga2. Fixed in puppet-tails:a45712e.

#12 Updated by intrigeri 2016-04-29 03:34:22

  • Assignee changed from intrigeri to bertagaz
  • QA Check changed from Ready for QA to Dev Needed

> Fixed in puppet-tails:a45712e.

… and we have no “Lizard” hostgroup anymore, presumably because that commit removed the trailing star.

#13 Updated by bertagaz 2016-04-29 03:57:59

  • Assignee changed from bertagaz to intrigeri
  • QA Check changed from Dev Needed to Ready for QA

intrigeri wrote:
> … and we have no “Lizard” hostgroup anymore, presumably because that commit removed the trailing star.

Woops, I was watching the servicegoup page, ahum… :)

So I tried with the the trailing star, and then only lizard.t.b.o is added to the hostgroup. When I also add the leading star, then all the lizard VMs are also added. So I guess my first implementation was correct in fact.

Last commit in puppet-tails.

#14 Updated by intrigeri 2016-04-29 04:09:04

  • Assignee changed from intrigeri to bertagaz
  • % Done changed from 60 to 70
  • QA Check changed from Ready for QA to Dev Needed

> So I tried with the the trailing star, and then only lizard.t.b.o is added to the hostgroup. When I also add the leading star, then all the lizard VMs are also added. So I guess my first implementation was correct in fact.

Indeed, it was working better. But this feels a bit rough. According to http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/library-reference#library-reference we could use the regex function instead, to get a more precise selector.

#15 Updated by bertagaz 2016-04-29 08:13:53

  • Assignee changed from bertagaz to intrigeri
  • QA Check changed from Dev Needed to Info Needed

intrigeri wrote:
> Indeed, it was working better. But this feels a bit rough. According to http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/library-reference#library-reference we could use the regex function instead, to get a more precise selector.

Do you mean just s/match/regexp/, or that I should refine the regexp itself and s/match/regexp/? If the later, I’d be delighted if you gave me some directions, not sure how to write this one.

#16 Updated by intrigeri 2016-04-29 12:09:01

  • Assignee changed from intrigeri to bertagaz
  • QA Check changed from Info Needed to Dev Needed

> Do you mean just s/match/regexp/

No: that would make it a totally buggy regexp.

> or that I should refine the regexp itself and s/match/regexp/?

Yes.

> If the later, I’d be delighted if you gave me some directions, not sure how to write this one.

Something like ^(lizard\.tails\.boum\.org|[a-z0-9-]+\.lizard)$ should do it.

#17 Updated by bertagaz 2016-04-30 06:17:17

  • Status changed from Confirmed to In Progress
  • Assignee changed from bertagaz to intrigeri
  • % Done changed from 70 to 90
  • QA Check changed from Dev Needed to Ready for QA

intrigeri wrote:
> > If the later, I’d be delighted if you gave me some directions, not sure how to write this one.
>
> Something like ^(lizard\.tails\.boum\.org|[a-z0-9-]+\.lizard)$ should do it.

Applied in commit puppet-tails:b2a3a6f. Had to adapt a bit because boost.regex seems to work a bit differently on escape sequences.

#18 Updated by intrigeri 2016-04-30 06:48:18

  • Assignee changed from intrigeri to bertagaz
  • QA Check changed from Ready for QA to Dev Needed

> Had to adapt a bit because boost.regex seems to work a bit differently on escape sequences.

I’m confused, as http://www.boost.org/doc/libs/1_60_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html says that “.” does the same thing as all other regexp language I’ve seen, i.e. match any char, so to me it looks like this regexp will match e.g. “lizardXtailsYboumZorg”, while it should not. Still, I acknowledge that it may be hard to get the escaping right, so I suggest using a character class instead, as an alternate mean of escaping the dot special char: ^(lizard[.]tails[.]boum[.]org|[a-z0-9-]+[.]lizard)$. This should work in any case, right?

#19 Updated by bertagaz 2016-04-30 07:05:19

  • Assignee changed from bertagaz to intrigeri
  • QA Check changed from Dev Needed to Ready for QA

intrigeri wrote:
> I’m confused, as http://www.boost.org/doc/libs/1_60_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html says that “.” does the same thing as all other regexp language I’ve seen, i.e. match any char, so to me it looks like this regexp will match e.g. “lizardXtailsYboumZorg”, while it should not. Still, I acknowledge that it may be hard to get the escaping right, so I suggest using a character class instead, as an alternate mean of escaping the dot special char: ^(lizard[.]tails[.]boum[.]org|[a-z0-9-]+[.]lizard)$. This should work in any case, right?

Hmmm, right. Tested and indeed it seems to work. So I’ve deployed it with commit puppet-tails:a425523. Thanks for the character class hint, learned something today. :)

#20 Updated by intrigeri 2016-05-03 07:50:02

  • Status changed from In Progress to Resolved
  • Assignee deleted (intrigeri)
  • % Done changed from 90 to 100
  • QA Check changed from Ready for QA to Pass

Great, thanks!