Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

zabbix-ruby-client (5) Versions 0.0.12

Installs/Configures Zabbix-ruby-client

Policyfile
Berkshelf
Knife
cookbook 'zabbix-ruby-client', '~> 0.0.12', :supermarket
cookbook 'zabbix-ruby-client', '~> 0.0.12'
knife supermarket install zabbix-ruby-client
knife supermarket download zabbix-ruby-client
README
Dependencies
Changelog
Quality 17%

Zabbix Ruby Client Cookbook

Cookbook Version

This cookbook is designed for installing zabbix-ruby-client on an Ubuntu server, with zabbix-sender v2.2. It's based on the version 0.1.0 of zabbix-ruby-client (called zrc for short).

The principle of it is to use the chef client embedded ruby from /opt/chef/embedded/bin so there is no need to install a system or versionned ruby on all servers just for that.

Tested in the kitchen on

  • Ubuntu 12.04
  • Ubuntu 14.04
  • CentOs 5.10
  • CentOs 6.5

It should also work on RHEL 5 and 6, Oracle Linux 5 and 6, Debian 6 and 7.

It will install:

  • the zabbix source list for ubuntu
  • the zabbix-sender package
  • the zabbix-ruby-client from rubygems (or from github if node.zrc.development = true) using the chef embedded gemcommand
  • a /etc/default/zrc with a flag to run it or not
  • config.yml and tasks (minutely.yml) in /etc/zrc/
  • a zrc system user with a home in /var/lib/zrc
  • a data dir at /var/cache/zrc
  • a log dir at /var/log/zrc
  • a rotatelog config to rotate the logs every week
  • a bash wrapper in /usr/bin/zrc_send that launches zrc using the chef embedded ruby version
  • a cronfile gathering the triggering of all tasks at /etc/cron.d/zabbix

Attributes

Attribute Default Description
zrc.version "0.1.0" Version of the zabbix-ruby-client to install (if development is false)
zrc.enabled true If not enabled the cronjob is disabled
zrc.admin_email "root" email or unix account used in the .forward in the home of the zrc user
zrc.ruby_bin "/opt/chef/embedded/bin/ruby" path to the ruby used by zrc
zrc.gem_bin "/opt/chef/embedded/bin/gem" path to the gem command used to install zrc
zrc.binpath "/opt/chef/embedded/bin/zrc" path where the zrc command will be installed
zrc.zrc_send "1" if set to "0" disables the sending of data
zrc.development false if set to true, use github master branch rather than the published gem version
zrc.repo_url "https://github.com/eduvo/zabbix-ruby-client.git" if zrc.development is true, this repo will be used for getting the gem source
zrc.repo_branch "master" if zrc.development is true, this branch will be used for getting the gem source
zrc.server.host "localhost" url of the zabbix server
zrc.server.port "10051" port of the trapper daemon on the zabbix server
zrc.schedule see below schedule object used to build the tasks files and cron file

Default schedule

{
  "minutely": {
    "cron": "* * * * *",
    "tasks": [
      "load": null,
      "memory": null,
      "cpu": null
    ]
  },
  "hourly": {
    "cron": "0 * * * *",
    "tasks": [
      "apt": null
    ]
  },
  "monthly": {
    "cron": "0 0 1 * *",
    "tasks": [
      "sysinfo": null
    ]
  }
}

if you want to add values to the schedule, use normal in a role file. Note that you can append a number to the task name, it will be ignored and makes possible to have multiple calls to the same name.

For example I have a zrc-linode.json, which adds disk and network interface to the minutely task role with:

{
  "name": "zrc-linode",
  "chef_type": "role",
  "json_class": "Chef::Role",
  "description": "ZRC linode eth and disks",
  "normal_attributes": {
    "zrc": {
      "schedule": {
        "minutely": {
          "tasks": {
            "disk": "[ xvda, /, xvda ]",
            "network0": "[ eth0 ]",
            "network1": "[ eth1 ]"
          }
        }
      }
    }
  }
}

If you need to overwrite the default values, you can use overwrite_attributes.

Debugging

By setting zrc.zrc_send to '0', the cronjobs still run but they are not passed to zabbix_sender, they are sent to output, then sent to the admin_email, so you can check if the values are collected properly.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Contributors

License

Copyright 2013 Faria Systems - MIT license - created by mose at mose.com

Dependent cookbooks

logrotate ~> 1.6.0
git ~> 4.0.2

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Zabbix Ruby Client Cookbook CHANGELOG

0.0.12 - 2014-08-25

  • [mose] better attributes management. check the readme.

0.0.11 - 2014-08-25

  • [mose] breaking change transform tasks list from array to hash to it can be merged easier
  • [mose] fix kitchen tests

0.0.10 - 2014-08-24

  • [mose] fix on the zrc.enable syntax

0.0.9 - 2014-08-24

  • [mose] add a zrc.enabled attribute to inhibit cron job
  • [mose] ass a zrc.repo_url for development so a fork can be used for zabbix-ruby-client
  • [mose] ass a zrc.repo_branch for development so an arbitrary branch can be used for zabbix-ruby-client

0.0.8 - 2014-08-23

  • [mose] write tests using kitchen-docker
  • [mose] make tests work on mac when using docker-osx
  • [mose] refactor for centos compatibility
  • [mose] first publication on the Supermarket

0.0.1 - 2014-08-20

  • [mose] Initial preparation of the cookbook

Collaborator Number Metric
            

0.0.12 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.0.12 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.0.12 failed this metric

FC009: Resource attribute not recognised: zabbix-ruby-client/recipes/sender.rb:23
FC064: Ensure issues_url is set in metadata: zabbix-ruby-client/metadata.rb:1
FC065: Ensure source_url is set in metadata: zabbix-ruby-client/metadata.rb:1
FC066: Ensure chef_version is set in metadata: zabbix-ruby-client/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.0.12 passed this metric

Testing File Metric
            

0.0.12 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.0.12 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number