Giter Club home page Giter Club logo

monit-ng's People

Contributors

helgi avatar kcd83 avatar mattadair avatar maxnasonov avatar micred avatar nathwill avatar ninjatux avatar sakarikl avatar smt116 avatar stuporhero avatar szymonpk avatar vkhatri avatar webframp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

monit-ng's Issues

Undefined method or attribute `only_on' on `node'

Using Chef Client, version 11.18.0

I get the error

Chef::Mixin::Template::TemplateError (Undefined method or attribute only_on' onnode') on line #39:

37: <% @alert.each do |alert| %>
38: set alert <%= alert.name %>
39: <% if ! alert.only_on.nil? -%>
40: only on { <%= alert.only_on.join(', ') %>}
41: <% elsif ! alert.subscriptions.nil? -%>

Seems to be from the recent changes (today)

error : Status not available -- the monit daemon is not running

Hi,

I'm running monit-ng in chef-provisioning on Ubuntu 15.04, via:

    recipe "monit-ng"

I'm getting:

error    : Status not available -- the monit daemon is not running

This seems fixed when I do a

$ sudo monit

So I've added

execute "sudo monit"

to service.rb.

Do you have any suggestion on the matter ?
Thanks

make default subscribers and mailservers optional

hello! i am trying to manage monit configuration alone with chef role, but facing some issues.

  1. localhost is always set to first mailserver, where i want to configure it to something else for different location servers and the only way i get it right is overriding attribute in a chef role, but that does not get me so far as i need different config for different chef roles
  2. default root subscribers does not help my scenario much, at some places even local smtp is disabled

what do you think about having an attribute e.g. default['monit']['default_config']? which if set true, then below attributes will get default values otherwise not:

default['monit']['config']['subscribers']
default['monit']['config']['mail_servers']

i have PR ready if this sound good to you.

Kill switch capability on service start/restart?

It's a bit of an odd situation, but we have situations where monit is already installed and switched off while we're doing work on either the OS, Java applications, or the databases the Java applications use. In some cases we need a Chef run before we're actually done with the work, and in every case monit-ng sees the installed monit service not running and immediately enables and restarts it. This immediately brings up our apps before we're ready, causing a bit of havoc. We're currently working around it by unmonitoring everything before maintenance, but that has caused a couple of issues as you can imagine.

Would it be strange to have a default attribute that could be overridden so that the monit-ng cookbook won't touch the service for a start or restart?

Thanks!
-Matt

stop_as support?

Would you mind adding stop_as support? We're using monit to control applications that require a specific uid for both start AND stop.

fails rubocop

[nathwill@wyrd monit-ng]$ bundle exec rake rubocop
Running RuboCop...
Inspecting 23 files
..C...C.........C......

Offenses:

libraries/resource_monit_check.rb:121:24: C: Use %w or %W for array of words.
          'process' => ['pidfile', 'matching'], 'procmatch' => ['matching'],
                       ^^^^^^^^^^^^^^^^^^^^^^^
recipes/source.rb:109:13: C: Redundant curly braces around a hash parameter.
  variables({
            ^
recipes/source.rb:110:5: C: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.
    :platform_family => node['platform_family'],
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
recipes/source.rb:113:3: C: Indent the right brace the same as the first position after the preceding left parenthesis.
  })
  ^
attributes/default.rb:15:81: C: Line is too long. [82/80]
  monit['service_provider'] = Chef::Platform.find_provider_for_node node, :service
                                                                                ^^

23 files inspected, 5 offenses detected
RuboCop failed!

check_id is only used when check_type is set, but is required

I'm trying to mask monit instance restarts (because you restart it every Chef run) but this doesn't work:

monit_check 'localhost' do
  check_type   'system'
  alert        '[email protected]'
  but_not_on   true
  alert_events ['instance']
end

because

================================================================================
    Error executing action `create` on resource 'monit_check[localhost]'
    ================================================================================

    Chef::Exceptions::ValidationFailed
    ----------------------------------
    Required argument check_id is missing!

check_id is only used by the template when id_type is set... which isn't true in this situation. From your own resource:

