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

(#495) Notify Service[sensu-enterprise] from Sensu::Check resources #720

Merged

Conversation

jeffmccune
Copy link
Collaborator

@jeffmccune jeffmccune commented Jul 7, 2017

Without this patch The sensu-enterprise service is not notified
automatically when sensu::check resources are declared. This patch
addresses the problem by checking the catalog for the service and
automatically adding the notify relationship.

resolves #502
resolves #495
closes #653

self[:notify] = [
"Service[sensu-client]",
"Service[sensu-server]",
"Service[sensu-enterprise]",
Copy link
Collaborator

Choose a reason for hiding this comment

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

if Service[sensu-enterprise] is not in the catalog, because we aren't using enterprise, does this cause a problem?

Copy link
Collaborator Author

@jeffmccune jeffmccune Jul 7, 2017

Choose a reason for hiding this comment

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

I expect no problem becauseArray#select filters out the resource ref when absent from the catalog.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you verified with vagrant up ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, will do so now.

Copy link
Collaborator Author

@jeffmccune jeffmccune Jul 7, 2017

Choose a reason for hiding this comment

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

@ghoneycutt I modified the provisioning manifest for sensu-server-enterprise to manage Service[sensu-enterprise] instead of Service[sensu-server]. Take a look at this change in 1d694e4, I assumed tests/sensu-server-enterprise.pp is intended to setup sensu-enterprise.

With vagrant up sensu-server, the notification doesn't cause a problem as we expect. With vagrant up sensu-server-enterprise, the notification does properly notify Service[sensu-enterprise] when a managed sensu::check resource changes state.

jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this pull request Jul 7, 2017
Without this patch the sensu-server-enterprise Vagrant VM is not managing the
Service[sensu-enterprise] resource.  This is a problem for testing the behavior
changes made in sensu#720.

This patch addresses the problem by changing the class parameters of the
provisioning manifest for sensu-server-enterprise.  The credentials for the
Sensu Enterprise repository are expected to be set in the shell environment
where `vagrant up` is executed.

For example, the following direnv `.envrc` is sufficient for this project:

```
export FACTER_SE_USER='1234567890'
export FACTER_SE_PASS='Password1'
```
@jeffmccune jeffmccune self-assigned this Jul 8, 2017
@ghoneycutt
Copy link
Collaborator

@jeffmccune see PR #502 where they made similar changes, but to other files as well.

@jeffmccune
Copy link
Collaborator Author

@ghoneycutt Got it, I'll update this PR to add the notify to all of the files referenced in #502

David Gwilliam and others added 3 commits July 9, 2017 09:25
Without this patch the sensu-server-enterprise Vagrant VM is not managing the
Service[sensu-enterprise] resource.  This is a problem for testing the behavior
changes made in sensu#720.

This patch addresses the problem by changing the class parameters of the
provisioning manifest for sensu-server-enterprise.  The credentials for the
Sensu Enterprise repository are expected to be set in the shell environment
where `vagrant up` is executed.

For example, the following direnv `.envrc` is sufficient for this project:

```
export FACTER_SE_USER='1234567890'
export FACTER_SE_PASS='Password1'
```
Without this patch The sensu-enterprise service is not notified automatically
when `sensu::check` resources are declared.  This patch addresses the problem
by checking the catalog for the service and automatically adding the notify
relationship.

resolves sensu#502
resolves sensu#495
closes sensu#653
@jeffmccune jeffmccune force-pushed the 495_check_should_notify_sensu-enterprise branch from 1d694e4 to ae48859 Compare July 9, 2017 16:58
@jeffmccune
Copy link
Collaborator Author

@ghoneycutt Notifications and spec coverage added to all types listed in #502 This is ready for another review.

manage_services => true,
manage_user => true,
rabbitmq_password => 'correct-horse-battery-staple',
rabbitmq_vhost => '/sensu',
api => true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was the API portion removed?

@jeffmccune
Copy link
Collaborator Author

jeffmccune commented Jul 9, 2017 via email

@ghoneycutt ghoneycutt merged commit 339f4a6 into sensu:master Jul 10, 2017
@ghoneycutt
Copy link
Collaborator

Released in v2.19.1

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.

$check_notify does not load sensu::enterprise::service
2 participants