Giter Site home page Giter Site logo

chef-monitor's People

Contributors

chrisroberts avatar jhmartin avatar jjasghar avatar jondot avatar jschneiderhan avatar portertech avatar spesnova avatar webframp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-monitor's Issues

Fix for check-log.rb to handly invalid UTF-8 characters

Hi all,

I was having some trouble with check-log.rb here. It crashed while parsing /var/log/syslog, because it found some really weird characters in there, which were logged e. g. together with strange GET requests. I fixed this for me applying the patch below, its a one liner. Maybe you want to consider applying this to the check, making it more robust, though it may drop some bytes now.

Kind Regards,

Philipp

@@ -106,6 +106,7 @@
@log.seek(@bytes_to_skip, File::SEEK_SET)
end
@log.each_line do |line|

  •  line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
    
    bytes_read += line.size
    if m = line.match(config[:pattern])
    if m[1]

Cannot find a resource matching service[redis6379]

The monitor master recipe doesn't work even if I try to put sensu::redis in front of it.

Starting Chef Client, version 11.16.2
resolving cookbooks for run list: ["sensu::redis", "sensu::rabbitmq", "monitor::master"]
Synchronizing Cookbooks:
  - apt
  - sensu
  - yum
  - chef_handler
  - windows
  - rabbitmq
  - yum-erlang_solutions
  - erlang
  - yum-epel
  - build-essential
  - redisio
  - ulimit
  - sudo
  - monitor
Compiling Cookbooks...

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/sensu/recipes/redis.rb
================================================================================

Chef::Exceptions::ResourceNotFound
----------------------------------
Cannot find a resource matching service[redis6379] (did you define it first?)

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/redisio/recipes/enable.rb:25:in `block in from_file'
  /var/chef/cache/cookbooks/redisio/recipes/enable.rb:23:in `each'
  /var/chef/cache/cookbooks/redisio/recipes/enable.rb:23:in `from_file'
  /var/chef/cache/cookbooks/sensu/recipes/redis.rb:23:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/redisio/recipes/enable.rb:

 18:  # limitations under the License.
 19:  #
 20:  
 21:  redis = node['redisio']
 22:  
 23:  redis['servers'].each do |current_server|
 24:    server_name = current_server["name"] || current_server["port"]
 25>>   resource = resources("service[redis#{server_name}]")
 26:    resource.action Array(resource.action)
 27:    resource.action << :start
 28:    resource.action << :enable
 29:  end
 30:  


Running handlers:
[2014-09-23T14:43:43+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-09-23T14:43:43+00:00] ERROR: Exception handlers complete
[2014-09-23T14:43:43+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 5.382873795 seconds
[2014-09-23T14:43:43+00:00] ERROR: Cannot find a resource matching service[redis6379] (did you define it first?)
[2014-09-23T14:43:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

"actions" filter doesn't work

The actions filter created by this cookbook doesn't work (at least in Sensu 0.12.6) because action is a symbol, not a string.

I don't know if this is due to a recent change in Sensu or if the filter has always been broken; either way see #19 for a fix.

Download the sensu community plugins?

This is more of a question than an issue, really. Why not just export the sensu-community-plugins, rather than roll your own into files/default/plugins? I'm in the process of modifying this cookbook to do just that (unless I find out I can't do it easily).

Handle split redis/api/rabbit hosts, hosted redis.

The rabbit/redis/api servers may be on different hosts (and perhaps not even search()able in the case of AWS hosted redis). It would be useful if the search blocks could be separated and also overrideable by a static value.

redis from source

Right now this cookbook uses a redis recipe which builds redis from source. Why is that?

Every modern linux distribution like ubuntu, centos contains a redis package. Using the default package would allow to use the security patches of the distribution and reduce the install complexity.

Remove dashboard_service

The sensu cookbook doesn't appear to include the sensu::dashboard_service recipe included in master.rb anymore, it probably needs to be removed or replaced with some other thing?

nagios_perfdata.rb should be robust against checks that are not reporting performance data

A failing check command like check_http (in case of port to be checked is not listening) does not necessarily have performance data appended. This results in sensu-server.log filling up with

... "extension":{"type":"extension","name":"nagios_perfdata"},"output":"undefined method `strip' for nil:NilClass","status":2}

Checking for a | in check[:output] before trying to split solves the problem

check  = event[:check]
output = check[:output]

        # https://www.nagios-plugins.org/doc/guidelines.html#AEN200
        if output.include? '|'
          perfdata = output.split('|').last.strip

...
       end

custom Graphite path prefix in nagios_perfdata.rb

Some users store their Graphite metrics to live.servers.myhost.mycheck, others in servers.live.myhost.mycheck etc ... So supporting a customizable path prefix would be really appriciated.

As an additional requirement this "live" is set in client[:environment] in the Sensu client config.

Dependency on librarian-chef

If you attempt to run test kitchen, it will throw the following error:

sowens-MBP:chef-monitor sowen$ kitchen create
-----> Starting Kitchen (v1.3.1)
!!!!!! The `librarian-chef' gem is missing and must be installed or cannot be properly activated. Run `gem install librarian-chef` or add the following to your Gemfile if you are using Bundler: `gem 'librarian-chef'`.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Could not load or activate Librarian-Chef (cannot load such file -- librarian/chef/environment)
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I suspect this has something to do with the chef-dk being installed. Even after installing librarian chef, I get the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.