def check_pairs
        {
          'process' => %w( pidfile matching ), 'procmatch' => %w( matching ),
          'file' => %w( path ), 'fifo' => %w( path ),
          'filesystem' => %w( path ), 'directory' => %w( path ),
          'host' => %w( address ), 'system' => %w(),
          'program' => %w( path )
        }
      end

Add template variable for monit check

There should be a way to override template name. Currently it is a hardcoded "monit.check.erb" value. I've added a request #68 but for some reason it is failing.

add extended resource types

it'd be nice to provide resources like monit_disk_check, monit_process_check, etc, that wrap the core monit_check resource and remove some of the redundancy of writing monit_check resources and specifying common stuff like id_type, etc.

including ubuntu recipe overwrites AWS mirrors

When using cloud-init or other similar tools they often change the base sources.list to point to a IaaS specific mirror (region specific or otherwise) for performance

-# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
-# newer versions of the distribution.
-deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty main
-deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty main
+deb http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
+deb-src http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse

Is anyone aware of how to make it not totally overwrite the hostname there? Haven't looked too deeply into the ubuntu recipe this cookbook sources

fails foodcritic

[nathwill@wyrd monit-ng]$ bundle exec rake foodcritic
FC009: Resource attribute not recognised: /home/nathwill/Public/Code/chef/cookbooks/monit-ng/recipes/config.rb:60
rake aborted!
FC009: Resource attribute not recognised: /home/nathwill/Public/Code/chef/cookbooks/monit-ng/recipes/config.rb:60

Provide more than one group for `monit_check`

Hi there,

It is possible to define more than one service's group in monit check configuration. However group attribute is defined as a String in monit-ng. What do you think about adding a support for multiple groups here?

It can be achieved in three ways:

  1. Change group to accept both, string and array types and recognize it in template.
  2. Rename group into groups and force everybody to use an array type even for a single item.
  3. Allow to use both, group and groups and add them in template.

Personally i would go with the first one as it seems to be the most "user friendly". What do you think? I can prepare a pull request if you agree on this.

chef 13 compatibility in monit.conf.erb (was Clarify configuration)

Can you provide examples of how to set the configuration in attribute files? It appears that they should be assigned arrays of hashes with the appropriate data elements, but this does not jive with the default template which apparently uses dot notation to try to access the data. Either the template should use the proper hash key syntax (for example mailserver['hostname'] instead of mailserver.hostname), or an example should be given demonstrating how this is supposed to be used so future users don't have to chase their tails for days trying to figure out what's wrong with their config.

Missing dependancies in Berksfile

I'm seeing dependancy resolution issues when using this cookbook. I believe this is due to not having the dependancies in metadata.rb referenced in the repo Berksfile, e.g.

metadata.rb
%w( yum-epel ubuntu apt build-essential dpkg_autostart ).each do |dep|
  depends dep
end

Should have the following in the Berksfile

Berksfile
cookbook 'yum-epel', '~> 2.1.2'
cookbook 'ubuntu', '~> 2.0.1'
cookbook 'apt', '~> 6.1.4'
cookbook 'build-essential', '~> 8.0.3'
cookbook 'dpkg_autostart', '~> 0.2.0'

Monit package missing from Debian Buster repo

        Recipe: monit-ng::install
         * apt_package[monit] action install
           * No candidate version available for monit
           ================================================================================
           Error executing action `install` on resource 'apt_package[monit]'
           ================================================================================

For some reason, the monit package has been moved to buster-backports. Thus the recipe monit-ng::install fails on Debian 10. I'm not sure what's the best way to fix it as enabling buster-backports does not feel like the responsibility of the monit-ng cookbook. Thoughts?

start/stop command limits

A 127-character limit for start/stop commands was added in 22c6eef. For some use cases I'm having to wrap long commands in a shell script because. Is the limit still necessary?

I'm running Monit 5.6 and have not seen any issues with commands being truncated.

fix foodcritic lint

foodcritic lint test throws below error.

FC002: Avoid string interpolation where not required: ./recipes/source.rb:29

submitting a PR.

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.