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

Sensu puppet doesn't work correctly if started from crontab: "Package[sensu-plugin] has failures" #859

Closed
nagyt234 opened this issue Dec 19, 2017 · 1 comment

Comments

@nagyt234
Copy link

I'm using sensu-puppet with client/server configuration. If the client is started from the command line, which should update 1 check, it is working correctly:

root@v0402:/opt/puppetlabs/bin# /opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --verbose
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for v0402.zg-2.softxs.ch
Info: Applying configuration version '1513704250'
Notice: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]/command: command changed '/opt/sensu/embedded/bin/check-http.rb -t 60 -u http://poyry.softxs.ch/umaoya/login?audit-log=false' to '/opt/sensu/embedded/bin/check-http.rb -t 60 -u http://poyry.softxs.ch/umaoya/login?audit-log=false&a=b'
Info: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]: Scheduling refresh of Service[sensu-client]
Info: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]: Scheduling refresh of Service[sensu-server]
Notice: /Stage[main]/Sensu::Client::Service/Service[sensu-client]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Sensu::Server::Service/Service[sensu-server]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 7.99 seconds

However it the same operation is started from crontab, it doesn't work. There are a lot of messages like Dependency Package[sensu-plugin] has failures: true:

Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for v0402.zg-2.softxs.ch
Info: Applying configuration version '1513704135'
Notice: /Stage[main]/Sensu::Rabbitmq::Config/File[/etc/sensu/ssl]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Rabbitmq::Config/File[/etc/sensu/ssl/cert.pem]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Rabbitmq::Config/File[/etc/sensu/ssl/key.pem]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Rabbitmq::Config/File[/etc/sensu/conf.d/rabbitmq.json]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Rabbitmq::Config/Sensu_rabbitmq_config[v0402.zg-2.softxs.ch]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Api::Config/File[/etc/sensu/conf.d/api.json]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Api::Config/Sensu_api_config[v0402.zg-2.softxs.ch]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Redis::Config/File[/etc/sensu/conf.d/redis.json]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Redis::Config/Sensu_redis_config[v0402.zg-2.softxs.ch]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Client::Config/File[/etc/sensu/conf.d/client.json]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Client::Config/Sensu_client_config[v0402.zg-2.softxs.ch]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]/command: command changed '/opt/sensu/embedded/bin/check-http.rb -t 60 -u http://poyry.softxs.ch/umaoya/login?audit-log=false&a=b' to '/opt/sensu/embedded/bin/check-http.rb -t 60 -u http://poyry.softxs.ch/umaoya/login?audit-log=false'
Info: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]: Scheduling refresh of Service[sensu-client]
Info: /Stage[main]/Main/Node[v0402.zg-2.softxs.ch]/Setup_sensu_check[http]/Setup_sensu_check::One_check[poyry.softxs.ch-umaoya]/Sensu::Check[http-poyry.softxs.ch-umaoya]/Sensu_check[http-poyry.softxs.ch-umaoya]: Scheduling refresh of Service[sensu-server]
Notice: /Stage[main]/Sensu::Client::Service/Service[sensu-client]: Dependency Package[sensu-plugin] has failures: true
Info: /Stage[main]/Sensu::Client::Service/Service[sensu-client]: Unscheduling all events on Service[sensu-client]
Notice: /Stage[main]/Sensu::Api::Service/Service[sensu-api]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Server::Service/Service[sensu-server]: Dependency Package[sensu-plugin] has failures: true
Info: /Stage[main]/Sensu::Server::Service/Service[sensu-server]: Unscheduling all events on Service[sensu-server]
Notice: /Stage[main]/Sensu::Enterprise::Dashboard/Anchor[sensu::enterprise::dashboard::begin]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu::Enterprise::Dashboard/Anchor[sensu::enterprise::dashboard::end]: Dependency Package[sensu-plugin] has failures: true
Notice: /Stage[main]/Sensu/Anchor[sensu::end]: Dependency Package[sensu-plugin] has failures: true
Info: Stage[main]: Unscheduling all events on Stage[main]

Platform and version information

  • Your OS: Ubuntu 16.04
  • Your Ruby version:
root@v0402:~# ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
root@v0402:~# /opt/puppetlabs/puppet/bin/ruby -v
ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]
  • Your version of Puppet: open source 4.10.4 on server and client
  • Your version of Sensu: 0.26.5-2
  • Your version of this module: 2.2.0
@nagyt234
Copy link
Author

The problem is solved after upgrading to 2.42.0 on the server side:

puppet module upgrade sensu-sensu
puppet generate types --environment production

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

No branches or pull requests

1 participant