From 53b595c4acffdbaac5f95600909a0f688937f591 Mon Sep 17 00:00:00 2001 From: Ivan Evtukhovich Date: Fri, 20 Sep 2013 17:16:21 +0400 Subject: [PATCH] start point --- .chef/encrypted_data_bag_secret | 11 + .gitignore | 9 + Cheffile | 54 + Cheffile.lock | 147 + Gemfile | 3 + Gemfile.lock | 61 + Vagrantfile | 20 + data_bags/.gitkeep | 0 data_bags/db/databases.json | 10 + data_bags/db/users.json | 6 + data_bags/zabbix/databases.json | 10 + data_bags/zabbix/users.json | 11 + environments/.gitkeep | 0 inhouse-cookbooks/.gitkeep | 0 inhouse-cookbooks/base/attributes/default.rb | 2 + inhouse-cookbooks/base/libraries/mail.rb | 28 + inhouse-cookbooks/base/libraries/network.rb | 83 + inhouse-cookbooks/base/libraries/report.rb | 16 + inhouse-cookbooks/base/metadata.rb | 5 + inhouse-cookbooks/base/recipes/default.rb | 45 + inhouse-cookbooks/base/recipes/hvm.rb | 31 + .../fake/files/default/zbx_templates.xml | 6783 +++++++++++++++++ inhouse-cookbooks/fake/metadata.rb | 5 + inhouse-cookbooks/fake/recipes/after.rb | 4 + inhouse-cookbooks/fake/recipes/before.rb | 1 + .../fake/recipes/zabbix-screens.rb | 50 + inhouse-cookbooks/fake/recipes/zabbix.rb | 57 + roles/.gitkeep | 0 roles/base.rb | 14 + roles/redmine.rb | 6 + roles/zbx.rb | 6 + 31 files changed, 7478 insertions(+) create mode 100644 .chef/encrypted_data_bag_secret create mode 100644 .gitignore create mode 100644 Cheffile create mode 100644 Cheffile.lock create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Vagrantfile create mode 100644 data_bags/.gitkeep create mode 100644 data_bags/db/databases.json create mode 100644 data_bags/db/users.json create mode 100644 data_bags/zabbix/databases.json create mode 100644 data_bags/zabbix/users.json create mode 100644 environments/.gitkeep create mode 100644 inhouse-cookbooks/.gitkeep create mode 100644 inhouse-cookbooks/base/attributes/default.rb create mode 100644 inhouse-cookbooks/base/libraries/mail.rb create mode 100644 inhouse-cookbooks/base/libraries/network.rb create mode 100644 inhouse-cookbooks/base/libraries/report.rb create mode 100644 inhouse-cookbooks/base/metadata.rb create mode 100644 inhouse-cookbooks/base/recipes/default.rb create mode 100644 inhouse-cookbooks/base/recipes/hvm.rb create mode 100644 inhouse-cookbooks/fake/files/default/zbx_templates.xml create mode 100644 inhouse-cookbooks/fake/metadata.rb create mode 100644 inhouse-cookbooks/fake/recipes/after.rb create mode 100644 inhouse-cookbooks/fake/recipes/before.rb create mode 100644 inhouse-cookbooks/fake/recipes/zabbix-screens.rb create mode 100644 inhouse-cookbooks/fake/recipes/zabbix.rb create mode 100644 roles/.gitkeep create mode 100644 roles/base.rb create mode 100644 roles/redmine.rb create mode 100644 roles/zbx.rb diff --git a/.chef/encrypted_data_bag_secret b/.chef/encrypted_data_bag_secret new file mode 100644 index 0000000..d2fd9b6 --- /dev/null +++ b/.chef/encrypted_data_bag_secret @@ -0,0 +1,11 @@ +CmwCmc4LhWxu2lTy1jFkfy8Z3OElekkgTDZgHKM+ut/5pZ7lLhOOunYC9Pr/BH+O +Utrp7O+jW2Is9A6zDc+7oF6MzMcpVmvh5XRXfde7HA+8VbdqqbquOMu/m8/vj9V/ +h5VVTW+9xYiydCh0kUfidUZSVf50dEA+gKSKrKC4SR2PaLIZIXM18W0xsH8EaKjs +qG1fK2wi04zA+XzdlvD1u11eMpy6xcyQmj8+kko8g9vNk0bP5qgfO/QcTIjA/Icd +5DsUKbeD4Ts4VjhVhepQzD9xA3xg6pRv7qxDC1PYYDl3tNZ/hxsolNTH7piANfQg +01AXKqBfOaWJ75Rg/BvmAiH3CvLKb1x5wINyLuIaiZAY/oF5PzlzidVv9liJChLm +GrM7ihXlKMn2S0+z8Y++4e0swznZkBlJHhF35jNIt/QZT5wrok7jJyk1XeuhIOpY +RgY9bxrBhEq1PPF4AwRN7my7U7K4u2iN7w306pBRBwlB3oU9g73UD3WxXkjX8LsS +01x8HrA6oORrqkBgRhnP9uGULy22sWsb6nszYugSAnvRtgPEKCt2B0B/wndIvowk +rVfUm4Gu7WWdcEGVMqjEaBKQIoauOs3iJ4TujaahE4Ffs9/BOqc6pwIPGArGPr0u +NymyUQBdLh7j8w51E0LVW/J5K4MlJ6WnBU0BOO629nc= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..260323c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.vagrant +*~ +*# +.#* +\#*# +.*.sw[a-z] +*.un~ +/cookbooks +tmp/ diff --git a/Cheffile b/Cheffile new file mode 100644 index 0000000..dc8c403 --- /dev/null +++ b/Cheffile @@ -0,0 +1,54 @@ +site 'http://community.opscode.com/api/v1' + +cookbook 'base', :path => 'inhouse-cookbooks/base' + +cookbook 'fake', :path => 'inhouse-cookbooks/fake' + +cookbook "timezone", + :git => "git@github.com:express42-cookbooks/timezone.git" + +cookbook "sysctl", + :git => "git@github.com:express42-cookbooks/sysctl.git" + +cookbook "apt", + :git => "git@github.com:opscode-cookbooks/apt.git" + +cookbook "ntp", + :git => "https://github.com/opscode-cookbooks/ntp.git" + +cookbook "user", + :git => "https://github.com/fnichol/chef-user.git" + +cookbook "sudo", + :git => "git@github.com:express42-cookbooks/sudo.git" + +cookbook "lvm", + :git => "https://github.com/opscode-cookbooks/lvm.git" + +cookbook "zabbix", + :git => "git@github.com:express42-cookbooks/zabbix.git" + +cookbook "zabbix-server", + :git => "git@github.com:express42-cookbooks/zabbix-server.git" + +cookbook "partition", + :git => "git@github.com:express42-cookbooks/partition.git" + +cookbook "postgresql", + :git => "git@github.com:express42-cookbooks/postgresql.git" + +cookbook "php", + :git => "git@github.com:express42-cookbooks/php.git" + +cookbook "nginx", + :git => "git@github.com:evilmartians/chef-nginx.git" + +cookbook "ruby", + :git => "git@github.com:express42-cookbooks/ruby.git" + +cookbook "redmine", + :git => "git@github.com:express42-cookbooks/redmine.git" + +cookbook "runit", + :git => "git@github.com:express42-cookbooks/runit.git" + diff --git a/Cheffile.lock b/Cheffile.lock new file mode 100644 index 0000000..00fd45f --- /dev/null +++ b/Cheffile.lock @@ -0,0 +1,147 @@ +GIT + remote: git@github.com:evilmartians/chef-nginx.git + ref: master + sha: d0084e014b469a79ad7ab90635e20a06cbcafbe3 + specs: + nginx (2.2.0) + +GIT + remote: git@github.com:express42-cookbooks/partition.git + ref: master + sha: 2fa3aa3b1c9badaebcaeb63f05db37b138dec369 + specs: + partition (0.2.0) + lvm (>= 0.8.6) + zabbix (>= 0.1.1) + +GIT + remote: git@github.com:express42-cookbooks/php.git + ref: master + sha: 4764b5b668462208740f7eda1f4ddc5182d0ea1f + specs: + php (0.1.0) + +GIT + remote: git@github.com:express42-cookbooks/postgresql.git + ref: master + sha: ccf15076a95dc50059ff9cbc06cb6028d217341c + specs: + postgresql (0.2.3) + +GIT + remote: git@github.com:express42-cookbooks/redmine.git + ref: master + sha: d050e49e9de3f6c4d3f945fd858d3a5c8c079c7f + specs: + redmine (2.0.0) + +GIT + remote: git@github.com:express42-cookbooks/ruby.git + ref: master + sha: 4cfa866373fb90dcb8ad4484d7eabceb5e56c5d5 + specs: + ruby (0.1.2) + +GIT + remote: git@github.com:express42-cookbooks/runit.git + ref: master + sha: d2e2f0bb1cd131db0d36f0baf4429585e0c360e4 + specs: + runit (0.14.3) + +GIT + remote: git@github.com:express42-cookbooks/sudo.git + ref: master + sha: e76baf470e25dac18014b423aa712b854c87d94c + specs: + sudo (1.1.1) + +GIT + remote: git@github.com:express42-cookbooks/sysctl.git + ref: master + sha: ceca1b382f1cc434d3ba43502c301bfbe7c9ffbb + specs: + sysctl (0.2.2) + +GIT + remote: git@github.com:express42-cookbooks/timezone.git + ref: master + sha: cd8e67dd1076264b0d2ea0864432b74eaefffc8a + specs: + timezone (0.1.0) + +GIT + remote: git@github.com:express42-cookbooks/zabbix-server.git + ref: master + sha: 8ee553759285af2bdb1ae3ce4261de8a0ee3f31b + specs: + zabbix-server (0.1.0) + lvm (>= 0.8.6) + nginx (>= 2.2.0) + partition (>= 0.1.0) + +GIT + remote: git@github.com:express42-cookbooks/zabbix.git + ref: master + sha: ef96256ef9848f0332a9249e89f46e006ae58b60 + specs: + zabbix (0.2.0) + +GIT + remote: git@github.com:opscode-cookbooks/apt.git + ref: master + sha: b58c75536300794e5b5ffa8747fc9e6c48a4e5ce + specs: + apt (2.1.1) + +GIT + remote: https://github.com/fnichol/chef-user.git + ref: master + sha: ce45d05e13491a82cbb5a2c36292391f3a1aaa36 + specs: + user (0.3.1) + +GIT + remote: https://github.com/opscode-cookbooks/lvm.git + ref: master + sha: 5f76a85d4bf5ea56b37bf85e8326a8d7386f7054 + specs: + lvm (0.8.13) + +GIT + remote: https://github.com/opscode-cookbooks/ntp.git + ref: master + sha: 6e47826c939add35cec2a5b528cd187c7eb3f3b6 + specs: + ntp (1.4.1) + +PATH + remote: inhouse-cookbooks/base + specs: + base (0.1.0) + +PATH + remote: inhouse-cookbooks/fake + specs: + fake (0.1.0) + +DEPENDENCIES + apt (>= 0) + base (>= 0) + fake (>= 0) + lvm (>= 0) + nginx (>= 0) + ntp (>= 0) + partition (>= 0) + php (>= 0) + postgresql (>= 0) + redmine (>= 0) + ruby (>= 0) + runit (>= 0) + sudo (>= 0) + sysctl (>= 0) + timezone (>= 0) + user (>= 0) + zabbix (>= 0) + zabbix-server (>= 0) + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..120390c --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'librarian-chef' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..203e218 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,61 @@ +GEM + remote: https://rubygems.org/ + specs: + archive-tar-minitar (0.5.2) + chef (11.6.0) + erubis + highline (>= 1.6.9) + json (>= 1.4.4, <= 1.7.7) + mixlib-authentication (>= 1.3.0) + mixlib-cli (~> 1.3.0) + mixlib-config (>= 1.1.2) + mixlib-log (>= 1.3.0) + mixlib-shellout + net-ssh (~> 2.6) + net-ssh-multi (~> 1.1.0) + ohai (>= 0.6.0) + rest-client (>= 1.0.4, < 1.7.0) + yajl-ruby (~> 1.1) + erubis (2.7.0) + highline (1.6.19) + ipaddress (0.8.0) + json (1.7.7) + librarian (0.1.0) + highline + thor (~> 0.15) + librarian-chef (0.0.1) + archive-tar-minitar (>= 0.5.2) + chef (>= 0.10) + librarian (~> 0.1.0) + mime-types (1.25) + mixlib-authentication (1.3.0) + mixlib-log + mixlib-cli (1.3.0) + mixlib-config (1.1.2) + mixlib-log (1.6.0) + mixlib-shellout (1.2.0) + net-ssh (2.6.8) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + net-ssh-multi (1.1) + net-ssh (>= 2.1.4) + net-ssh-gateway (>= 0.99.0) + ohai (6.18.0) + ipaddress + mixlib-cli + mixlib-config + mixlib-log + mixlib-shellout + systemu + yajl-ruby + rest-client (1.6.7) + mime-types (>= 1.16) + systemu (2.5.2) + thor (0.17.0) + yajl-ruby (1.1.0) + +PLATFORMS + ruby + +DEPENDENCIES + librarian-chef diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..b6ad5af --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,20 @@ +Vagrant.configure("2") do |config| + config.vm.define :etalon do |main| + main.vm.box = "ubuntu12.04-chef11-chruby" + main.vm.hostname = "etalon" + config.vm.network :forwarded_port, guest: 8080, host: 7070 + main.vm.provider :virtualbox do |vb| + vb.customize ["modifyvm", :id, "--memory", "2048"] + end + main.vm.provision :chef_solo do |chef| + chef.log_level = :info + chef.roles_path = "roles" + chef.data_bags_path = "data_bags" + # Here the path to secret file on local filesystem + chef.encrypted_data_bag_secret_key_path = "./.chef/encrypted_data_bag_secret" + + chef.add_role "base" + chef.add_role "redmine" + end + end +end diff --git a/data_bags/.gitkeep b/data_bags/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data_bags/db/databases.json b/data_bags/db/databases.json new file mode 100644 index 0000000..99bfd5e --- /dev/null +++ b/data_bags/db/databases.json @@ -0,0 +1,10 @@ +{ + "id": "databases", + "databases": { + "redmine": { + "options": { + "owner": "redmine" + } + } + } +} diff --git a/data_bags/db/users.json b/data_bags/db/users.json new file mode 100644 index 0000000..553684d --- /dev/null +++ b/data_bags/db/users.json @@ -0,0 +1,6 @@ +{ + "id": "users", + "users": { + "redmine": {} + } +} diff --git a/data_bags/zabbix/databases.json b/data_bags/zabbix/databases.json new file mode 100644 index 0000000..45db394 --- /dev/null +++ b/data_bags/zabbix/databases.json @@ -0,0 +1,10 @@ +{ + "id": "databases", + "databases": { + "zabbix": { + "options": { + "owner": "zabbix" + } + } + } +} diff --git a/data_bags/zabbix/users.json b/data_bags/zabbix/users.json new file mode 100644 index 0000000..e5aa1a4 --- /dev/null +++ b/data_bags/zabbix/users.json @@ -0,0 +1,11 @@ +{ + "id": "users", + "users": { + "zabbix": { + "options": { + "password": "yosJVAtYa4L4F7Q", + "superuser": false + } + } + } +} diff --git a/environments/.gitkeep b/environments/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/inhouse-cookbooks/.gitkeep b/inhouse-cookbooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/inhouse-cookbooks/base/attributes/default.rb b/inhouse-cookbooks/base/attributes/default.rb new file mode 100644 index 0000000..edbab6e --- /dev/null +++ b/inhouse-cookbooks/base/attributes/default.rb @@ -0,0 +1,2 @@ +default['base']['packages'] = %w{sudo nscd screen vim curl sysstat gdb dstat tcpdump strace iozone3 htop tmux byobu mailutils ncdu mosh iotop atop} +default['base']['extra-packages'] = [] diff --git a/inhouse-cookbooks/base/libraries/mail.rb b/inhouse-cookbooks/base/libraries/mail.rb new file mode 100644 index 0000000..9577ac7 --- /dev/null +++ b/inhouse-cookbooks/base/libraries/mail.rb @@ -0,0 +1,28 @@ +require 'rubygems' + +module Express42 + class MailHandler < Chef::Handler + def initialize(from_address, to_address) + @from_address = from_address + @to_address = to_address + end + + def report + require 'pony' + # The Node is available as +node+ + subject = "Chef run failed on #{node.name}" + # +run_status+ is a value object with all of the run status data + message = "#{run_status.formatted_exception}\n" + # Join the backtrace lines. Coerce to an array just in case. + message << Array(backtrace).join("\n") + + Pony.mail( + :to => @to_address, + :from => @from_address, + :subject => subject, + :body => message) + + end + end +end + diff --git a/inhouse-cookbooks/base/libraries/network.rb b/inhouse-cookbooks/base/libraries/network.rb new file mode 100644 index 0000000..4284024 --- /dev/null +++ b/inhouse-cookbooks/base/libraries/network.rb @@ -0,0 +1,83 @@ +begin + require 'ipaddr' +rescue LoadError + Chef::Log.error("Missing gem 'ipaddr'") +end + +module Express42 + module Base + module Network + + def net_get_networks(the_node=node) + networks = { :private => [], :public => [] } + + private_conditions = [] + public_exclusions = [] + + private_conditions << net1 = IPAddr.new("192.168.0.0/16") + private_conditions << net2 = IPAddr.new("172.16.0.0/12") + private_conditions << net3 = IPAddr.new("10.0.0.0/8") + + public_exclusions << net4 = IPAddr.new("127.0.0.1/8") + public_exclusions << net5 = IPAddr.new("169.254.0.0/16") + + the_node["network"]["interfaces"].each do |interface| + next if not interface[1]["addresses"] or interface[1]["state"] == "down" + + ip_addr = interface[1]["addresses"].select { |address, data| data["family"] == "inet" }.to_a[0] + next if ip_addr.nil? + ip_addr = ip_addr[0] + + + if private_conditions.detect{ |pc| pc.include?(ip_addr) } + networks[:private] << [ interface[0], ip_addr ] + next + end + if not private_conditions.detect { |pc| pc.include?(ip_addr) } and not public_exclusions.each.detect { |pe| pe.include?(ip_addr) } + networks[:public] << [ interface[0], ip_addr ] + next + end + + end + return networks + end + + def net_get_all_ip(the_node=node) + ips=[] + networks = net_get_networks(the_node) + networks.each_pair do |cond,eth_ip_array| + eth_ip_array.each do |eth_ip| + ips << eth_ip[1] + end + end + return ips + end + + def net_get_public(the_node=node) + return net_get_networks(the_node)[:public] + end + + def net_get_private(the_node=node) + return net_get_networks(the_node)[:private] + end + + def get_private_ip_by_role(role) + if n = search(:node, "role:#{role} AND chef_environment:#{node.chef_environment}").first + net_get_private(n)[0][1] + else + raise "Role #{role} not found" + end + end + + def get_public_ip_by_role(role) + if n = search(:node, "role:#{role} AND chef_environment:#{node.chef_environment}").first + net_get_public(n)[0][1] + else + raise "Role #{role} not found" + end + end + + + end + end +end diff --git a/inhouse-cookbooks/base/libraries/report.rb b/inhouse-cookbooks/base/libraries/report.rb new file mode 100644 index 0000000..cdc4953 --- /dev/null +++ b/inhouse-cookbooks/base/libraries/report.rb @@ -0,0 +1,16 @@ +require 'rubygems' + +module Express42 + class ReportHandler < Chef::Handler + def initialize + end + + def report + run_status.updated_resources.each do |r| + puts r.to_s + end + end + end +end + + diff --git a/inhouse-cookbooks/base/metadata.rb b/inhouse-cookbooks/base/metadata.rb new file mode 100644 index 0000000..f99ce52 --- /dev/null +++ b/inhouse-cookbooks/base/metadata.rb @@ -0,0 +1,5 @@ +maintainer "LLC Express 42" +maintainer_email "info@express42.com" +license "MIT" +description "Installs/Configures base" +version "0.1.0" diff --git a/inhouse-cookbooks/base/recipes/default.rb b/inhouse-cookbooks/base/recipes/default.rb new file mode 100644 index 0000000..880a669 --- /dev/null +++ b/inhouse-cookbooks/base/recipes/default.rb @@ -0,0 +1,45 @@ +# +# Cookbook Name:: base +# Recipe:: default +# +# Author:: LLC Express 42 (info@express42.com) +# +# Copyright (C) LLC 2012 Express 42 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do +# so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class Chef::Recipe + include Express42::Base::Network +end + +apt_repository "express42-obs" do + action :add + uri "http://repos.express42.com:/web/precise/ ./" + key 'http://repos.express42.com:/web/precise/Release.key' +end + +(node['base']['packages'] + node['base']['extra-packages']).uniq.each do |pkg| + package pkg +end + +chef_gem "pony" + +Chef::Config.exception_handlers = [Express42::MailHandler.new('chef@project.ru', ['admin@project.ru'])] +Chef::Config.report_handlers = [Express42::ReportHandler.new] diff --git a/inhouse-cookbooks/base/recipes/hvm.rb b/inhouse-cookbooks/base/recipes/hvm.rb new file mode 100644 index 0000000..72a3047 --- /dev/null +++ b/inhouse-cookbooks/base/recipes/hvm.rb @@ -0,0 +1,31 @@ +# +# Cookbook Name:: base +# Recipe:: hvm +# +# Author:: LLC Express 42 (info@express42.com) +# +# Copyright (C) LLC 2012 Express 42 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do +# so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +%w{qemu-kvm libvirt-bin bridge-utils}.each do |pkg| + package pkg +end + diff --git a/inhouse-cookbooks/fake/files/default/zbx_templates.xml b/inhouse-cookbooks/fake/files/default/zbx_templates.xml new file mode 100644 index 0000000..451631e --- /dev/null +++ b/inhouse-cookbooks/fake/files/default/zbx_templates.xml @@ -0,0 +1,6783 @@ + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Chef client is not running + 0 + {Chef_Template:proc.num[,,,"chef/client.rb"].max(600)}=0 + + 0 + 1 + + + + + + Number of chef processes + + 60 + 2 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Chef Client + + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Load Average too high + 0 + ({CPU_Template:system.cpu.load[,avg1].avg(900)}>(4*{CPU_Template:system.cpu.num.last(0)})) | ({CPU_Template:system.cpu.load[,avg1].avg(1800)}>(2*{CPU_Template:system.cpu.num.last(0)})) + + 0 + 4 + Components: System + + + + + Load Avearge 15 + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Load Average current + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Load Average 5 + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Number of CPU + + 600 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Total CPU context switches + + 60 + 7 + 365 + 0 + 0 + times + 0 + 0 + 0 + 0 + + + 0 + + + + + diff("system.cpu.switches") + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU context switches + + 60 + 7 + 365 + 0 + 0 + times + 0 + 0 + 0 + 0 + + + 0 + + + + + change(system.cpu.switches) + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 0 + EE00EE + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 4 + 009999 + 0 + 2 + 0 + 5 + + + 0 + 1 + FF0000 + 0 + 2 + 0 + 5 + + + 0 + 3 + 444444 + 0 + 2 + 0 + 5 + + + 0 + 2 + 0000EE + 0 + 2 + 0 + 5 + + + 0 + 0 + FF33FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 1 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 0 + 777700 + 0 + 2 + 0 + 5 + + + 2 + 2 + 444400 + 0 + 2 + 0 + 5 + + + 2 + 1 + 000000 + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Free inodes on /, 0% + 0 + {FileSystem_Root_Template:vfs.fs.inode[/,pfree].last(0)}=0 + + 0 + 5 + Components: System + + + Free inodes on /, 10% + 0 + {FileSystem_Root_Template:vfs.fs.inode[/,pfree].last(0)}<10 + + 0 + 3 + Components: System + + + Free inodes on /, 5% + 0 + {FileSystem_Root_Template:vfs.fs.inode[/,pfree].last(0)}<5 + + 0 + 4 + Components: System + + + Free space on /, 0% + 0 + {FileSystem_Root_Template:vfs.fs.size[/,pused].last(0)}=100 + + 0 + 5 + Components: System + + + Free space on /, 10% + 0 + {FileSystem_Root_Template:vfs.fs.size[/,pused].last(0)}>90 | {FileSystem_Root_Template:vfs.fs.size[/,free].last(0)}< 1000000000 + + 0 + 3 + Components: System + + + Free space on /, 20% + 0 + {FileSystem_Root_Template:vfs.fs.size[/,pused].last(0)}>80 + + 0 + 2 + Components: System + + + Free inodes on /, 15% + 0 + {FileSystem_Root_Template:vfs.fs.inode[/,pfree].last(0)}<15 + + 0 + 2 + Components: System + + + Free space on /, 5% + 0 + {FileSystem_Root_Template:vfs.fs.size[/,pused].last(0)}>95 + + 0 + 4 + Components: System + + + + + Free number of inodes on $1 + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free number of inodes on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Total number of inodes on $1 + + 6000 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Used disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Total disk space on $1 + + 6000 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Used disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + 009900 + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Free space on /var, 20% + 0 + {FileSystem_Var_Template:vfs.fs.size[/var,pused].last(0)}>80 + + 0 + 2 + Components: System + + + Free inodes on /var, 5% + 0 + {FileSystem_Var_Template:vfs.fs.inode[/var,pfree].last(0)}<5 + + 0 + 4 + Components: System + + + Free inodes on /var, 0% + 0 + {FileSystem_Var_Template:vfs.fs.inode[/var,pfree].last(0)}=0 + + 0 + 5 + Components: System + + + Free space on /var, 0% + 0 + {FileSystem_Var_Template:vfs.fs.size[/var,pused].last(0)}=100 + + 0 + 5 + Components: System + + + Free inodes on /var, 10% + 0 + {FileSystem_Var_Template:vfs.fs.inode[/var,pfree].last(0)}<10 + + 0 + 3 + Components: System + + + Free inodes on /var, 15% + 0 + {FileSystem_Var_Template:vfs.fs.inode[/var,pfree].last(0)}<15 + + 0 + 2 + Components: System + + + Free space on /var, 5% + 0 + {FileSystem_Var_Template:vfs.fs.size[/var,pused].last(0)}>95 + + 0 + 4 + Components: System + + + Free space on /var, 10% + 0 + {FileSystem_Var_Template:vfs.fs.size[/var,pused].last(0)}>90 | {FileSystem_Var_Template:vfs.fs.size[/var,free].last(0)}< 1000000000 + + 0 + 3 + Components: System + + + + + Free number of inodes on $1 + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free number of inodes on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Total number of inodes on $1 + + 6000 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Used disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Total disk space on $1 + + 6000 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Used disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + 009900 + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + + eth0: number of incoming bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 1 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 1 + 0 + 009901 + 0 + 2 + 0 + 5 + + + 1 + 1 + 3333FE + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 1 + FF66FF + 0 + 2 + 0 + 5 + + + 0 + 2 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 1 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 1 + 1 + 3333FE + 0 + 2 + 0 + 5 + + + 1 + 0 + 009901 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + OS + + + + Free space on /var, 10% + 0 + {Linux_Template:vfs.fs.size[/var,pused].last(0)}>90 | {Linux_Template:vfs.fs.size[/var,free].last(0)}< 1000000000 + + 0 + 3 + Components: System + + + Free inodes on /, 0% + 0 + {Linux_Template:vfs.fs.inode[/,pfree].last(0)}=0 + + 0 + 5 + Components: System + + + Free inodes on /, 5% + 0 + {Linux_Template:vfs.fs.inode[/,pfree].last(0)}<5 + + 0 + 4 + Components: System + + + Clock state is indeterminant + 0 + {Linux_Template:ntpd.status.last(0)}=2 + + 0 + 4 + Components: System + + + Free inodes on /, 10% + 0 + {Linux_Template:vfs.fs.inode[/,pfree].last(0)}<10 + + 0 + 3 + Components: System + + + Free space on /var, 5% + 0 + {Linux_Template:vfs.fs.size[/var,pused].last(0)}>95 + + 0 + 4 + Components: System + + + Free space on /, 5% + 0 + {Linux_Template:vfs.fs.size[/,pused].last(0)}>95 + + 0 + 4 + Components: System + + + Free space on /, 0% + 0 + {Linux_Template:vfs.fs.size[/,pused].last(0)}=100 + + 0 + 5 + Components: System + + + Free inodes on /var, 15% + 0 + {Linux_Template:vfs.fs.inode[/var,pfree].last(0)}<15 + + 0 + 2 + Components: System + + + Free space on /, 10% + 0 + {Linux_Template:vfs.fs.size[/,pused].last(0)}>90 | {Linux_Template:vfs.fs.size[/,free].last(0)}< 1000000000 + + 0 + 3 + Components: System + + + Clock is not synchronised + 0 + {Linux_Template:ntpd.status.last(0)}=1 + + 0 + 4 + Components: System + + + Total IO operations is too high + 0 + {Linux_Template:vfs.dev.common_ops.root_disk.min(500)}>500 + + 0 + 2 + Components: System + + + Free inodes on /var, 10% + 0 + {Linux_Template:vfs.fs.inode[/var,pfree].last(0)}<10 + + 0 + 3 + Components: System + + + Free inodes on /var, 0% + 0 + {Linux_Template:vfs.fs.inode[/var,pfree].last(0)}=0 + + 0 + 5 + Components: System + + + Load Average too high + 0 + ({Linux_Template:system.cpu.load[,avg1].avg(900)}>(4*{Linux_Template:system.cpu.num.last(0)})) | ({Linux_Template:system.cpu.load[,avg1].avg(1800)}>(2*{Linux_Template:system.cpu.num.last(0)})) + + 0 + 4 + Components: System + + + Low free RAM + 0 + {Linux_Template:vm.memory.size.pused.min(600)}>90 & {Linux_Template:system.swap.size[,pused].avg(600)}>10 + + 0 + 5 + Components: System + + + Sshd availability + 0 + {Linux_Template:net.tcp.port[,{$SSHD_PORT}].last(0)}=0 + + 0 + 2 + Components: System + + + Free space on /, 20% + 0 + {Linux_Template:vfs.fs.size[/,pused].last(0)}>80 + + 0 + 2 + Components: System + + + Free space on /var, 0% + 0 + {Linux_Template:vfs.fs.size[/var,pused].last(0)}=100 + + 0 + 5 + Components: System + + + ping + 0 + {Linux_Template:agent.ping.last(0)}=0 + + 0 + 5 + Components: System + + + server availability + 0 + {Linux_Template:status.last(0)}=2 + + 0 + 5 + Server not available + + + High RAM usage + 0 + {Linux_Template:vm.memory.size.pused.min(600)}>80 + + 0 + 3 + Components: System + + + CPU Load too high + 0 + ({Linux_Template:system.cpu.load[,avg1].avg(900)}>(4*{Linux_Template:system.cpu.num.last(0)})) | ({Linux_Template:system.cpu.load[,avg1].avg(1800)}>(2*{Linux_Template:system.cpu.num.last(0)})) + + 0 + 4 + Components: System + + + Free inodes on /, 15% + 0 + {Linux_Template:vfs.fs.inode[/,pfree].last(0)}<15 + + 0 + 2 + Components: System + + + Free inodes on /var, 5% + 0 + {Linux_Template:vfs.fs.inode[/var,pfree].last(0)}<5 + + 0 + 4 + Components: System + + + High swap usage + 0 + {Linux_Template:system.swap.size[,pused].last(0)}>50 + + 0 + 3 + Components: System + + + Ntpd availability + 0 + {Linux_Template:proc.num[ntpd].last(0)}=0 + + 0 + 2 + Components: System + + + Free space on /var, 20% + 0 + {Linux_Template:vfs.fs.size[/var,pused].last(0)}>80 + + 0 + 2 + Components: System + + + Chef client is not running + 0 + {Linux_Template:proc.num[,,,"chef/client.rb"].max(600)}=0 + + 0 + 1 + + + + + + eth0: number of incoming bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of incoming packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of incoming packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth0: number of outgoing packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing bytes + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing dropped packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing errors + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + eth1: number of outgoing packets + + 60 + 7 + 365 + 0 + 0 + + 0 + 1 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Interfaces + + + + Number of chef processes + + 60 + 2 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Chef Client + + + + Processor load15 + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Processor load + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Processor load5 + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Number of CPU + + 600 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Total CPU context switches + + 60 + 7 + 365 + 0 + 0 + times + 0 + 0 + 0 + 0 + + + 0 + + + + + diff("system.cpu.switches") + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU context switches + + 60 + 7 + 365 + 0 + 0 + times + 0 + 0 + 0 + 0 + + + 0 + + + + + change(system.cpu.switches) + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + CPU $2 time ($3) + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + CPU + + + + Free number of inodes on $1 + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free number of inodes on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Total number of inodes on $1 + + 6000 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free number of inodes on $1 + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free number of inodes on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Total number of inodes on $1 + + 6000 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Used disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Total disk space on $1 + + 6000 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Used disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Filesystem + + + + Free disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Used disk space on $1 in % + + 600 + 1 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Total disk space on $1 + + 6000 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Used disk space on $1 + + 600 + 1 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Var Filesystem + + + + Free swap space + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Free swap space in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used swap space in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used swap space + + 60 + 14 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used memory in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 100 + 0 + + + 0 + + + + + (last("vm.memory.size[total]") - last("vm.memory.size[free]") -last("vm.memory.size[cached]") -last("vm.memory.size[buffers]"))/last("vm.memory.size[total]")*100 + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Buffers memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Cached memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Free memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Total memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used memory (-/+ buffers/cache) + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vm.memory.size[total]")-last("vm.memory.size[free]")-last("vm.memory.size[cached]")-last("vm.memory.size[buffers]") + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Read bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.read[{$MAIN_DISK},sps,avg1]")*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write IO operations for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Total bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + (last("vfs.dev.read[{$MAIN_DISK},sps,avg1]")+last("vfs.dev.write[{$MAIN_DISK},sps,avg1]"))*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Read sectors numbers for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + sps + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Read IO operations for $1 + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Ntpd: Status + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Ntpd + + + + Ntpd: Number of processes + + 60 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Ntpd + + + + Total IO operations for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.read[{$ROOT_PARTITION},ops,avg1]")+last("vfs.dev.write[{$ROOT_PARTITION},ops,avg1]") + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.write[{$MAIN_DISK},sps,avg1]")*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write sectors numbers for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + sps + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Sshd TCP connection + + 60 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Sshd + + + + Ping to the server (TCP) + + 30 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Host status + + 30 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Host Localtime + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Host Uptime + + 300 + 2 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + + + + + + + + + + + + + + + 0 + 2 + + Linux_Template:vm.memory.size[total] + 0 + 0 + 0 + 0.0000 + 0.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + EE0000 + 0 + 2 + 0 + 5 + + + 5 + 3 + CCFFFF + 0 + 2 + 0 + 5 + + + 2 + 4 + 0000CC + 0 + 2 + 0 + 5 + + + 5 + 1 + 009900 + 0 + 2 + 0 + 5 + + + 5 + 2 + 9999FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 2 + 6666FF + 0 + 2 + 0 + 5 + + + 5 + 1 + FF9999 + 0 + 2 + 0 + 5 + + + 2 + 0 + 33FF33 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 4 + 009999 + 0 + 2 + 0 + 5 + + + 0 + 2 + 0000EE + 0 + 2 + 0 + 5 + + + 0 + 0 + FF33FF + 0 + 2 + 0 + 5 + + + 0 + 1 + FF0000 + 0 + 2 + 0 + 5 + + + 0 + 3 + 444444 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 2 + 6666FF + 0 + 2 + 0 + 5 + + + 2 + 0 + DD0000 + 0 + 2 + 0 + 5 + + + 5 + 1 + FF6666 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + 009900 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 1 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 1 + 0 + 009901 + 0 + 2 + 0 + 5 + + + 1 + 1 + 3333FE + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 2 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 1 + FF66FF + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 0 + EE00EE + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 1 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 1 + 0 + 009901 + 0 + 2 + 0 + 5 + + + 1 + 1 + 3333FE + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 0 + 1 + 6666FF + 0 + 2 + 0 + 5 + + + 0 + 2 + FF66FF + 0 + 2 + 0 + 5 + + + 0 + 0 + 009900 + 0 + 2 + 0 + 5 + + + 0 + 3 + BB0000 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 1 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 2 + 444400 + 0 + 2 + 0 + 5 + + + 5 + 0 + 777700 + 0 + 2 + 0 + 5 + + + 2 + 1 + 000000 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 1 + 1 + FF0000 + 0 + 2 + 0 + 5 + + + 1 + 0 + FFFFCC + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + 009900 + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Low free RAM + 0 + {MEM_Template:vm.memory.size.pused.min(600)}>90 & {MEM_Template:system.swap.size[,pused].avg(600)}>10 + + 0 + 5 + + + + High swap usage + 0 + {MEM_Template:system.swap.size[,pused].last(0)}>50 + + 0 + 3 + + + + High RAM usage + 0 + {MEM_Template:vm.memory.size.pused.min(600)}>80 + + 0 + 3 + + + + + + Free memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Total memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used memory (-/+ buffers/cache) + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vm.memory.size[total]")-last("vm.memory.size[free]")-last("vm.memory.size[cached]")-last("vm.memory.size[buffers]") + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Free swap space + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Free swap space in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used swap space in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used swap space + + 60 + 14 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Used memory in % + + 60 + 14 + 365 + 0 + 0 + % + 0 + 0 + 100 + 0 + + + 0 + + + + + (last("vm.memory.size[total]") - last("vm.memory.size[free]") -last("vm.memory.size[cached]") -last("vm.memory.size[buffers]"))/last("vm.memory.size[total]")*100 + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Buffers memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + Cached memory + + 60 + 14 + 365 + 0 + 0 + bytes + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Memory + + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Apps + Templates + + + + Ntpd availability + 0 + {Ntpd_Template:proc.num[ntpd].last(0)}=0 + + 0 + 2 + + + + Clock state is indeterminant + 0 + {Ntpd_Template:ntpd.status.last(0)}=2 + + 0 + 4 + For example, if ntpd is not contactable. + + + Clock is not synchronised + 0 + {Ntpd_Template:ntpd.status.last(0)}=1 + + 0 + 4 + + + + + + Ntpd: Status + + 60 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Ntpd + + + + Ntpd: Number of processes + + 60 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Ntpd + + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + Total IO operations is too high + 0 + {Root_Disk_Template:vfs.dev.common_ops.root_disk.min(500)}>500 + + 0 + 2 + + + + + + Read bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.read[{$MAIN_DISK},sps,avg1]")*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Total bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + (last("vfs.dev.read[{$MAIN_DISK},sps,avg1]")+last("vfs.dev.write[{$MAIN_DISK},sps,avg1]"))*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Read IO operations for $1 + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Total IO operations for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.read[{$ROOT_PARTITION},ops,avg1]")+last("vfs.dev.write[{$ROOT_PARTITION},ops,avg1]") + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Read sectors numbers for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + sps + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write IO operations for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + ops + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write sectors numbers for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + sps + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + Write bytes for {$MAIN_DISK} + + 60 + 14 + 365 + 0 + 0 + bps + 0 + 0 + 0 + 0 + + + 0 + + + + + last("vfs.dev.write[{$MAIN_DISK},sps,avg1]")*512 + localhost + + + 161 + + 0 + + + 0 + + Root Disk + + + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 5 + 2 + 6666FF + 0 + 2 + 0 + 5 + + + 2 + 0 + DD0000 + 0 + 2 + 0 + 5 + + + 5 + 1 + FF6666 + 0 + 2 + 0 + 5 + + + + + 0 + 0 + + + 0 + 0 + 0 + 0.0000 + 100.0000 + 0 + 0 + 0.0000 + 0.0000 + + + 2 + 0 + 33FF33 + 0 + 2 + 0 + 5 + + + 5 + 2 + 6666FF + 0 + 2 + 0 + 5 + + + 5 + 1 + FF9999 + 0 + 2 + 0 + 5 + + + + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Apps + Templates + + + + Sshd availability + 0 + {Sshd_Template:net.tcp.port[,{$SSHD_PORT}].last(0)}=0 + + 0 + 2 + Components: System + + + + + Sshd TCP connection + + 60 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + Sshd + + + + + + + + 10022 + {$SSHD_PORT} + + + + + 0 + 1 + + 127.0.0.1 + 10050 + 3 + 0 + 127.0.0.1 + 623 + 0 + 2 + + + + Templates + + + + ping + 0 + {System_Template:agent.ping.last(0)}=0 + + 0 + 5 + + + + server availability + 0 + {System_Template:status.last(0)}=2 + + 0 + 5 + Server not available + + + + + Host status + + 30 + 7 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Ping to the server (TCP) + + 30 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Host Localtime + + 600 + 1 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + Host Uptime + + 300 + 2 + 365 + 0 + 0 + + 0 + 0 + 0 + 0 + + + 0 + + + + + + localhost + + + 161 + + 0 + + + 0 + + System + + + + + + + + + + diff --git a/inhouse-cookbooks/fake/metadata.rb b/inhouse-cookbooks/fake/metadata.rb new file mode 100644 index 0000000..03063da --- /dev/null +++ b/inhouse-cookbooks/fake/metadata.rb @@ -0,0 +1,5 @@ +maintainer "LLC Express 42" +maintainer_email "info@express42.com" +license "MIT" +description "Installs/Configures fake client" +version "0.1.0" diff --git a/inhouse-cookbooks/fake/recipes/after.rb b/inhouse-cookbooks/fake/recipes/after.rb new file mode 100644 index 0000000..dc480bc --- /dev/null +++ b/inhouse-cookbooks/fake/recipes/after.rb @@ -0,0 +1,4 @@ +puts "*" * 80 +puts "After" +puts "*" * 80 +p run_context.resource_collection.map(&:to_s) diff --git a/inhouse-cookbooks/fake/recipes/before.rb b/inhouse-cookbooks/fake/recipes/before.rb new file mode 100644 index 0000000..09329e1 --- /dev/null +++ b/inhouse-cookbooks/fake/recipes/before.rb @@ -0,0 +1 @@ +p run_context.resource_collection.map(&:to_s) diff --git a/inhouse-cookbooks/fake/recipes/zabbix-screens.rb b/inhouse-cookbooks/fake/recipes/zabbix-screens.rb new file mode 100644 index 0000000..75232c9 --- /dev/null +++ b/inhouse-cookbooks/fake/recipes/zabbix-screens.rb @@ -0,0 +1,50 @@ +disks = `find /sys/devices/pci* -type d | grep block/[a-z,0-9,\!]*$`.split("\n") + +disks = disks.select do |disk| + type = `cat #{disk}/device/type`.chomp.to_i + type != 5 # dvd and so on +end + +disks = disks.map { |disk| disk.split("\/").last.gsub("!", "\/") } + +zabbix_screen node.fqdn do + vsize(3 + disks.size * 2) + + screen_item "System: Load Average" do + resource_type :graph + width 900 + height 200 + y 0 + end + + screen_item "System: CPU Utilization" do + resource_type :graph + width 900 + height 200 + y 1 + end + + pos_y = 2 + + disks.each do |disk| + application = "Disk performance of /dev/#{disk}" + + screen_item "#{application}: io per second" do + resource_type :graph + width 900 + height 200 + y pos_y + end + + pos_y += 1 + + screen_item "#{application}: io latency" do + resource_type :graph + width 900 + height 200 + y pos_y + end + + pos_y += 1 + end +end diff --git a/inhouse-cookbooks/fake/recipes/zabbix.rb b/inhouse-cookbooks/fake/recipes/zabbix.rb new file mode 100644 index 0000000..480cf46 --- /dev/null +++ b/inhouse-cookbooks/fake/recipes/zabbix.rb @@ -0,0 +1,57 @@ +zabbix_connect "connect to kupikupon zabbix" do + apiurl "http://127.0.0.1/api_jsonrpc.php" + user "Admin" + password "zabbix" +end + +ip_mon = net_get_private(node).empty? ? net_get_public(node)[0][1] : net_get_private(node)[0][1] + +zabbix_host node.fqdn do + host_group "Fake client" + use_ip true + ip_address ip_mon +end + +cookbook_file "zbx_templates.xml" do + path "/tmp/zbx_templates.xml" +end + +zabbix_template "/tmp/zbx_templates.xml" do + action :import +end + +zabbix_template 'Linux_Template' + +## Just for test +zabbix_media_type "sms" do + type :sms + modem "/dev/modem" +end + +zabbix_user_group 'My Beloved group' + +zabbix_action 'My favorite action' do + event_source :triggers + operation do + user_groups 'My Beloved group' + message do + use_default_message false + subject "Test {TRIGGER.SEVERITY}: {HOSTNAME1} {TRIGGER.STATUS}: {TRIGGER.NAME}" + message "Trigger: {TRIGGER.NAME}\n"+ + "Trigger status: {TRIGGER.STATUS}\n" + + "Trigger severity: {TRIGGER.SEVERITY}\n" + + "\n" + + "Item values:\n" + + "{ITEM.NAME1} ({HOSTNAME1}:{TRIGGER.KEY1}): {ITEM.VALUE1}" + media_type "sms" + end + end + + condition :trigger_severity, :gte, :high +# condition :host_group, :equal, "Fake Client" + condition :maintenance, :not_in, :maintenance +end + +zabbix_user_macro 'my_macro' do + value 'foobar' +end diff --git a/roles/.gitkeep b/roles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/roles/base.rb b/roles/base.rb new file mode 100644 index 0000000..1e2e886 --- /dev/null +++ b/roles/base.rb @@ -0,0 +1,14 @@ +name "base" +description "common for all" +run_list "recipe[sysctl]", "recipe[timezone]", "recipe[apt]", "recipe[ntp]", "recipe[user::data_bag]", "recipe[base]", "recipe[sudo]", "recipe[lvm]" + +default_attributes( + 'ruby' => { + 'ruby_build' => { + 'git_ref' => 'd410f6811defd71d872dc2acd9ee633f52fbf94a' + }, + 'chruby' => { + 'git_ref' => 'df6bde0573c2df1ec9bf959b717d0005dfaf936e' + } + } +) diff --git a/roles/redmine.rb b/roles/redmine.rb new file mode 100644 index 0000000..d64ddd4 --- /dev/null +++ b/roles/redmine.rb @@ -0,0 +1,6 @@ +name "redmine" +description "Install and configure redmine" +run_list "recipe[runit]", "recipe[postgresql]", "recipe[ruby]", "recipe[redmine]" + +default_attributes( +) diff --git a/roles/zbx.rb b/roles/zbx.rb new file mode 100644 index 0000000..a6ce3a5 --- /dev/null +++ b/roles/zbx.rb @@ -0,0 +1,6 @@ +name "zbx" +description "zabbix server and client" +run_list "recipe[php::default]", "recipe[nginx]", "recipe[fake::zabbix]", "recipe[zabbix-server::database]", "recipe[zabbix-server::server]", "recipe[zabbix-server::web]", "recipe[zabbix]", "recipe[partition]"#, "recipe[fake::zabbix-screens]" + +default_attributes( +)