-
Notifications
You must be signed in to change notification settings - Fork 290
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
How do you use 'package' plugin provider with sensu::plugin define? #384
Comments
|
I think I've figured it out. It's simpler than I realised, with one massive caveat. Using the following pattern with the sensu module installs whatever is in the (in my case) $pkg_list = hiera_array('sensu::packages')
package {$pkg_list:
ensure => 'latest',
provider => 'sensu_gem',
}"sensu::packages": [
"sensu-plugins-memory-checks",
"sensu-plugins-disk-checks",
"sensu-plugins-cpu-checks",
"sensu-plugins-process-checks",
"sensu-plugins-load-checks"
]However, in the current implementation of the module, the permissions don't get set right on any of the embedded gems directories for Sensu to be able to access and run the scripts when the check runs. This seems to be a known issue as this functionality in To get around this, I added the following to the manifest that handles sensu installs across all my nodes and modified the $pkg_list = hiera_array('sensu::packages')
package {$pkg_list:
ensure => 'latest',
provider => 'sensu_gem',
notify => Exec['change-sensu-ownerships']
}
exec {'change-sensu-ownerships':
command => 'chmod 755 -R /opt/sensu/embedded',
path => '/usr/bin:/usr/sbin:/bin',
}It's not perfect, but it works. |
|
Don't know if it's worth adding this stuff to the documentation for the module or something until 2.0.0 gets released or whenever this functionality is complete. @garethr @jamtur01 @jlambert121 thoughts? |
|
@poolski sorry for the slow response on this, I'm not sure I'm following this issue completely (and it could just be because I don't use the gem provided plugins). If you install a plugin with provider => sensu_gem (as root) and the sensu user doesn't have access to the installed gems wouldn't that be more of an issue with either the provider or the underlying gem command? The exec seems like a really bad hack that hides the real issue rather than fixing it. |
|
Totally, I can't, however, think of a sensible way of dealing with this as sensu runs as the Not quite sure how to get around this :) |
|
@poolski running into a similar issue. Your solution helps, however I'm wondering if you've found a better solution to this? |
|
@brettswift So far... no. |
|
Seems that this is no longer an issue. Please re-open if this is not the case. Thank you! |
The new package provider is wonderful, but I'm experiencing a couple of issues:
root:rootwith insufficient access for the 'sensu' user. That makes the whole sensu process not work. Here's the stack trace:sensu::checkdefines? Are there any further steps that need to be taken or should I just be able to reference them as I do right now?I'm using the
masterbranch of the sensu-puppet module and sensu's embedded ruby, as I've not been able to work out how to make it play nice with system ruby.The text was updated successfully, but these errors were encountered: