{"action":"created","issue":{"url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/956","labels_url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/956/comments","events_url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/956/events","html_url":"https://github.com/sensu/sensu-community-plugins/issues/956","id":54301101,"number":956,"title":"sensu-community remediation handler causes multiple server instances to spawn on restart + funkyness","user":{"login":"nzspambot","id":8730013,"avatar_url":"https://avatars.githubusercontent.com/u/8730013?v=3","gravatar_id":"","url":"https://api.github.com/users/nzspambot","html_url":"https://github.com/nzspambot","followers_url":"https://api.github.com/users/nzspambot/followers","following_url":"https://api.github.com/users/nzspambot/following{/other_user}","gists_url":"https://api.github.com/users/nzspambot/gists{/gist_id}","starred_url":"https://api.github.com/users/nzspambot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzspambot/subscriptions","organizations_url":"https://api.github.com/users/nzspambot/orgs","repos_url":"https://api.github.com/users/nzspambot/repos","events_url":"https://api.github.com/users/nzspambot/events{/privacy}","received_events_url":"https://api.github.com/users/nzspambot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-14T09:34:30Z","updated_at":"2015-01-15T05:10:10Z","closed_at":null,"body":"Hi, (I've also posted this here:https://groups.google.com/forum/#!topic/sensu-users/Uxnw6n2JRfo)\r\n\r\nI am trying to get this plugin ( https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb [latest commit ~6days old ) up and running however I seem to have run into a issue.\r\n\r\nWhen I place that file for loading along with this json file:\r\n```\r\n{\r\n \"handlers\": {\r\n   \"remediator\": {\r\n     \"type\": \"pipe\",\r\n     \"command\": \"/etc/sensu/extensions/handlers/sensu.rb\"     \r\n    }\r\n  }\r\n}\r\n```\r\nand issue a restart of sensu-server, the server stops, appears to start (ie the logs are indicating startup) BUT the console is unresponsive and I see this happen:\r\n\r\nBEFORE RESTART:\r\n\r\n```root@aws-ap-se-2-sgelk:/etc/fluentd# ps -ef | grep sensu\r\nsensu     1626     1  0 Jan10 ?        00:02:06 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-client -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-client.pid -l /var/log/sensu/sensu-client.log -L info\r\nroot      1704     1  0 Jan10 ?        00:00:00 su -s /bin/sh uchiwa -c cd /opt/uchiwa/src && exec \"/opt/uchiwa/bin/uchiwa\" -c /etc/sensu/uchiwa.json -p /opt/uchiwa/src/public\r\nuchiwa    1708  1704  0 Jan10 ?        00:01:30 /opt/uchiwa/bin/uchiwa -c /etc/sensu/uchiwa.json -p /opt/uchiwa/src/public\r\nsensu    31391     1  0 08:39 ?        00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-server -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-server.pid -l /var/log/sensu/sensu-server.log -L info\r\nsensu    31433     1  0 08:39 ?        00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-api -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-api.pid -l /var/log/sensu/sensu-api.log -L info```\r\n\r\n\r\nAFTER/DURING RESTART:\r\n\r\n```root@aws-ap-se-2-sgelk:/etc/fluentd# ps -ef | grep sensu\r\nsensu     1626     1  0 Jan10 ?        00:02:06 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-client -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-client.pid -l /var/log/sensu/sensu-client.log -L info\r\nroot      1704     1  0 Jan10 ?        00:00:00 su -s /bin/sh uchiwa -c cd /opt/uchiwa/src && exec \"/opt/uchiwa/bin/uchiwa\" -c /etc/sensu/uchiwa.json -p /opt/uchiwa/src/public\r\nuchiwa    1708  1704  0 Jan10 ?        00:01:30 /opt/uchiwa/bin/uchiwa -c /etc/sensu/uchiwa.json -p /opt/uchiwa/src/public\r\nsensu    31433     1  0 08:39 ?        00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-api -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-api.pid -l /var/log/sensu/sensu-api.log -L info\r\nroot     31882 11209  0 08:48 pts/3    00:00:00 /bin/bash /etc/init.d/sensu-server restart\r\nroot     31883 31882  0 08:48 pts/3    00:00:00 /bin/bash /etc/init.d/sensu-service server restart\r\nsensu    31910 31883  2 08:48 pts/3    00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-server -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-server.pid -l /var/log/sensu/sensu-server.log -L info\r\nsensu    31912 31910  0 08:48 ?        00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-server -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-server.pid -l /var/log/sensu/sensu-server.log -L info\r\nsensu    31915 31912  0 08:48 ?        00:00:00 /opt/sensu/embedded/bin/ruby /opt/sensu/bin/sensu-server -b -c /etc/sensu/config.json -d /etc/sensu/conf.d -e /etc/sensu/extensions -p /var/run/sensu/sensu-server.pid -l /var/log/sensu/sensu-server.log -L info```\r\n\r\nso 3x instances of sensu-server.\r\n\r\nI have tested it with the embedded ruby and a standard ruby:\r\n\r\n```root@aws-ap-se-2-sgelk:/etc/sensu/extensions/handlers# ruby --version\r\nruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]\r\nroot@aws-ap-se-2-sgelk:/etc/sensu/extensions/handlers# /opt/sensu/embedded/bin/ruby --version\r\nruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]```\r\n\r\nThis is occuring on 2 seperate Ubuntu 14.04 instances as well:\r\n\r\n```root@aws-ap-se-2-sgelk:/etc/sensu/extensions/handlers# uname -a\r\nLinux aws-ap-se-2-sgelk 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux```\r\n\r\nand sensu-plugin (1.1.0)\r\n\r\nI've also notice this pops up in the logs when terminating the sensu-server:\r\n```\r\n^C/var/lib/gems/1.9.1/gems/sensu-plugin-1.1.0/lib/sensu-plugin/utils.rb:23:in `read': Interrupt\r\n        from /var/lib/gems/1.9.1/gems/sensu-plugin-1.1.0/lib/sensu-plugin/utils.rb:23:in `read_event'\r\n        from /var/lib/gems/1.9.1/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:53:in `block in <class:Handler>'\r\n```\r\n\r\n\r\nAny idea? I'm a bit stumped and would love to get this working.\r\n\r\nI've also noticed that the .rb file doesn't even appear in the logs when starting up, almost like it is blocked somehow.\r\n\r\nthanks"},"comment":{"url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/comments/70040604","html_url":"https://github.com/sensu/sensu-community-plugins/issues/956#issuecomment-70040604","issue_url":"https://api.github.com/repos/sensu/sensu-community-plugins/issues/956","id":70040604,"user":{"login":"nzspambot","id":8730013,"avatar_url":"https://avatars.githubusercontent.com/u/8730013?v=3","gravatar_id":"","url":"https://api.github.com/users/nzspambot","html_url":"https://github.com/nzspambot","followers_url":"https://api.github.com/users/nzspambot/followers","following_url":"https://api.github.com/users/nzspambot/following{/other_user}","gists_url":"https://api.github.com/users/nzspambot/gists{/gist_id}","starred_url":"https://api.github.com/users/nzspambot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzspambot/subscriptions","organizations_url":"https://api.github.com/users/nzspambot/orgs","repos_url":"https://api.github.com/users/nzspambot/repos","events_url":"https://api.github.com/users/nzspambot/events{/privacy}","received_events_url":"https://api.github.com/users/nzspambot/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T05:10:10Z","updated_at":"2015-01-15T05:10:10Z","body":"some debugging has found that this \r\n\r\n```\r\nrequire 'rubygems' if RUBY_VERSION < '1.9.0'\r\nrequire 'sensu-handler'\r\n\r\nclass Show < Sensu::Handler\r\n  def handle\r\n    puts 'Settings: ' + settings.to_hash.inspect\r\n    puts 'Event: ' + @event.inspect\r\n  end\r\nend\r\n```\r\n\r\nwill also cause this issue and the fault seems to lie with the \r\n\r\n```\r\nrequire 'sensu-handler'\r\n```\r\n\r\n\r\n"}}