├── README ├── chef ├── README ├── cookbooks │ └── zabbix-aws │ │ ├── README │ │ ├── attributes │ │ └── zabbix_aws_defaults.rb │ │ ├── metadata.rb │ │ ├── recipes │ │ ├── agent-autoregister.rb │ │ ├── agent-cloudwatch.rb │ │ ├── agent-deregister.rb │ │ ├── agent-varnish.rb │ │ ├── agent-varnishMyGroup.rb │ │ └── agent-varnishMyGroup_importing_defaultgroup.rb │ │ └── templates │ │ └── default │ │ ├── auto-register │ │ ├── zabbix_autoregister_curl.sh.erb │ │ └── zabbix_autoregister_wget.sh.erb │ │ ├── cloudwatch │ │ ├── cloudwatch.conf.erb │ │ └── zabbix-cloudwatch.py.erb │ │ ├── deregister │ │ ├── deregister.conf.erb │ │ ├── zabbix_deregister.sh.erb │ │ └── zabbix_get_instances.py.erb │ │ └── varnish │ │ └── varnish.conf.erb └── roles │ ├── myscripts.rb │ └── myvarnish.rb ├── scripts └── README └── templates ├── cloudwatch ├── README └── template_cloudwatch.xml ├── deregister ├── README └── template_deregister.xml ├── linuxbasic ├── README └── linuxbasic.xml ├── scripts ├── README └── template_scripts.xml └── varnish ├── README ├── varnish.xml └── varnishagg.xml /README: -------------------------------------------------------------------------------- 1 | ( ) 2 | _, _ . ( ` ) . ) 3 | ( ( _ )_ (_, _( ,_)_) 4 | (_(_ _(_ ,) 5 | 6 | 7 | POC for AWS monitoring using Zabbix and Chef automation 8 | 9 | This is an usable proof of concept on how to manage an efficient capacity 10 | planning (do more with less) and monitoring for cloud computing over Amazon's 11 | AWS installations and using Zabbix SIA's monitoring tool and Opscode's Chef 12 | automation tool 13 | 14 | 100% tested (by me only) 15 | 100% documented, but you need to know AWS, Zabbix and Chef 16 | 17 | It has 6 main goals: 18 | - Templatization 19 | - Aggregation 20 | - Resources optimization 21 | - Abstraction 22 | - Auto-register, auto-deregister 23 | - Chef automation 24 | 25 | Those concepts are not new nor invented by me, but here you can find an easy 26 | way to implement them either for AWS or any other environment. 27 | 28 | 29 | Templatization 30 | 31 | Shows how can the entire Zabbix configuration be templatized, exploring this 32 | awesome Zabbix's feature. 33 | 34 | Aggregation 35 | 36 | By aggregating groups it is easy to manage and persist values of volatile 37 | AWS instances creation and destruction, and still be able to plan for best 38 | resources usage. It is similiar as how Cloudwatch do, but lasts longer than 39 | few weeks 40 | 41 | Resources optimization 42 | 43 | By using trapper items ("listeners"), show how to send all the values at same 44 | time from the zabbix_sender tool. It helps to get snapshots of a moment and 45 | make calculations more accurate. It also avoids long configurations in the 46 | agent side. 47 | By trying to use only the built-in agent items to build the LinuxBasic template 48 | 49 | Abstraction 50 | 51 | By modificating the default Linux template adding some more abstraction making 52 | it easier to use the same template for all machines you have. It also includes 53 | the cpu steal time that is important for vms and EC2 Amazon instances 54 | 55 | Auto-register, auto-deregister 56 | 57 | Not only building a script for auto-registration, but showing how to make it 58 | efficient exploring the goals above. The script is also based in the Zabbix's 59 | API. Deregistration is based on Amazon AWS, specially the autoscaling service 60 | were your machines' pool increases and decreases dinamically 61 | 62 | Please use Zabbix > 1.8.5, for ubuntu you can get it from here 63 | http://packages.ubuntu.com/oneiric/zabbix-agent 64 | Minor version has some api problems 65 | 66 | If you like opscode's chef, start with this cookbook. My cookbook extend its 67 | features: 68 | http://community.opscode.com/cookbooks/zabbix 69 | 70 | 71 | Dirs: 72 | templates/ <- zabbix templates and installations instructions 73 | chef/ <- chef cookbooks, roles examples and 74 | auto-register instructions 75 | scripts/ <- very basic instruction 76 | 77 | 78 | TODO/Limitations/Known issues: 79 | - use more python, specially for de-registration 80 | - fix the max of 5 AWS accounts silly limitation 81 | - make better and centralized documentation 82 | - build a step-by-step walkthrough 83 | - maybe build a script to generate the scripts independent of chef for manual 84 | instaltion or to be used with another automation tool 85 | - improve the calculate itens for low traffic machines don't divide by zero 86 | and disable the item/trigger for a while 87 | 88 | _ _ 89 | ( ` )_ 90 | ( ) `) 91 | (_ (_ . _) _) 92 | _ 93 | ( ) 94 | _ . ( ` ) . ) 95 | ( _ )_ (_, _( ,_)_) 96 | (_ _(_ ,) 97 | 98 | _ _ 99 | ( ` )_ 100 | ( ) `) 101 | (_ (_ . _) _) 102 | -------------------------------------------------------------------------------- /chef/README: -------------------------------------------------------------------------------- 1 | Chef Automations 2 | 3 | cookbooks/zabbix-aws/README -> instructions for auto-register. for other 4 | instructions, check the templates' README 5 | 6 | roles/ -> examples of roles 7 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/README: -------------------------------------------------------------------------------- 1 | ***** You can find information about the recipes from the templates directory 2 | ***** The only recipe the docummentation is right here is the Auto-register 3 | 4 | Scripts below are based on Amazon AWS, but you can easly change it to other 5 | kinds of infrastructures, check the "Requirements" for more information 6 | 7 | Auto-register: 8 | 9 | It's a recipe you attach at your role that try ONLY ONCE to register the node 10 | into the Zabbix Server 11 | 12 | Notes: 13 | 14 | - This version is very simple, is uses Zabbix's API and shell script. You 15 | may need the shell tools involved pre-installed at the bootstrap for it 16 | works 17 | - There are two scripts, one using wget and another using curl. Ubuntu 18 | doesn't install curl by default but you still can install it by chef or 19 | have it pre-installed in your AMI (Amazon image) 20 | - It is based on Amazon EC2 and it tries to retrieve instance information 21 | from Amazon to store on DNS and ISID variables, you may want to change 22 | it to `hostname` instead if you are not using Amazon. Using chef you can 23 | just change the cookbook's default attributes 24 | - The name of the host is the Amazon EC2 Instance-id. This name will be 25 | used by the de-register script and by Chef to control Amazon instances. 26 | Zabbix 1.8.7 added more flexibility by creating a new field for machines' 27 | names 28 | - Scripts have timeout both for curl and wget, you may want to change it 29 | depending on your envinronment and how far or how stressed is you Zabbix 30 | Server 31 | - In case of error, the script does not block Chef's execution. You may 32 | want to change the exit codes from 0 to 1 if you want it blocked. If you 33 | have 24x7 support team, I recommend you change it to 1. 34 | - Using chef, if you want to force a SINGLE machine to be registered/enabled 35 | again, change it's node tag back to zabbix-MYGROUP without the sufix 36 | - Using chef, if you want to force ALL machines to be registered/enabled 37 | again, change the autoregister recipe's variable "expected_tag" to a new 38 | value, using the same in the statement "if not tagged?" in the machine's 39 | recipe. So all machine will try again in the next chef-client run. 40 | If you use auto-register in more than one recipe, you should change the 41 | expected_tag on those recipes instead (check the varnish recipe example) 42 | 43 | 44 | Requirenments: 45 | 46 | - A Zabbix user with API access and RW rights on all templates and groups 47 | you will interact with. Rembember the script auto-includes the Discovered 48 | Hosts' group and the Template_LinuxBasic. Make sure your Template doesn't 49 | link the Template_LinuxBasic on it, otherwise it will conflict 50 | - If you have a machine already linked to LinuxBasic template, unlink it 51 | WITHOUT CLEAR the items, so when you link it again, all old items will be 52 | part of the template again 53 | - Unfortunately you can't interact with Chef's tag directly in the roles, 54 | you have to do that at recipes level 55 | 56 | Howto: 57 | 58 | - If you use chef, check the cookbook's default attributes, and if you need, 59 | replace them in you role (check roles examples) 60 | - Put a tag called "zabbix-MYGROUP" at your recipe to tag all the 61 | machines in your group 62 | - Include the recipe zabbix-aws::auto-register at the end of your role, or 63 | to your recipe, to trigger the auto-registration process 64 | 65 | Workflow: 66 | - Chef searches for the node's zabbix tag 67 | - if registered, do nothing 68 | - if not registered (tag doesn't contain sufix "REGISTERED") 69 | - Search for the group in the tag's name after zabbix- 70 | - Search for a Template with the same group name 71 | - Register the machine into Zabbix using all below: 72 | - this group 73 | - this template 74 | - the LinuxBasic template 75 | - the Discovered Hosts group 76 | - Tag the host as REGISTERED 77 | 78 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/attributes/zabbix_aws_defaults.rb: -------------------------------------------------------------------------------- 1 | # accounts 2 | # for now, dont delete the keys, only change as many as you need 3 | # in that example, only the first is changed 4 | default.zabbixaws[:account1][:name] = "account1" 5 | default.zabbixaws[:account1][:key] = "mykey" 6 | default.zabbixaws[:account1][:secret] = "mysecret" 7 | 8 | default.zabbixaws[:account2][:name] = "myaccount2" 9 | default.zabbixaws[:account2][:key] = "xxxxxxx" 10 | default.zabbixaws[:account2][:secret] = "xxxxxxxx" 11 | 12 | default.zabbixaws[:account3][:name] = "myaccount3" 13 | default.zabbixaws[:account3][:key] = "xxxxxxx" 14 | default.zabbixaws[:account3][:secret] = "xxxxxxx" 15 | 16 | default.zabbixaws[:account4][:name] = "myaccount4" 17 | default.zabbixaws[:account4][:key] = "xxxxxxxx" 18 | default.zabbixaws[:account4][:secret] = "xxxxxxxx" 19 | 20 | default.zabbixaws[:account5][:name] = "myaccount5" 21 | default.zabbixaws[:account5][:key] = "xxxxxxxx" 22 | default.zabbixaws[:account5][:secret] = "xxxxxxx" 23 | 24 | #auto-register and deregister 25 | default.zabbixaws[:auto][:jsonurl] = "zabbix.mydomain.com.br/zabbix/api_jsonrpc.php" 26 | default.zabbixaws[:auto][:user] = "myuser" 27 | default.zabbixaws[:auto][:password] = "mypassword" 28 | ## you can change both lines below to "hostname" 29 | default.zabbixaws[:auto][:dnscommand] = "wget --tries=1 --timeout=15 -q -O- http://169.254.169.254/latest/meta-data/hostname" 30 | default.zabbixaws[:auto][:isidcommand] = "wget --tries=1 --timeout=15 -q -O- http://169.254.169.254/latest/meta-data/instance-id" 31 | 32 | #zabbix server to varnish send metrics 33 | default.zabbixaws[:server][:hostname] = "zabbix.mydomain.com.br" 34 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/metadata.rb: -------------------------------------------------------------------------------- 1 | maintainer "lorieri" 2 | maintainer_email "lorieri@ google mail dot com" 3 | license "?" 4 | description "Installs zabbix aws automations" 5 | version "0.0.1" 6 | 7 | 8 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-autoregister.rb: -------------------------------------------------------------------------------- 1 | #### PLEASE INCLUDE THIS RECIPE AT THE END OF YOUR GROUP RECIPE 2 | 3 | if not expected_tag 4 | expected_tag="REGISTERED" 5 | end 6 | 7 | node[:tags].each do |p| 8 | if p =~ /^zabbix/ 9 | if p !~ /#{expected_tag}$/ 10 | 11 | z = p.split("-")[1] 12 | 13 | Chef::Log.info("Trying to register in the Zabbix using the Template and Group: #{z}") 14 | 15 | 16 | template "/root/zabbix_autoregister.sh" do 17 | source "auto-register/zabbix_autoregister_wget.sh.erb" 18 | #use the one below if you have curl available and not wget 19 | #source "auto-register/zabbix_autoregister_curl.sh" 20 | owner "root" 21 | group "root" 22 | mode "0700" 23 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 24 | end 25 | 26 | execute "sh /root/zabbix_autoregister.sh #{z}" do 27 | user "root" 28 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 29 | end 30 | 31 | newtag = "zabbix-#{z}-#{expected_tag}" 32 | Chef::Log.info("Chaging Tag #{p} to #{newtag}") 33 | untag(p) 34 | tag(newtag) 35 | 36 | else 37 | Chef::Log.info("Tag marked as registered: #{p}") 38 | end 39 | end 40 | end 41 | 42 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-cloudwatch.rb: -------------------------------------------------------------------------------- 1 | # requires zabbix-agent, I will not explicit it here 2 | 3 | package "python-boto" do 4 | options "--force-yes" 5 | end 6 | 7 | # your agentd must be include the directory below 8 | directory "/etc/zabbix/agentd.d" do 9 | owner "zabbix" 10 | group "root" 11 | mode "0750" 12 | action :create 13 | recursive true 14 | end 15 | 16 | template "/etc/zabbix/agentd.d/cloudwatch.conf" do 17 | source "cloudwatch/cloudwatch.conf.erb" 18 | owner "zabbix" 19 | group "root" 20 | mode 0600 21 | notifies :restart, resources(:service => "zabbix-agent"), :delayed 22 | end 23 | 24 | 25 | template "/usr/local/bin/zabbix-cloudwatch.py" do 26 | source "cloudwatch/zabbix-cloudwatch.py.erb" 27 | mode 0750 28 | owner "zabbix" 29 | group "root" 30 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 31 | end 32 | 33 | # you may want to use the recipe agent-deregister too 34 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-deregister.rb: -------------------------------------------------------------------------------- 1 | #recomended to use it together agent-script 2 | 3 | package "python-boto" do 4 | options "--force-yes" 5 | end 6 | 7 | # your agentd must be include the directory below 8 | directory "/etc/zabbix/agentd.d" do 9 | owner "zabbix" 10 | group "root" 11 | mode "0750" 12 | action :create 13 | recursive true 14 | end 15 | 16 | #de-register scripts 17 | #even though some files are static, I put all together 18 | template "/usr/local/bin/zabbix_deregister.sh" do 19 | source "deregister/zabbix_deregister.sh.erb" 20 | mode 0750 21 | owner "zabbix" 22 | group "root" 23 | notifies :restart, resources(:service=> "zabbix-agent"), :delayed 24 | end 25 | 26 | template "/usr/local/bin/zabbix_get_instances.py" do 27 | source "deregister/zabbix_get_instances.py.erb" 28 | mode 0750 29 | owner "zabbix" 30 | group "root" 31 | notifies :restart, resources(:service=> "zabbix-agent"), :delayed 32 | end 33 | 34 | template "/etc/zabbix/agentd.d/deregister.conf" do 35 | source "deregister/deregister.conf.erb" 36 | mode 0750 37 | owner "zabbix" 38 | group "root" 39 | notifies :restart, resources(:service=> "zabbix-agent"), :delayed 40 | end 41 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-varnish.rb: -------------------------------------------------------------------------------- 1 | include_recipe "zabbix::agent" 2 | 3 | expected_tag = "REGISTERED" 4 | 5 | if not tagged?("zabbix-Varnish-#{expected_tag}") 6 | if not tagged?("zabbix-Varnish") 7 | tag('zabbix-Varnish') 8 | end 9 | end 10 | 11 | 12 | # your agentd must be include the directory below 13 | directory "/etc/zabbix/agentd.d" do 14 | owner "zabbix" 15 | group "root" 16 | mode "0750" 17 | action :create 18 | recursive true 19 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 20 | end 21 | 22 | 23 | template "/etc/zabbix/agentd.d/varnish.conf" do 24 | source "varnish/varnish.conf.erb" 25 | owner "zabbix" 26 | group "root" 27 | mode "0750" 28 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 29 | end 30 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-varnishMyGroup.rb: -------------------------------------------------------------------------------- 1 | include_recipe "zabbix::agent" 2 | 3 | expected_tag = "REGISTERED" 4 | 5 | if not tagged?("zabbix-VarnishMyGroup-#{expected_tag}") 6 | if not tagged?("zabbix-VarnishMyGroup") 7 | tag('zabbix-VarnishMyGroup') 8 | end 9 | end 10 | 11 | 12 | # your agentd must be include the directory below 13 | directory "/etc/zabbix/agentd.d" do 14 | owner "zabbix" 15 | group "root" 16 | mode "0750" 17 | action :create 18 | recursive true 19 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 20 | end 21 | 22 | 23 | template "/etc/zabbix/agentd.d/varnish.conf" do 24 | source "varnish/varnish.conf.erb" 25 | owner "zabbix" 26 | group "root" 27 | mode "0750" 28 | notifies :restart, resources(:service => "zabbix-agent" ), :delayed 29 | end 30 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/recipes/agent-varnishMyGroup_importing_defaultgroup.rb: -------------------------------------------------------------------------------- 1 | include_recipe "zabbix-aws::agent-varnish" 2 | 3 | 4 | # remove heritage tag 5 | untag("zabbix-Varnish") 6 | untag("zabbix-Varnish-#{expected_tag}") 7 | 8 | # added coorect tag 9 | if not tagged?("zabbix-VarnishMyGroup-#{expected_tag}") 10 | if not tagged?("zabbix-VarnishMyGroup") 11 | tag('zabbix-VarnishMyGroup') 12 | end 13 | end 14 | 15 | include_recipe "zabbix-aws::agent-autoregister" 16 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/auto-register/zabbix_autoregister_curl.sh.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 3 | 4 | #Testing argument 5 | test -z "$1" && { echo "Usage: zabbix_register_api.sh [mytag]"; exit 0; } 6 | 7 | MYTAG=$1 8 | 9 | #api url 10 | URL='<%= @node[:zabbixaws][:auto][:jsonurl] %>' 11 | USER='<%= @node[:zabbixaws][:auto][:user] %>' 12 | PASSWORD='<%= @node[:zabbixaws][:auto][:password] %>' 13 | 14 | #machine's amazon informations 15 | DNS=`<%= @node[:zabbixaws][:auto][:dnscommand] %>` 16 | ISID=`<%= @node[:zabbixaws][:auto][:isidcommand] %>` 17 | 18 | #testing amazon informations 19 | test -z "$DNS" && { echo "Erro ao pegar DNS"; exit 0; } 20 | test -z "$ISID" && { echo "Erro ao pegar Instance-id"; exit 0; } 21 | 22 | echo "-> Authenticating..." 23 | AUTH=`curl --connect-timeout 15 -s -X POST -H "Content-Type: application/json" "$URL" -d '{"jsonrpc":"2.0","method":"user.authenticate","params":{"user":"'"$USER"'","password":"'"$PASSWORD"'"},"id": 1}' |sed -n 's/.*"result":"\([a-f0-9]*\)".*/\1/p'` 24 | 25 | #Testing Auth 26 | test -z "$AUTH" && { echo "Error authenticating" ; exit 0 ; } 27 | 28 | echo "-> Searching hostgroups..." 29 | # From tag's group and Discovered hosts 30 | GRPS=`curl --connect-timeout 15 -s -X POST -H "Content-Type: application/json" "$URL" -d '{"jsonrpc":"2.0","method":"hostgroup.get","params":{"filter":{"name": ["'"$MYTAG"'","Discovered hosts"]}},"id": 1,"auth":"'"$AUTH"'"}' |sed -n 's/.*"result":\[\([^]]*\)\].*/\1/p'` 31 | 32 | #checking groups 33 | echo "$GRPS" |grep -o groupid|wc -l|grep -qx 2 || { echo "Error getting groups"; exit 0 ; } 34 | 35 | echo "-> Getting LinuxBasic and Tag's template..." 36 | TEMPLATES=`curl --connect-timeout 15 -s -X POST -H "Content-Type: application/json" "$URL" -d '{"jsonrpc":"2.0","method":"template.get","params":{"filter":{"host":["Template_LinuxBasic","Template_'"$MYTAG"'"]}},"id": 1,"auth":"'"$AUTH"'"}' |sed -n 's/.*"result":\[\([^]]*\)\].*/\1/;s/"hostid":"[^"]*",//gp'` 37 | 38 | #checking templates 39 | echo "$TEMPLATES" |grep -o templateid|wc -l|grep -qx 2 || { echo "Error getting templates"; exit 0 ; } 40 | 41 | echo "-> Registering host..." 42 | 43 | #building api's json 44 | REGISTER=`curl --connect-timeout 15 -s -X POST -H "Content-Type: application/json" "$URL" -d '{ 45 | "jsonrpc":"2.0", 46 | "method" : "host.create", 47 | "params":{ 48 | "host":"'"$ISID"'", 49 | "ip":"0.0.0.0", 50 | "useip": 0, 51 | "dns":"'"$DNS"'", 52 | "port":10050, 53 | "groups":[ 54 | '"$GRPS"' 55 | ], 56 | "templates":[ 57 | '"$TEMPLATES"' 58 | ] 59 | }, 60 | "auth":"'"$AUTH"'", 61 | "id":1 62 | } 63 | '` 64 | 65 | echo "$REGISTER"|grep -q '"hostids":\["[0-9]*"\]' || { echo "Error registering $DNS !!!!"; exit 0 ; } 66 | echo "-> $DNS registered !!" 67 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/auto-register/zabbix_autoregister_wget.sh.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 3 | 4 | #Testing argument 5 | test -z "$1" && { echo "Usage: zabbix_register_api.sh [mytag]"; exit 0; } 6 | 7 | MYTAG=$1 8 | 9 | #api url 10 | URL='<%= @node[:zabbixaws][:auto][:jsonurl] %>' 11 | USER='<%= @node[:zabbixaws][:auto][:user] %>' 12 | PASSWORD='<%= @node[:zabbixaws][:auto][:password] %>' 13 | 14 | #machine's amazon informations 15 | DNS=`<%= @node[:zabbixaws][:auto][:dnscommand] %>` 16 | ISID=`<%= @node[:zabbixaws][:auto][:isidcommand] %>` 17 | 18 | #testing amazon informations 19 | test -z "$DNS" && { echo "Erro ao pegar DNS"; exit 0; } 20 | test -z "$ISID" && { echo "Erro ao pegar Instance-id"; exit 0; } 21 | 22 | echo "-> Authenticating..." 23 | AUTH=`wget --tries=1 --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"user.authenticate","params":{"user":"'"$USER"'","password":"'"$PASSWORD"'"},"id": 1}' "$URL" |sed -n 's/.*"result":"\([a-f0-9]*\)".*/\1/p'` 24 | 25 | #Testing Auth 26 | test -z "$AUTH" && { echo "Error authenticating" ; exit 0 ; } 27 | 28 | echo "-> Searching hostgroups..." 29 | # From tag's group and Discovered hosts 30 | GRPS=`wget --tries=1 --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"hostgroup.get","params":{"filter":{"name": ["'"$MYTAG"'","Discovered hosts"]}},"id": 1,"auth":"'"$AUTH"'"}' "$URL"| sed -n 's/.*"result":\[\([^]]*\)\].*/\1/p'` 31 | 32 | #checking groups 33 | echo "$GRPS" |grep -o groupid|wc -l|grep -qx 2 || { echo "Error getting groups"; exit 0 ; } 34 | 35 | echo "-> Getting LinuxBasic and Tag's template..." 36 | TEMPLATES=`wget --tries=1 --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"template.get","params":{"filter":{"host":["Template_LinuxBasic","Template_'"$MYTAG"'"]}},"id": 1,"auth":"'"$AUTH"'"}' "$URL"| sed -n 's/.*"result":\[\([^]]*\)\].*/\1/;s/"hostid":"[^"]*",//gp'` 37 | 38 | #checking templates 39 | echo "$TEMPLATES" |grep -o templateid|wc -l|grep -qx 2 || { echo "Error getting templates"; exit 0 ; } 40 | 41 | echo "-> Registering host..." 42 | 43 | #building api's json 44 | REGISTER=`wget --tries=1 --timeout=20 -q -O- --header="Content-Type: application/json" $URL --post-data='{ 45 | "jsonrpc":"2.0", 46 | "method" : "host.create", 47 | "params":{ 48 | "host":"'"$ISID"'", 49 | "ip":"0.0.0.0", 50 | "useip": 0, 51 | "dns":"'"$DNS"'", 52 | "port":10050, 53 | "groups":[ 54 | '"$GRPS"' 55 | ], 56 | "templates":[ 57 | '"$TEMPLATES"' 58 | ] 59 | }, 60 | "auth":"'"$AUTH"'", 61 | "id":1 62 | } 63 | '` 64 | 65 | echo "$REGISTER"|grep -q '"hostids":\["[0-9]*"\]' || { echo "Error registering $DNS !!!!"; exit 0 ; } 66 | echo "-> $DNS registered !!" 67 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/cloudwatch/cloudwatch.conf.erb: -------------------------------------------------------------------------------- 1 | #cloudwatch 2 | UserParameter=cloudwatch.all[*],/usr/local/bin/zabbix-cloudwatch.py -a $1 -m $2 -n $3 -s $4 3 | UserParameter=cloudwatch.dimension[*],/usr/local/bin/zabbix-cloudwatch.py -a $1 -m $2 -n $3 -s $4 -d $5 4 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/cloudwatch/zabbix-cloudwatch.py.erb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | 3 | from optparse import OptionParser 4 | from boto.ec2.cloudwatch import CloudWatchConnection 5 | import datetime 6 | import os, time 7 | 8 | #amazon uses UTC at cloudwatch 9 | os.environ['TZ'] = 'UTC' 10 | time.tzset() 11 | 12 | 13 | interval = 60 14 | parser = OptionParser(usage='%prog [-h] [--help]', version='%prog 0.1') 15 | parser.add_option('-d', '--dimension', dest='dimension', 16 | default=None, help='Cloudwatch Dimension') 17 | parser.add_option('-n', '--namespace', dest='namespace', 18 | default='AWS/EC2', help='Cloudwatch Namespace') 19 | parser.add_option('-m', '--metric', dest='metric', 20 | default='NetworkOut', help='Cloudwatch Metric') 21 | parser.add_option('-s', '--statistic', dest='statistic', 22 | default='Sum', help='Cloudwatch Statistic') 23 | parser.add_option('-a', '--account', dest='account', help='Account') 24 | 25 | (options, args) = parser.parse_args() 26 | if len(args) > 0: 27 | parser.error('Too many arguments') 28 | 29 | end_time = datetime.datetime.now() 30 | 31 | # adding 65 seconds due amazon caracteristic 32 | end_time = end_time - datetime.timedelta(seconds=65) 33 | 34 | start_time = end_time - datetime.timedelta(seconds=interval) 35 | 36 | if not options.account: 37 | parser.error('Missing account') 38 | 39 | 40 | # I know it could be better 41 | # you should know I can't do it better yet :P 42 | 43 | if options.account == '<%= @node[:zabbixaws][:account1][:name] %>': 44 | aws_key = '<%= @node[:zabbixaws][:account1][:key] %>' 45 | aws_secret = '<%= @node[:zabbixaws][:account1][:secret] %>' 46 | elif options.account == '<%= @node[:zabbixaws][:account2][:name] %>': 47 | aws_key = '<%= @node[:zabbixaws][:account2][:key] %>' 48 | aws_secret = '<%= @node[:zabbixaws][:account2][:secret] %>' 49 | elif options.account == '<%= @node[:zabbixaws][:account3][:name] %>': 50 | aws_key = '<%= @node[:zabbixaws][:account3][:key] %>' 51 | aws_secret = '<%= @node[:zabbixaws][:account3][:secret] %>' 52 | elif options.account == '<%= @node[:zabbixaws][:account4][:name] %>': 53 | aws_key = '<%= @node[:zabbixaws][:account4][:key] %>' 54 | aws_secret = '<%= @node[:zabbixaws][:account4][:secret] %>' 55 | elif options.account == '<%= @node[:zabbixaws][:account5][:name] %>': 56 | aws_key = '<%= @node[:zabbixaws][:account5][:key] %>' 57 | aws_secret = '<%= @node[:zabbixaws][:account5][:secret] %>' 58 | 59 | cloudwatch = CloudWatchConnection(aws_access_key_id=aws_key, 60 | aws_secret_access_key=aws_secret, 61 | is_secure=True) 62 | 63 | cloudwatch_result = None 64 | 65 | 66 | if options.dimension: 67 | dimension = {} 68 | dimensions = options.dimension.split('=') 69 | dimension[dimensions[0]] = dimensions[1] 70 | cloudwatch_result = cloudwatch.get_metric_statistics(interval, start_time, end_time, options.metric, options.namespace, options.statistic, dimensions=dimension)[0] 71 | 72 | else: 73 | cloudwatch_result = cloudwatch.get_metric_statistics(interval, start_time, end_time, options.metric, options.namespace, options.statistic)[0] 74 | 75 | 76 | cloudwatch_result = float(cloudwatch_result[options.statistic]) 77 | 78 | print cloudwatch_result 79 | 80 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/deregister/deregister.conf.erb: -------------------------------------------------------------------------------- 1 | # de-register example 2 | # stores the exit code 0 fro sucess or > 0 for error 3 | UserParameter=auto.deregister[*],/usr/local/bin/zabbix_deregister.sh $1 $2 > /dev/null; echo $? 4 | 5 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/deregister/zabbix_deregister.sh.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 3 | 4 | #Testing argument 5 | test -z "$1" -o -z "$2" && { echo "Usage: zabbix_deregister.sh [mygroup] [myaccount]"; exit 1; } 6 | 7 | URL='<%= @node[:zabbixaws][:auto][:jsonurl] %>' 8 | USER='<%= @node[:zabbixaws][:auto][:user] %>' 9 | PASSWORD='<%= @node[:zabbixaws][:auto][:password] %>' 10 | 11 | GROUP="$1" 12 | ACCOUNT="$2" 13 | 14 | LISTAAMAZON=`mktemp` 15 | LISTAZABBIX=`mktemp` 16 | LISTAZABBIXNAME=`mktemp` 17 | LISTAIDS=`mktemp` 18 | LISTATMP=`mktemp` 19 | 20 | #exit funcion 21 | atexit() { 22 | rm -f $LISTAAMAZON 23 | rm -f $LISTAZABBIX 24 | rm -f $LISTAZABBIXNAME 25 | rm -f $LISTAIDS 26 | rm -f $LISTATMP 27 | } 28 | trap atexit 0 29 | 30 | #getting amazon instance lists 31 | /usr/local/bin/zabbix_get_instances.py "$ACCOUNT" > $LISTATMP || exit 1 32 | 33 | sort $LISTATMP > $LISTAAMAZON 34 | 35 | #testing list 36 | test "$(cat $LISTAAMAZON |wc -l)" -gt 0 || exit 0 37 | 38 | echo "-> Authenticating..." 39 | AUTH=`wget --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"user.authenticate","params":{"user":"'"$USER"'","password":"'"$PASSWORD"'"},"id": 1}' "$URL" |sed -n 's/.*"result":"\([a-f0-9]*\)".*/\1/p'` 40 | 41 | #Testing Auth 42 | test -z "$AUTH" && { echo "Error authenticating" ; exit 1 ; } 43 | 44 | echo "-> Searching hostgroup..." 45 | #GROUPS is a reserved name for bash 46 | GRPS=`wget --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"hostgroup.get","params":{"filter":{"name": ["'"$GROUP"'"]}},"id": 1,"auth":"'"$AUTH"'"}' "$URL" | sed -n 's/.*\[{"groupid":"\([0-9]*\)"}\].*/\1/p'` 47 | 48 | #checking groups 49 | echo "$GRPS" |grep -o "^[0-9][0-9]*$" |wc -l|grep -qx 1 || { echo "Error getting groups"; exit 1 ; } 50 | 51 | 52 | echo "-> Searching hosts..." 53 | wget --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"host.get","params":{"output":"extend","groupids":["'"$GRPS"'"],"filter":{"status":[0]}},"id": 1,"auth":"'"$AUTH"'"}' "$URL" | grep -o '"hostid":"[0-9]*"\|"host":"[^"]*"' | tr ' ' '\n' > $LISTAZABBIX 54 | 55 | echo "-> Searching for non-matched hosts" 56 | sed -n 's/"host":"\([^"]*\)"/\1/p' $LISTAZABBIX | sort > $LISTAZABBIXNAME 57 | HOST=`grep -xv -f $LISTAAMAZON $LISTAZABBIXNAME ` 58 | 59 | #building deleting list 60 | test -z "$HOST" && { echo "Nothing to do"; exit 0; } 61 | 62 | for d in $HOST 63 | do 64 | HOSTID=`grep '"host":"'"$d"'"' -B1 $LISTAZABBIX |head -1` 65 | DEL=$DEL'{'"$HOSTID"'}' 66 | 67 | ID=`echo "$HOSTID" | grep -o "[0-9]*"` 68 | 69 | RESULT=`wget --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"host.update","params":{"hostid": "'"$ID"'","status": 1},"auth":"'"$AUTH"'","id":1}' "$URL"` 70 | echo $RESULT | 71 | grep -q result && echo "Hosts $d disabled" || 72 | { echo "Error disabling hosts: $RESULT"; exit 1; } 73 | 74 | 75 | done 76 | 77 | DEL=`echo $DEL |sed "s/}{/},{/g"` 78 | 79 | ###### IF YOU WANT TO DELETE THE MACHINE, USE THE LINE BELOW 80 | #RESULT=`wget --timeout=15 -q -O- --header="Content-Type: application/json" --post-data='{"jsonrpc":"2.0","method":"host.delete","params":['"$DEL"'],"id": 1,"auth":"'"$AUTH"'"}' "$URL"` 81 | 82 | #echo $RESULT | 83 | # grep -q result && echo "Hosts removed" || 84 | # { echo "Error removing hosts: $RESULT"; exit 1; } 85 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/deregister/zabbix_get_instances.py.erb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | 3 | import sys 4 | option="" 5 | aws_key="" 6 | aws_secret="" 7 | 8 | if len(sys.argv) < 2: 9 | print "Usage: get_instances.py " 10 | sys.exit(1) 11 | else : 12 | option = sys.argv[1] 13 | 14 | from boto.ec2.connection import EC2Connection 15 | 16 | if option == '<%= @node[:zabbixaws][:account1][:name] %>': 17 | aws_key = '<%= @node[:zabbixaws][:account1][:key] %>' 18 | aws_secret = '<%= @node[:zabbixaws][:account1][:secret] %>' 19 | elif option == '<%= @node[:zabbixaws][:account2][:name] %>': 20 | aws_key = '<%= @node[:zabbixaws][:account2][:key] %>' 21 | aws_secret = '<%= @node[:zabbixaws][:account2][:secret] %>' 22 | elif option == '<%= @node[:zabbixaws][:account3][:name] %>': 23 | aws_key = '<%= @node[:zabbixaws][:account3][:key] %>' 24 | aws_secret = '<%= @node[:zabbixaws][:account3][:secret] %>' 25 | elif option == '<%= @node[:zabbixaws][:account4][:name] %>': 26 | aws_key = '<%= @node[:zabbixaws][:account4][:key] %>' 27 | aws_secret = '<%= @node[:zabbixaws][:account4][:secret] %>' 28 | elif option == '<%= @node[:zabbixaws][:account5][:name] %>': 29 | aws_key = '<%= @node[:zabbixaws][:account5][:key] %>' 30 | aws_secret = '<%= @node[:zabbixaws][:account5][:secret] %>' 31 | 32 | if not aws_key: 33 | sys.exit(1) 34 | if not aws_secret: 35 | sys.exit(1) 36 | 37 | 38 | conn = EC2Connection(aws_key, aws_secret) 39 | if not conn: 40 | sys.exit(1) 41 | instances = conn.get_all_instances() 42 | if not instances: 43 | sys.exit(1) 44 | for inst in instances: 45 | for instt in inst.instances: 46 | #print dir(instt) 47 | if instt.state != "terminated" : 48 | print instt.id 49 | 50 | -------------------------------------------------------------------------------- /chef/cookbooks/zabbix-aws/templates/default/varnish/varnish.conf.erb: -------------------------------------------------------------------------------- 1 | #Varnish 2 | # stores the exit code 0 for sucess or > 0 for error 3 | UserParameter=varnish_collect[*],varnishstat -1 | awk {'print "$1" " " $$1 " " $$2'} > /tmp/$1-zabbix.data && zabbix_sender -vv -z <%= @node[:zabbixaws][:server][:hostname] %> -i /tmp/$1-zabbix.data > /tmp/$1-zabbix.log 2>&1 ; echo $? 4 | 5 | -------------------------------------------------------------------------------- /chef/roles/myscripts.rb: -------------------------------------------------------------------------------- 1 | name "zabbix-scripts" 2 | description "Cloudwatch, deregistration and aggregation scripts" 3 | override_attributes "zabbixaws" => { 4 | "account1" => { 5 | "name" => "EasyName1", 6 | "key" => "mykey", 7 | "secret" => "mysecret" 8 | }, 9 | "account2" => { 10 | "name" => "EasyName2", 11 | "key" => "mykey", 12 | "secret" => "mysecret" 13 | }, 14 | "auto" => { 15 | "user" => "admin", 16 | "password" => "zabbix", 17 | "jsonurl" => "zabbix.mydomain.com.br/zabbix/api_jsonrpc.php" 18 | } 19 | } 20 | 21 | run_list [ 22 | "recipe[zabbix::agent]", 23 | "recipe[zabbix-aws::agent-cloudwatch]", 24 | "recipe[zabbix-aws::agent-deregister]" 25 | ] 26 | 27 | -------------------------------------------------------------------------------- /chef/roles/myvarnish.rb: -------------------------------------------------------------------------------- 1 | name "varnishMygroup" 2 | description "VarnishMyGroup" 3 | 4 | override_attributes "zabbixaws" => { 5 | "server" => { 6 | "hostname" => "zabbix.mydomain.com.br" 7 | } 8 | } 9 | 10 | run_list [ 11 | "recipe[zabbix-aws::agent-varnishMyGroup]" 12 | ] 13 | 14 | # it includes recipes like this: 15 | # 16 | # recipe[zabbix-aws::agent-varnishMyGroup] -> 17 | # recipe[zabbix-aws::agent-varnish] -> 18 | # recipe[zabbix::agent] 19 | 20 | # and "recipe[zabbix-aws::agent-autoregister]" 21 | -------------------------------------------------------------------------------- /scripts/README: -------------------------------------------------------------------------------- 1 | Please check the templates README instructions to find information on how to 2 | install it manually 3 | 4 | Basically all you need is: 5 | 6 | - Copy all .sh or .py scripts to /usr/local/bin 7 | - Copy all .conf files to /etc/zabbix/agentd.d/ 8 | - Put the line below in your /etc/zabbix/zabbix_agentd.conf 9 | Include=/etc/zabbix/agentd.d/ 10 | - Import all templates into your Zabbix server 11 | - Link them to your hosts 12 | -------------------------------------------------------------------------------- /templates/cloudwatch/README: -------------------------------------------------------------------------------- 1 | Cloudwatch monitoring for Zabbix 1.8.5 2 | 3 | Goals: persist cloudwatch metrics for more than couple of weeks 4 | 5 | Examples of: 6 | - Item, trigers, graphs for EC2, RDS and Autoscaling 7 | 8 | Requirenments: 9 | 10 | - Python boto at the server that will run the collector script 11 | $ sudo apt-get install python-boto (or use chef's recipe below) 12 | 13 | - Your Zabbix agent must include the /etc/zabbix/agent.d/ directory 14 | 15 | Warning: even though it is cheap, you pay per thousands requests 16 | to get Cloudwatch information using the API 17 | 18 | items are storing 3 months non-aggregated information 19 | after that time you still can see aggregated 20 | avg,min,max values 21 | 22 | trends are stored for 5 years, you may have a good DB for that 23 | 24 | - Understand how Cloudwatch works and what information you can get from it 25 | to add more items 26 | - Create an IAM account with read-only access to Cloudwatch 27 | - Chose a host to run the scripts, the Zabbix server is recommended, or use 28 | a dedicated host to run all stand-alone scripts and items that does not 29 | depend in any other host 30 | 31 | How to: 32 | 33 | Install the agent configurations using chef: 34 | - Include the chef's recipe zabbix-aws::agent-cloudwatch at the hosts' role 35 | * Your zabbix-agent have to include the dir /etc/zabbix/agentd.d/ 36 | - Check the roles examples to replace the cookbook's default attributes and 37 | configure up to 5 AWS accounts (chef/roles/ directory) 38 | 39 | Install the agent configurations manually: 40 | 41 | In the host: 42 | - create the directory /etc/zabbix/agentd.d/ 43 | $ sudo mkdir /etc/zabbix/agentd.d 44 | - copy file cookbooks/zabbix-aws/files/default/cloudwatch/cloudwatch.conf 45 | to /etc/zabbix/agentd.d/cloudwatch.conf 46 | - copy and edit the file 47 | cookbooks/zabbix-aws/templates/default/cloudwatch/ 48 | zabbix-cloudwatch.py.erb 49 | to /usr/local/bin/zabbix-cloudwatch.py 50 | - include the configurations in the agentd: 51 | $ echo 'Include=/etc/zabbix/agentd.d/' | 52 | sudo tee -a /etc/zabbix/agentd.conf 53 | - fix permissions and restart the agent 54 | $ sudo chown -R zabbix /etc/zabbix/agentd.d 55 | $ sudo chmod 600 /etc/zabbix/agentd.d/* 56 | $ sudo chown zabbix:root /usr/local/bin/zabbix* 57 | $ sudo chmod 750 /usr/local/bin/zabbix* 58 | $ sudo /etc/init.d/zabbix-agent restart 59 | 60 | 61 | Install the templates for 1 account 62 | 63 | - Import the template into Zabbix server 64 | - Configure the macros variables in the template's configuration, like this: 65 | {$MYACCOUNT} = myawsaccount 66 | {$AUTOSCALINGGROUPNAME} = my_autoscaling_groupname 67 | {$RDSINSTANCE} = my_DBInstanceIdentifier 68 | - Link the template in the host you installed the agent 69 | * You can ignore the macros you not use, disable the related triggers though 70 | 71 | Install the templates for 2 (or more) accounts 72 | 73 | - Import the template into Zabbix server 74 | - Create a new template called Template_CloudwatchMyAccount1 75 | - Link the Template_Cloudwach on it 76 | - Configure the macros variables in this new template's configuration: 77 | {$MYACCOUNT} = myawsaccount 78 | {$AUTOSCALINGGROUPNAME} = my_autoscaling_groupname 79 | {$RDSINSTANCE} = my_DBInstanceIdentifier 80 | - Link the template in the host you installed the agent 81 | **** THE HOST MACROS HAVE PRIORITY PRECEDENCE ON TEMPLATE'S MACROS **** 82 | **** MAKE SURE YOUR HOST HAS NOT SIMILAR MACROS **** 83 | - Repeat for the new account using Tempalte_CloudwatchMyAccount2 84 | 85 | 86 | 87 | .---------------. 88 | | zabbix server | (Server and Agent can be the same host) 89 | | :10051 | 90 | .----------------. | 91 | | T .------------. | 92 | | E | H .-------. | 93 | | M | O | ITEMS | | .---------------------------. 94 | | P | S | ITEMS | |------------------>| request:{name,ip,item} | 95 | | L | T | ITEMS | | '---------------------------' 96 | | A | | ITEMS | | *not dns name :( 97 | | T | | ITEMS | | | 98 | | E | | ITEMS | | | 99 | '----'----'-------' | v 100 | '---------------' .--------------------. 101 | ^ | AWS security group | 102 | | '--------------------' 103 | .--------------------. | 104 | | AWS security group | v 105 | '--------------------' .------------------------------. 106 | ^ | zabbix agent | 107 | | | :10050 | 108 | .--------------------------. | | 109 | | return: {name,key,value} |<-----------| name: agentd.conf's hostname | 110 | '--------------------------' | | 111 | *not dns name :( .---------------------------------------. 112 | | /etc/zabbix/agentd.d/cloudwatch.conf | 113 | | | 114 | .--------------------->.---------------------------------------. 115 | | | keys: | 116 | | | | 117 | | | UserParameter=cloudwatch.all[*] | 118 | | | UserParameter=cloudwatch.dimension[*] | 119 | | '---------------------------------------' 120 | | | 121 | | v 122 | | .---------------------------------------. 123 | | | /usr/local/bin/zabbix-cloudwatch.py | 124 | .----------------------------. | | 125 | | chef | | accounts: aws_key,aws_secret | 126 | | .--------------------------. '---------------------------------------' 127 | | | role: myrole.rb | 128 | | | - accounts information | 129 | | | .--------------------.-------------------------------------. 130 | | '-----| cookbook: | install: | 131 | | | - static scripts | /etc/zabbix/agent.d/cloudwatch.conf | 132 | | | - template to | | 133 | | | configure the | configure and install: | 134 | | | accounts | /usr/local/bin/zabbix-cloudwatch.py | 135 | '-------'--------------------'-------------------------------------' 136 | -------------------------------------------------------------------------------- /templates/cloudwatch/template_cloudwatch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | 1 7 | 8 | 127.0.0.1 9 | 10050 10 | 3 11 | 0 12 | 127.0.0.1 13 | 623 14 | 0 15 | 2 16 | 17 | 18 | 19 | Templates 20 | CloudWatch 21 | 22 | 23 | 24 | Cloudwatch All traffic decreased more than 20% in the last 10 minutes 25 | 0 26 | {Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}>{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}&{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}/{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}>1.25 27 | 28 | 0 29 | 4 30 | 31 | 32 | 33 | Cloudwatch All traffic increased more than 10% in the last 10 minutes 34 | 0 35 | {Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}<{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}&{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}/{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}<0.9 36 | 37 | 0 38 | 2 39 | 40 | 41 | 42 | Cloudwatch All traffic increased more than 20% in the last 10 minutes 43 | 0 44 | {Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}<{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}&{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}/{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}<0.833 45 | 46 | 0 47 | 4 48 | 49 | 50 | 51 | Cloudwatch All traffic decreased more than 10% in the last 10 minutes 52 | 0 53 | {Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}>{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}&{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,600)}/{Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].avg(600,0)}>1.11 54 | 55 | 0 56 | 2 57 | 58 | 59 | 60 | Cloudwatch traffic items are not being updated 61 | 0 62 | {Template_Cloudwatch:cloudwatch.all[{$MYACCOUNT},NetworkOut,AWS/EC2,Sum].nodata(120)}=1 63 | 64 | 0 65 | 5 66 | 67 | 68 | 69 | RDS Items are not being updated 70 | 0 71 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},DatabaseConnections,AWS/RDS,Average,DBInstanceIdentifier={$RDSINSTANCE}].nodata(120)}=1 72 | 73 | 0 74 | 5 75 | 76 | 77 | 78 | RDS Low free disc, 1G left 79 | 0 80 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},FreeStorageSpace,AWS/RDS,Average,DBInstanceIdentifier={$RDSINSTANCE}].last(0)}<1073741824 81 | 82 | 0 83 | 4 84 | 85 | 86 | 87 | Less than the minimum required machines in the Autoscaling pool 88 | 0 89 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},GroupInServiceInstances,AWS/AutoScaling,Maximum,AutoScalingGroupName={$AUTOSCALINGGROUPNAME}].last(0)}<{Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},GroupMinSize,AWS/AutoScaling,Maximum,AutoScalingGroupName={$AUTOSCALINGGROUPNAME}].last(0)} 90 | 91 | 0 92 | 4 93 | 94 | 95 | 96 | Autoscaling reached max instances 97 | 0 98 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},GroupInServiceInstances,AWS/AutoScaling,Maximum,AutoScalingGroupName={$AUTOSCALINGGROUPNAME}].last(0)}={Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},GroupMaxSize,AWS/AutoScaling,Maximum,AutoScalingGroupName={$AUTOSCALINGGROUPNAME}].last(0)} 99 | 100 | 0 101 | 4 102 | 103 | 104 | 105 | RDS Read Latency bigger than 1 second 106 | 0 107 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},ReadLatency,AWS/RDS,Average,DBInstanceIdentifier={$RDSINSTANCE}].last(0)}>1 108 | 109 | 0 110 | 4 111 | 112 | 113 | 114 | RDS More than 200M of swap usage 115 | 0 116 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},SwapUsage,AWS/RDS,Average,DBInstanceIdentifier={$RDSINSTANCE}].last(0)}>209715200 117 | 118 | 0 119 | 4 120 | 121 | 122 | 123 | RDS Write Latency bigger than 1 second 124 | 0 125 | {Template_Cloudwatch:cloudwatch.dimension[{$MYACCOUNT},WriteLatency,AWS/RDS,Average,DBInstanceIdentifier={$RDSINSTANCE}].last(0)}>1 126 | 127 | 0 128 | 4 129 | 130 | 131 | 132 | 133 | 134 | All.Max.NetworkIn 135 | 136 | 60 137 | 95 138 | 1855 139 | 0 140 | 0 141 | Mb/s 142 | 1 143 | 0 144 | .00000763 145 | 0 146 | 147 | 148 | 0 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 161 158 | 159 | 0 160 | 161 | 162 | 163 | 164 | 165 | All.NetworkIn 166 | 167 | 60 168 | 95 169 | 1855 170 | 0 171 | 0 172 | Mb/s 173 | 1 174 | 0 175 | .00000763 176 | 0 177 | 178 | 179 | 0 180 | 181 | 182 | 183 | 184 | 185 | localhost 186 | 187 | 188 | 161 189 | 190 | 0 191 | 192 | 193 | 194 | 195 | 196 | All.Max.NetworkOut 197 | 198 | 60 199 | 95 200 | 1855 201 | 0 202 | 0 203 | Mb/s 204 | 1 205 | 0 206 | .00000763 207 | 0 208 | 209 | 210 | 0 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 161 220 | 221 | 0 222 | 223 | 224 | 225 | 226 | 227 | All.NetworkOut 228 | 229 | 60 230 | 95 231 | 1855 232 | 0 233 | 0 234 | Mb/s 235 | 1 236 | 0 237 | .00000763 238 | 0 239 | 240 | 241 | 0 242 | 243 | 244 | 245 | 246 | 247 | localhost 248 | 249 | 250 | 161 251 | 252 | 0 253 | 254 | 255 | 256 | 257 | 258 | Autoscaling.deregister 259 | 260 | 120 261 | 95 262 | 365 263 | 0 264 | 0 265 | exit code 266 | 0 267 | 0 268 | 0 269 | 0 270 | 271 | 272 | 0 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 161 282 | 283 | 0 284 | 285 | 286 | 287 | 288 | 289 | RDS.CPUUtilization.average 290 | 291 | 60 292 | 95 293 | 1855 294 | 0 295 | 0 296 | % 297 | 0 298 | 0 299 | 0 300 | 0 301 | 302 | 303 | 0 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 161 313 | 314 | 0 315 | 316 | 317 | 318 | 319 | 320 | RDS.DatabaseConnections.average 321 | 322 | 60 323 | 95 324 | 1855 325 | 0 326 | 0 327 | cons 328 | 0 329 | 0 330 | 0 331 | 0 332 | 333 | 334 | 0 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 161 344 | 345 | 0 346 | 347 | 348 | 349 | 350 | 351 | RDS.FreeableMemory.average 352 | 353 | 120 354 | 95 355 | 1855 356 | 0 357 | 0 358 | B 359 | 0 360 | 0 361 | 0 362 | 0 363 | 364 | 365 | 0 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 161 375 | 376 | 0 377 | 378 | 379 | 380 | 381 | 382 | RDS.FreeStorageSpace.average 383 | 384 | 180 385 | 95 386 | 1855 387 | 0 388 | 0 389 | B 390 | 0 391 | 0 392 | 0 393 | 0 394 | 395 | 396 | 0 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 161 406 | 407 | 0 408 | 409 | 410 | 411 | 412 | 413 | Autoscaling.GroupDesiredCapacity 414 | 415 | 300 416 | 95 417 | 1855 418 | 0 419 | 0 420 | Instances 421 | 0 422 | 0 423 | 0 424 | 0 425 | 426 | 427 | 0 428 | 429 | 430 | 431 | 432 | 433 | localhost 434 | 435 | 436 | 161 437 | 438 | 0 439 | 440 | 441 | 442 | 443 | 444 | Autoscaling.GroupInServiceInstances 445 | 446 | 300 447 | 95 448 | 1855 449 | 0 450 | 0 451 | Instances 452 | 0 453 | 0 454 | 0 455 | 0 456 | 457 | 458 | 0 459 | 460 | 461 | 462 | 463 | 464 | localhost 465 | 466 | 467 | 161 468 | 469 | 0 470 | 471 | 472 | 473 | 474 | 475 | Autoscaling.GroupMaxSize 476 | 477 | 300 478 | 95 479 | 1855 480 | 0 481 | 0 482 | Instances 483 | 0 484 | 0 485 | 0 486 | 0 487 | 488 | 489 | 0 490 | 491 | 492 | 493 | 494 | 495 | localhost 496 | 497 | 498 | 161 499 | 500 | 0 501 | 502 | 503 | 504 | 505 | 506 | Autoscaling.GroupMinSize 507 | 508 | 300 509 | 95 510 | 1855 511 | 0 512 | 0 513 | Instances 514 | 0 515 | 0 516 | 0 517 | 0 518 | 519 | 520 | 0 521 | 522 | 523 | 524 | 525 | 526 | localhost 527 | 528 | 529 | 161 530 | 531 | 0 532 | 533 | 534 | 535 | 536 | 537 | Autoscaling.GroupPendingInstances 538 | 539 | 300 540 | 95 541 | 1855 542 | 0 543 | 0 544 | Instances 545 | 0 546 | 0 547 | 0 548 | 0 549 | 550 | 551 | 0 552 | 553 | 554 | 555 | 556 | 557 | localhost 558 | 559 | 560 | 161 561 | 562 | 0 563 | 564 | 565 | 566 | 567 | 568 | Autoscaling.GroupTerminatingInstances 569 | 570 | 300 571 | 95 572 | 1855 573 | 0 574 | 0 575 | Instances 576 | 0 577 | 0 578 | 0 579 | 0 580 | 581 | 582 | 0 583 | 584 | 585 | 586 | 587 | 588 | localhost 589 | 590 | 591 | 161 592 | 593 | 0 594 | 595 | 596 | 597 | 598 | 599 | Autoscaling.GroupTotalInstances 600 | 601 | 300 602 | 95 603 | 1855 604 | 0 605 | 0 606 | Instances 607 | 0 608 | 0 609 | 0 610 | 0 611 | 612 | 613 | 0 614 | 615 | 616 | 617 | 618 | 619 | localhost 620 | 621 | 622 | 161 623 | 624 | 0 625 | 626 | 627 | 628 | 629 | 630 | Autoscaling.Max.NetworkIn 631 | 632 | 60 633 | 95 634 | 1855 635 | 0 636 | 0 637 | Mb/s 638 | 1 639 | 0 640 | 0.00000763 641 | 0 642 | 643 | 644 | 0 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 161 654 | 655 | 0 656 | 657 | 658 | 659 | 660 | 661 | Autoscaling.NetworkIn 662 | 663 | 60 664 | 95 665 | 1855 666 | 0 667 | 0 668 | Mb/s 669 | 1 670 | 0 671 | 0.000000954 672 | 0 673 | 674 | 675 | 0 676 | 677 | 678 | 679 | 680 | 681 | localhost 682 | 683 | 684 | 161 685 | 686 | 0 687 | 688 | 689 | 690 | 691 | 692 | Autoscaling.Max.NetworkOut 693 | 694 | 60 695 | 95 696 | 1855 697 | 0 698 | 0 699 | Mb/s 700 | 1 701 | 0 702 | 0.00000763 703 | 0 704 | 705 | 706 | 0 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 161 716 | 717 | 0 718 | 719 | 720 | 721 | 722 | 723 | Autoscaling.NetworkOut 724 | 725 | 60 726 | 95 727 | 1855 728 | 0 729 | 0 730 | Mb/s 731 | 1 732 | 0 733 | 0.000000954 734 | 0 735 | 736 | 737 | 0 738 | 739 | 740 | 741 | 742 | 743 | localhost 744 | 745 | 746 | 161 747 | 748 | 0 749 | 750 | 751 | 752 | 753 | 754 | RDS.ReadIOPS.average 755 | 756 | 60 757 | 95 758 | 1855 759 | 0 760 | 0 761 | op/s 762 | 0 763 | 0 764 | 0 765 | 0 766 | 767 | 768 | 0 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 161 778 | 779 | 0 780 | 781 | 782 | 783 | 784 | 785 | RDS.ReadLatency.average 786 | 787 | 60 788 | 95 789 | 1855 790 | 0 791 | 0 792 | sec 793 | 0 794 | 0 795 | 0 796 | 0 797 | 798 | 799 | 0 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 161 809 | 810 | 0 811 | 812 | 813 | 814 | 815 | 816 | RDS.ReadThroughput.average 817 | 818 | 60 819 | 95 820 | 1855 821 | 0 822 | 0 823 | B/s 824 | 0 825 | 0 826 | 0 827 | 0 828 | 829 | 830 | 0 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 161 840 | 841 | 0 842 | 843 | 844 | 845 | 846 | 847 | RDS.SwapUsage.average 848 | 849 | 120 850 | 95 851 | 1855 852 | 0 853 | 0 854 | B 855 | 0 856 | 0 857 | 0 858 | 0 859 | 860 | 861 | 0 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 161 871 | 872 | 0 873 | 874 | 875 | 876 | 877 | 878 | RDS.WriteIOPS.average 879 | 880 | 60 881 | 95 882 | 1855 883 | 0 884 | 0 885 | op/s 886 | 0 887 | 0 888 | 0 889 | 0 890 | 891 | 892 | 0 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 161 902 | 903 | 0 904 | 905 | 906 | 907 | 908 | 909 | RDS.WriteLatency.average 910 | 911 | 60 912 | 95 913 | 1855 914 | 0 915 | 0 916 | sec 917 | 0 918 | 0 919 | 0 920 | 0 921 | 922 | 923 | 0 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 161 933 | 934 | 0 935 | 936 | 937 | 938 | 939 | 940 | RDS.WriteThroughput.average 941 | 942 | 60 943 | 95 944 | 1855 945 | 0 946 | 0 947 | B/s 948 | 0 949 | 0 950 | 0 951 | 0 952 | 953 | 954 | 0 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 161 964 | 965 | 0 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 1 975 | 0 976 | 977 | 978 | 0 979 | 1 980 | 0 981 | 0.0000 982 | 100.0000 983 | 0 984 | 0 985 | 0.0000 986 | 0.0000 987 | 988 | 989 | 5 990 | 0 991 | 3333FF 992 | 1 993 | 2 994 | 0 995 | 5 996 | 997 | 998 | 5 999 | 1 1000 | 009900 1001 | 1 1002 | 2 1003 | 0 1004 | 5 1005 | 1006 | 1007 | 2 1008 | 2 1009 | 0000CC 1010 | 1 1011 | 4 1012 | 0 1013 | 5 1014 | 1015 | 1016 | 2 1017 | 3 1018 | 008800 1019 | 1 1020 | 4 1021 | 0 1022 | 5 1023 | 1024 | 1025 | 1026 | 1027 | 1 1028 | 0 1029 | 1030 | 1031 | 0 1032 | 1 1033 | 0 1034 | 0.0000 1035 | 100.0000 1036 | 0 1037 | 0 1038 | 0.0000 1039 | 0.0000 1040 | 1041 | 1042 | 5 1043 | 0 1044 | 3333FF 1045 | 1 1046 | 2 1047 | 0 1048 | 5 1049 | 1050 | 1051 | 5 1052 | 1 1053 | 009900 1054 | 1 1055 | 2 1056 | 0 1057 | 5 1058 | 1059 | 1060 | 1061 | 1062 | 1 1063 | 0 1064 | 1065 | 1066 | 0 1067 | 1 1068 | 0 1069 | 0.0000 1070 | 100.0000 1071 | 0 1072 | 0 1073 | 0.0000 1074 | 0.0000 1075 | 1076 | 1077 | 0 1078 | 2 1079 | 000088 1080 | 0 1081 | 4 1082 | 0 1083 | 5 1084 | 1085 | 1086 | 5 1087 | 3 1088 | 3333FF 1089 | 0 1090 | 2 1091 | 0 1092 | 5 1093 | 1094 | 1095 | 0 1096 | 4 1097 | 6666FF 1098 | 0 1099 | 1 1100 | 0 1101 | 5 1102 | 1103 | 1104 | 0 1105 | 5 1106 | 006600 1107 | 0 1108 | 4 1109 | 0 1110 | 5 1111 | 1112 | 1113 | 5 1114 | 11 1115 | 009900 1116 | 0 1117 | 2 1118 | 0 1119 | 5 1120 | 1121 | 1122 | 0 1123 | 12 1124 | 00CC00 1125 | 0 1126 | 1 1127 | 0 1128 | 5 1129 | 1130 | 1131 | 1132 | 1133 | 1 1134 | 0 1135 | 1136 | 1137 | 0 1138 | 1 1139 | 0 1140 | 0.0000 1141 | 100.0000 1142 | 0 1143 | 0 1144 | 0.0000 1145 | 0.0000 1146 | 1147 | 1148 | 5 1149 | 0 1150 | DD0000 1151 | 1 1152 | 7 1153 | 0 1154 | 5 1155 | 1156 | 1157 | 2 1158 | 1 1159 | 0000BB 1160 | 0 1161 | 7 1162 | 0 1163 | 5 1164 | 1165 | 1166 | 1167 | 1168 | 1 1169 | 0 1170 | 1171 | 1172 | 0 1173 | 1 1174 | 0 1175 | 0.0000 1176 | 100.0000 1177 | 0 1178 | 0 1179 | 0.0000 1180 | 0.0000 1181 | 1182 | 1183 | 1 1184 | 0 1185 | 000077 1186 | 0 1187 | 2 1188 | 0 1189 | 5 1190 | 1191 | 1192 | 1193 | 1194 | 1 1195 | 0 1196 | 1197 | 1198 | 0 1199 | 1 1200 | 0 1201 | 0.0000 1202 | 100.0000 1203 | 0 1204 | 0 1205 | 0.0000 1206 | 0.0000 1207 | 1208 | 1209 | 5 1210 | 0 1211 | BBBBBB 1212 | 0 1213 | 2 1214 | 0 1215 | 5 1216 | 1217 | 1218 | 0 1219 | 1 1220 | 444444 1221 | 0 1222 | 2 1223 | 0 1224 | 5 1225 | 1226 | 1227 | 5 1228 | 2 1229 | FFFF33 1230 | 0 1231 | 2 1232 | 0 1233 | 5 1234 | 1235 | 1236 | 5 1237 | 3 1238 | 00EE00 1239 | 0 1240 | 2 1241 | 0 1242 | 5 1243 | 1244 | 1245 | 4 1246 | 4 1247 | 3333FF 1248 | 0 1249 | 2 1250 | 0 1251 | 5 1252 | 1253 | 1254 | 0 1255 | 5 1256 | EE0000 1257 | 0 1258 | 2 1259 | 0 1260 | 5 1261 | 1262 | 1263 | 0 1264 | 6 1265 | 555555 1266 | 0 1267 | 2 1268 | 0 1269 | 5 1270 | 1271 | 1272 | 1273 | 1274 | 1 1275 | 0 1276 | 1277 | 1278 | 0 1279 | 1 1280 | 0 1281 | 0.0000 1282 | 100.0000 1283 | 0 1284 | 0 1285 | 0.0000 1286 | 0.0000 1287 | 1288 | 1289 | 5 1290 | 0 1291 | 3333FF 1292 | 0 1293 | 2 1294 | 0 1295 | 5 1296 | 1297 | 1298 | 5 1299 | 1 1300 | 009900 1301 | 0 1302 | 2 1303 | 0 1304 | 5 1305 | 1306 | 1307 | 2 1308 | 2 1309 | 0000AA 1310 | 0 1311 | 4 1312 | 0 1313 | 5 1314 | 1315 | 1316 | 2 1317 | 3 1318 | 007700 1319 | 0 1320 | 4 1321 | 0 1322 | 5 1323 | 1324 | 1325 | 1326 | 1327 | 1 1328 | 0 1329 | 1330 | 1331 | 0 1332 | 1 1333 | 0 1334 | 0.0000 1335 | 100.0000 1336 | 0 1337 | 0 1338 | 0.0000 1339 | 0.0000 1340 | 1341 | 1342 | 5 1343 | 0 1344 | 3333FF 1345 | 0 1346 | 2 1347 | 0 1348 | 5 1349 | 1350 | 1351 | 5 1352 | 1 1353 | 009900 1354 | 0 1355 | 2 1356 | 0 1357 | 5 1358 | 1359 | 1360 | 1361 | 1362 | 1 1363 | 0 1364 | 1365 | 1366 | 0 1367 | 1 1368 | 0 1369 | 0.0000 1370 | 100.0000 1371 | 0 1372 | 0 1373 | 0.0000 1374 | 0.0000 1375 | 1376 | 1377 | 2 1378 | 0 1379 | 0000BB 1380 | 0 1381 | 7 1382 | 0 1383 | 5 1384 | 1385 | 1386 | 2 1387 | 2 1388 | BB0000 1389 | 0 1390 | 7 1391 | 0 1392 | 5 1393 | 1394 | 1395 | 1396 | 1397 | 1 1398 | 0 1399 | 1400 | 1401 | 0 1402 | 1 1403 | 0 1404 | 0.0000 1405 | 100.0000 1406 | 0 1407 | 0 1408 | 0.0000 1409 | 0.0000 1410 | 1411 | 1412 | 2 1413 | 0 1414 | BB0000 1415 | 0 1416 | 7 1417 | 0 1418 | 5 1419 | 1420 | 1421 | 2 1422 | 1 1423 | 0000BB 1424 | 0 1425 | 7 1426 | 0 1427 | 5 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | -------------------------------------------------------------------------------- /templates/deregister/README: -------------------------------------------------------------------------------- 1 | Scripts below are based on Amazon AWS, but you can easly change it to other 2 | kind of infrastructure, check the "Requirements" for more information 3 | 4 | De-register: 5 | 6 | It is based on 2 scripts, one that gets a list of Amazon EC2 instances from a 7 | given account and the list of nodes of a given Zabbix group, and then compares 8 | both lists to decide which machines to deregister or disable the monitoring in 9 | the Zabbix server. If you are not using Amazon you need to change the way the 10 | lists are built and compared. 11 | **** You have 2 options: remove or disable the hosts, the default is to disable 12 | **** If you want to delete the hosts, uncomment the last lines of the script 13 | 14 | Notes: 15 | 16 | - This script is based in the EC2 Instance-Id. It is stored as the machine 17 | name on Zabbix and it is also used to be compared to the Amazon's running 18 | instances. If you use a diferent name for machines, the name will not 19 | match with the Amazon list and the machine will be disabled or removed 20 | in the Zabbix server and your historical data can be lost. You can change 21 | the way the lists are get and compared in both scripts 22 | - There is a template for the deregister items, usually it is linked into 23 | the Template_Scripts, the template used to a host that will take care of 24 | all stand-alone monitoring (like cloudwatch and group aggreagations) 25 | * THIS ITEM IS DISABLED BY DEFAULT, YOU HAVE TO ENABLE THIS ITEM AND 26 | CONFIGURE ITS MACROS * 27 | - Amazon's API is unpredictable when getting terminated instances, so a 28 | complete list of instances of the account is necessary 29 | - I recommended de-registration only for autoscaling groups 30 | 31 | Requirements: 32 | - An IAM account able to list all EC2 instances, nothing more 33 | - Python-boto in the script server (will be installed by chef) 34 | - An user with RW rights to the API, to the Discovered Hosts's group, to 35 | the Templates group (all your templates should be add to that group) and 36 | to all other groups involved 37 | 38 | How to: 39 | 40 | Installing the agent using Chef: 41 | * Check the roles examples 42 | - Added to the host that will handle all aggregations and stand-alone 43 | monitorings the recipe zabbix-aws::agent-deregister 44 | - Replace in your role the default cookbook's attributes with your AWS 45 | accounts (up to 5 accounts) 46 | 47 | Installing the agent manually: 48 | 49 | - create the directory /etc/zabbix/agentd.d/ 50 | $ sudo mkdir /etc/zabbix/agentd.d 51 | - copy and edit the file: 52 | cookbooks/zabbix-aws/templates/default/deregister/deregister.conf.erb 53 | to: 54 | /etc/zabbix/agentd.d/deregister.conf 55 | 56 | - copy and edit the files: 57 | cookbooks/zabbix-aws/templates/default/deregister/zabbix_deregister.sh 58 | cookbooks/zabbix-aws/templates/default/deregister/ 59 | zabbix_get_instances.py.erb 60 | to: 61 | /usr/local/bin/zabbix_deregister.sh 62 | /usr/local/bin/zabbix_get_instances.py 63 | 64 | - include the configurations in the /etc/zabbix/agentd.conf: 65 | $ echo 'Include=/etc/zabbix/agentd.d/' | 66 | sudo tee -a /etc/zabbix/agentd.conf 67 | - fix permissions and restart the agent 68 | $ sudo chown -R zabbix /etc/zabbix/agentd.d 69 | $ sudo chmod 600 /etc/zabbix/agentd.d/* 70 | $ sudo chown zabbix:root /usr/local/bin/zabbix* 71 | $ sudo chmod 750 /usr/local/bin/zabbix* 72 | $ sudo /etc/init.d/zabbix-agent restart 73 | 74 | Installing the template for 1 deregistration group/account: 75 | - Import the template into the Zabbix server 76 | - Link it to the host you installed the agent 77 | (Zabbix server or a dedicate host for scripts is recommended) 78 | - Configure the template's macros: 79 | {$DE_MYACCOUNT} = with the aws account that lists the instances 80 | {$DE_MYGROUP} = with the group of machines to be checked 81 | 82 | Installing the template for 2 deregistration groups/accounts: 83 | - Import the template into the Zabbix server 84 | - Create a new template called Template_DeRegisterMyGroup1 85 | - Link the Template_DeRegister on it 86 | - Configure the template's macros for the new template: 87 | {$DE_MYACCOUNT} = with the aws account that lists the instances 88 | {$DE_MYGROUP} = with the group of machines to be checked 89 | - repeat for DeRegisterMyGroup2 90 | 91 | Workflow: 92 | - The template asks, every minute, for the key auto.deregister 93 | - The key opens the script to processed with the following actions: 94 | - Get list of EC2 instances using {$DE_MYACCOUNT} 95 | - Get the list of Zabbix nodes in the groups {$DE_MYGROUP} 96 | - It compares both lists, if there is an instance present in the Group and 97 | not present at EC2 anymore, it is disabled (or removed) from Zabbix server 98 | - In case of error, the script returns exit code 0, and a trigger (alert) 99 | in the Zabbix server alerts you 100 | - There is another trigger to tells you if the script is not called from 101 | last 2 minutes 102 | 103 | * Use aggregated monitoring to persist teminated instances values 104 | 105 | 106 | .---------------. 107 | | zabbix server | 108 | | :10051 | 109 | .----------------. | 110 | | T .-----------. | 111 | | E | H .-------. | 112 | | M | O | ITEM -------------. .---------------------------. 113 | | P | S '-------' | '------------->| request:{name,ip,item} | 114 | | L | T | | '---------------------------' 115 | | A | .--------. | *not dns name :( 116 | | T | | MACROS | | | 117 | | E | '--------' | | 118 | '----'-----------' | v 119 | .-------->| | .--------------------. 120 | | .----->'---------------' | AWS security group | 121 | | | ^ '--------------------' 122 | | | | | 123 | | | .--------------------. v 124 | | | | AWS security group | .------------------------------. 125 | | | '--------------------' | zabbix agent | 126 | | | ^ | :10050 | 127 | | | '-------------------------| | 128 | | | exit code 0 | name: agentd.conf's hostname | 129 | | | | | 130 | | | .---------------------------------------. 131 | | | | /etc/zabbix/agentd.d/deregister.conf | 132 | | | | | 133 | | | .----------------------. |---------------------------------------. 134 | | | | /usr/local/bin/ | | keys: | 135 | | | | zabbix_deregister.sh |<--| UserParameter=auto.deregister[*] | 136 | | | .-----------------------. | '---------------------------------------' 137 | | '-| get group's host list | | 138 | | '-----------------------' | .-------------------------. 139 | | | .-----------------------. | /usr/loca/bin/ | 140 | | | | get amazon instances |----->| zabbix_get_instances.py | 141 | | | '-----------------------' '-------------------------' 142 | | .----------------------. | | 143 | | | compare lists and |--' | .----------------. 144 | '----| delete terminated | '--->| Amazon AWS API | 145 | | on Zabbix server | '----------------' 146 | '----------------------' 147 | 148 | -------------------------------------------------------------------------------- /templates/deregister/template_deregister.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | 1 7 | 8 | 127.0.0.1 9 | 10050 10 | 3 11 | 0 12 | 127.0.0.1 13 | 623 14 | 0 15 | 2 16 | 17 | 18 | 19 | Templates 20 | 21 | 22 | 23 | Error running deregister script 24 | 0 25 | {Template_Deregister:auto.deregister["{$DE_MYGROUP}","{$DE_MYACCOUNT}"].last(0)}>0 26 | 27 | 0 28 | 4 29 | 30 | 31 | 32 | No data from deregister script 33 | 0 34 | {Template_Deregister:auto.deregister["{$DE_MYGROUP}","{$DE_MYACCOUNT}"].nodata(120)}=1 35 | 36 | 0 37 | 5 38 | 39 | 40 | 41 | 42 | 43 | De Register 44 | 45 | 60 46 | 7 47 | 365 48 | 1 49 | 0 50 | exit code 51 | 0 52 | 0 53 | 0 54 | 0 55 | 56 | 57 | 0 58 | 59 | 60 | 61 | 62 | 63 | localhost 64 | 65 | 66 | 161 67 | 68 | 0 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /templates/linuxbasic/README: -------------------------------------------------------------------------------- 1 | Linux basic monitoring for Zabbix 1.8.5 2 | 3 | Goals: add abstraction to default linux template, add optimization for EC2 4 | 5 | 6 | Description: 7 | 8 | Added "cpu steal time" for vms and EC2 instances 9 | 10 | Abstraction is done by: 11 | - adding all possible devices to the graphs and triggers 12 | - instead of looking to partitions space, looking to directory spaces 13 | - you may end up with duplicated items, but it is better than configure 14 | all machines one by one 15 | - Using percentage instead of real numbers to configure graphs and triggers 16 | 17 | It also removes some default linux monitoring for inetd, smtpd, etc. 18 | 19 | 20 | Examples of: 21 | - Abstracted items, triggers and graphs 22 | 23 | Notes: 24 | - remove/change items accordingly to your needs 25 | - this template is a fork of the default linux template 26 | - pay attention, some graphics have scales in both sides 27 | 28 | Requirenments: none, only the default agent running in the clients 29 | 30 | How to: 31 | 32 | - Import the template 33 | - Link it to the instances 34 | (it can be done by the auto-register script) 35 | - if you have different system devices, add them to the triggers and graphs 36 | * check the items and graphs if something is missing for you 37 | - you can group related triggers to get less noise 38 | 39 | 40 | .---------------. 41 | | zabbix server | (Server and Agent can be the same host) 42 | | :10051 | 43 | .----------------. | 44 | | T .------------. | 45 | | E | H .-------. | 46 | | M | O | ITEMS | | .---------------------------. 47 | | P | S | ITEMS | |------------------>| request:{name,ip,item} | 48 | | L | T | ITEMS | | '---------------------------' 49 | | A | | ITEMS | | *not dns name :( 50 | | T | | ITEMS | | | 51 | | E | | ITEMS | | | 52 | '----'----'-------' | v 53 | '---------------' .--------------------. 54 | ^ | AWS security group | 55 | | '--------------------' 56 | .--------------------. | 57 | | AWS security group | v 58 | '--------------------' .------------------------------. 59 | ^ | zabbix agent | 60 | | | :10050 | 61 | .--------------------------. | | 62 | | return: {name,key,value} |<-----------| name: agentd.conf's hostname | 63 | '--------------------------' '------------------------------' 64 | *not dns name :( 65 | -------------------------------------------------------------------------------- /templates/scripts/README: -------------------------------------------------------------------------------- 1 | This template is an example of a template that imports all monitoring that 2 | are not related to a single machine. It has the aggregations, cloudwatch items, 3 | the deregistration automation and all the macros required by them 4 | 5 | Notes 6 | 7 | - It also contains the LinuxBasic template, if you already added it to your 8 | host, it can cause a conflict. You have a good option: 9 | - Unlink the Template_LinuxBasic from your host WITHOUT clear option, doing 10 | that your items will not relate to the LinuxBasic template anymore 11 | - Once you import the Template_Scripts, and link to your host, all your 12 | previous LinuxBasic items will be linked back to Template_LinuxBasic 13 | 14 | - If you want to see everything working, you will need a Varnish pool group, 15 | an AWS read-only account to get cloudwatch values, a running RDS instance, 16 | and an Autoscaling group. But none are required. 17 | 18 | 19 | Requirements: 20 | 21 | - Import all the other templates before start 22 | 23 | How to: 24 | 25 | - Import all other templates into Zabbix server 26 | - Import this template into Zabbix server 27 | - Chose a host to link the template, usually it is the Zabbix Server or a 28 | host dedicated to run "stand-alone" scripts 29 | - Install the following chef recipes in that host's role or recipe: 30 | *check their templates instructions for manually and automated instalations 31 | *check the roles examples too 32 | 33 | zabbix::agent-deregister 34 | zabbix::agent-cloudwatch 35 | 36 | - Configure the templates macros: 37 | 38 | Cloudwatch: 39 | {$MYACCOUNT} = the account you use to connect in the cloudwatch 40 | {$RDSINSTANCE} = the RDS instances you want to monitor 41 | {$AUTOSCALINGGROUPNAME} = for your autoscaling cloudwatch monitoring 42 | 43 | Deregistration: 44 | {$DE_MYACCOUNT} = for the AWS account used for the deregistration 45 | {$DE_MYGROUP} = the Zabbix group used for the deregistration 46 | 47 | Varnish Aggregation: 48 | {$MYGROUP} = the Varnish group you will aggregate values 49 | 50 | 51 | 52 | .-----------------------------------------------------. 53 | | Zabbix Server | 54 | | | 55 | | .--------------------------------------. | 56 | | |Template_Scripts | | 57 | | | | | 58 | .---------------------. | | 59 | | Template_Cloudwatch | | | 60 | '---------------------'\ .--------. | 61 | | | \ .-------. | Host | | 62 | .---------------------. \ | Macro | '--------' | 63 | | Template_VarnishAgg |---\ | Macro | | | 64 | '---------------------' \ | Macro | | | 65 | | | \__| Macro | | | 66 | .---------------------. / | Macro | | | 67 | | Template_Deregister |----/ '-------' | | 68 | '---------------------' / | | 69 | | | / | | 70 | .---------------------. / | | 71 | | Template_LinuxBasic |/ | | 72 | '---------------------' | | 73 | | | | | 74 | | '--------------------------------------' | 75 | | | 76 | '-----------------------------------------------------' 77 | -------------------------------------------------------------------------------- /templates/varnish/README: -------------------------------------------------------------------------------- 1 | Varnish example monitoring for Zabbix 1.8.5 2 | 3 | Goals: Use varnish for a template that will be used as example for group 4 | aggregation, auto-register script, and for de-registratrion automation 5 | 6 | Examples of: 7 | - Item, trigers, graphs, aggregations, trapper items usage 8 | - Calculated items for varnish cache usage (zabbix have some bugs on it) 9 | 10 | Requirenments: 11 | 12 | - Varnish installed in the server 13 | - The hosts must be linked to LinuxBasic template to aggregate CPU, MEM, IO, 14 | and Traffic usage 15 | 16 | Notes: 17 | 18 | Those are 2 templates 19 | - one to be used in all varnish machines 20 | - another to centralize/group and persist the metrics of the pool 21 | - some graphs have scale in both sides 22 | 23 | Aggregated items are storing 3 months of non-aggregated information, 24 | after that time you still be able to see aggregated avg,min,max values 25 | as trends. Trends are stored for 5 years, you may have a good DB for that 26 | 27 | Components: 28 | - A template calle "Template_Varnish" 29 | - A group called "Varnish" 30 | - A template called "Template_VarnishAgg" to aggregate group values 31 | - A macro (variable) with the group name (you may have more than one) 32 | 33 | 34 | How to: 35 | 36 | For single varnish pool, no auto-register: 37 | 38 | - Using chef, check the cookbook's default values, and if you need replace 39 | them in your role (check the roles examples) 40 | - Add the recipe zabbix-aws::agent-varnish to the Varnish's role 41 | * Your zabbix-agent have to include the dir /etc/zabbix/agentd.d/ 42 | - Import both templates into Zabbix server 43 | - Create a Zabbix hostgroup called Varnish, if it is not already there 44 | - Pick up a host to run the aggregations, link it to the Template_VarnishAgg 45 | - Zabbix server is recomended or any host that is dedicated to run all the 46 | scripts 47 | - In that host (not a varnish pool host), link the Template_VarnishAgg on it 48 | - Configure in Template_VarnishAgg the macro: 49 | {$MYGROUP} = Varnish 50 | - Link all the Varnish hosts to the Template_Varnish and the Varnish group 51 | 52 | 53 | For two varnish groups, no auto-register: 54 | 55 | - Using chef, check the cookbook's default values, and if you need replace 56 | them in your role (check the roles examples) 57 | - Add the recipe zabbix-aws::agent-varnish to the Varnish's role 58 | * Your zabbix-agent have to include the dir /etc/zabbix/agentd.d/ 59 | - Import both templates into Zabbix server 60 | - Create a Template_VarnishMyGroup1 61 | - In the creating form, add the group Templates, for organization 62 | - Still in the creating form, use "MyGroup1" as a new group 63 | - Link the Template_Varnish on this new template 64 | - Create a Template_VarnishMyGroup1Agg 65 | - In the creating form, add the group Templates, for organization 66 | - Link the Template_VarnishAgg on this new template 67 | - Confirgure the macro {$MYGROUP}=VarnishMyGroup1 68 | - Pick up a host to run the aggregations, and link it to the 69 | Template_VarnishMyGroup1agg 70 | - Zabbix server is recomended or any host that is dedicated to run all the 71 | scripts 72 | - Link all the Varnish hosts of the MyGroup1 pool into the Template_VarnishMyGroup1 73 | - Repeat to Template_VarnishMyGroup2 74 | 75 | Using auto-register: 76 | 77 | For single varnish group: 78 | - Using chef, check the cookbook's default values, and if you need replace 79 | them in your role (check the roles examples) 80 | - Use the chef's zabbix-aws::agent-varnish recipe at the hosts' role 81 | * Your zabbix-agent have to include the dir /etc/zabbix/agentd.d/ 82 | - add to your varnish role the recipe zabbix-aws::agent-autoregister 83 | 84 | For two varnish groups: 85 | - Using chef, check the cookbook's default values, and if you need replace 86 | them in your role (check the roles examples) 87 | - Copy the recipe zabbix-aws::agent-varnish locate at: 88 | cookbooks/zabbix-aws/agent-varnish.rb 89 | to: 90 | cookbooks/zabbix-aws/agent-varnishmygroup1.rb 91 | (because it is impossible to change tags at roles level) 92 | - Change the tags commands from Varnish to VarnishMyGroup1 93 | - copy or change your role to use this recipe instead of varnish default 94 | - add the recipe zabbix-aws::agent-autoregister to your role 95 | - Update the role and cookbook in the chef server 96 | - repeat to the VarnishMyGroup2 97 | 98 | * There are two zabbixMyGroup recipes examples, one copying the default 99 | varnish group, and another importing it 100 | * You can add (as in the example) a variable "expected_tag" if you want 101 | to force all machines in a recipe to try to register again 102 | 103 | Install the agent files manually 104 | 105 | In the varnish servers: 106 | - create the directory /etc/zabbix/agentd.d/ 107 | $ sudo mkdir /etc/zabbix/agentd.d 108 | - copy file cookbooks/zabbix-aws/files/default/varnish/varnish.conf 109 | to /etc/zabbix/agentd.d/varnish.conf 110 | - edit the Zabbix server in that file to your own Zabbix server 111 | - include the configurations in the agentd: 112 | $ echo 'Include=/etc/zabbix/agentd.d/' | 113 | sudo tee -a /etc/zabbix/agentd.conf 114 | $ sudo chown -R zabbix /etc/zabbix/agentd.d 115 | $ sudo chmod 600 /etc/zabbix/agentd.d/* 116 | $ sudo /etc/init.d/zabbix-agent restart 117 | 118 | 119 | 120 | This diagram is only for the Varnish servers, not for the aggregation 121 | 122 | .---------------. 123 | | zabbix server | (Server and Agent can be the same host) 124 | | :10051 | 125 | .----------------. | 126 | | T .-----------. | 127 | | E | H .-------. | 128 | | M | O | ITEM -------------. .---------------------------. 129 | | P | S '-------' | '------------->| request:{name,ip,item} | 130 | | L | T | | (ask for '---------------------------' 131 | | A | .--------------. | the list) *not dns name :( 132 | | T | | ITEM TRAPPER | | | 133 | | E | | ITEM TRAPPER | | | 134 | '----'----| ITEM TRAPPER | | v 135 | | ... |-' .--------------------. 136 | '--------------' | AWS security group | 137 | ^ '--------------------' 138 | | | 139 | .--------------------. v 140 | | AWS security group | .------------------------------. 141 | '--------------------' | zabbix agent | 142 | ^ | :10050 | 143 | | | | 144 | | | name: agentd.conf's hostname | 145 | .------------------------. | | 146 | | zabbix_sender | .---------------------------------------. 147 | | file list with: | | /etc/zabbix/agentd.d/varnish.conf | 148 | | name,key,value | | | 149 | | ... |<---------|---------------------------------------. 150 | '------------------------' | keys: | 151 | | | 152 | | UserParameter=varnish_collect[*] | 153 | .----------------------------. '---------------------------------------' 154 | | chef | ^ 155 | | .--------------------------. | 156 | | | role: myvarnish.rb | | 157 | | | .--------------------.-------------------------------------. 158 | | '-----| cookbook: | install: | 159 | | | - static conf | /etc/zabbix/agent.d/varnish.conf | 160 | '-------'--------------------'-------------------------------------' 161 | (can contain recipe+tag to auto-register) 162 | 163 | 164 | Diagram for the aggregation 165 | 166 | .--------------------------------------------------. 167 | | zabbix server | 168 | | | 169 | .----------------. | 170 | | G .------. | | 171 | | R | HOST .------. | 172 | | O '------| ITEM |- | 173 | | U '------' \ | 174 | | P .------. | \ | 175 | | | HOST .------. \ .-----------------. 176 | | '------| ITEM |----\ | SCRIPT HOST | 177 | | '------' \ | .------------. | 178 | | .------. | \ | | ITEMS | | 179 | | | HOST .------. \ .-----------. .----------------. | | 180 | | '------| ITEM |--------+--| CALCULATE |----| AGG=CALCULATED | | | 181 | | '------' / '-----------' '----------------' | | 182 | | .------. | / .----------------. | | 183 | | | HOST .------. / | AGG=CALCULATED | | | 184 | | '------| ITEM |----/ '----------------' | | 185 | | '------' / .----------------. | | 186 | | .------. | / | AGG=CALCULATED | | | 187 | | | HOST .------. / '----------------' | | 188 | | '------| ITEM |- | '-----------' | 189 | | '------' '-----------------' 190 | '----------------' | 191 | | | 192 | '--------------------------------------------------' 193 | -------------------------------------------------------------------------------- /templates/varnish/varnishagg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | 1 7 | 8 | 127.0.0.1 9 | 10050 10 | 3 11 | 0 12 | 127.0.0.1 13 | 623 14 | 0 15 | 2 16 | 17 | 18 | 19 | Templates 20 | VarnishAgg 21 | 22 | 23 | 24 | 25 | Varnish Avg Backend Reqs Aggregated 26 | 27 | 30 28 | 35 29 | 1855 30 | 0 31 | 0 32 | req/s 33 | 0 34 | 0 35 | 0 36 | 0 37 | 38 | 39 | 0 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 161 49 | 50 | 0 51 | 52 | 53 | 54 | 55 | 56 | Varnish Avg Cached Reqs Aggregated 57 | 58 | 30 59 | 35 60 | 1855 61 | 0 62 | 0 63 | req/s 64 | 0 65 | 0 66 | 0 67 | 0 68 | 69 | 70 | 0 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 161 80 | 81 | 0 82 | 83 | 84 | 85 | 86 | 87 | Varnish Avg Cache Missed Reqs Aggregated 88 | 89 | 30 90 | 35 91 | 1855 92 | 0 93 | 0 94 | req/s 95 | 0 96 | 0 97 | 0 98 | 0 99 | 100 | 101 | 0 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 161 111 | 112 | 0 113 | 114 | 115 | 116 | 117 | 118 | Varnish Avg Reqs Aggregated 119 | 120 | 30 121 | 35 122 | 1855 123 | 0 124 | 0 125 | req/s 126 | 0 127 | 0 128 | 0 129 | 0 130 | 131 | 132 | 0 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 161 142 | 143 | 0 144 | 145 | 146 | 147 | 148 | 149 | Varnish Avg Eth0-In traffic Aggregated 150 | 151 | 30 152 | 35 153 | 1855 154 | 0 155 | 0 156 | Bps 157 | 0 158 | 0 159 | 0 160 | 0 161 | 162 | 163 | 0 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 161 173 | 174 | 0 175 | 176 | 177 | 178 | 179 | 180 | Varnish Avg Eth0-Out traffic Aggregated 181 | 182 | 30 183 | 35 184 | 1855 185 | 0 186 | 0 187 | Bps 188 | 0 189 | 0 190 | 0 191 | 0 192 | 193 | 194 | 0 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 161 204 | 205 | 0 206 | 207 | 208 | 209 | 210 | 211 | Varnish Avg CPU Idle Aggregated 212 | 213 | 30 214 | 35 215 | 1855 216 | 0 217 | 0 218 | % 219 | 0 220 | 0 221 | 0 222 | 0 223 | 224 | 225 | 0 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 161 235 | 236 | 0 237 | 238 | 239 | 240 | 241 | 242 | Varnish Avg CPU IOWait Aggregated 243 | 244 | 30 245 | 35 246 | 1855 247 | 0 248 | 0 249 | % 250 | 0 251 | 0 252 | 0 253 | 0 254 | 255 | 256 | 0 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 161 266 | 267 | 0 268 | 269 | 270 | 271 | 272 | 273 | Varnish Avg Swap Free Aggregated 274 | 275 | 30 276 | 35 277 | 1855 278 | 0 279 | 0 280 | B 281 | 0 282 | 0 283 | 0 284 | 0 285 | 286 | 287 | 0 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 161 297 | 298 | 0 299 | 300 | 301 | 302 | 303 | 304 | Varnish Avg Swap % Free Aggregated 305 | 306 | 30 307 | 35 308 | 1855 309 | 0 310 | 0 311 | % 312 | 0 313 | 0 314 | 0 315 | 0 316 | 317 | 318 | 0 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 161 328 | 329 | 0 330 | 331 | 332 | 333 | 334 | 335 | Varnish Avg Swap Size Aggregated 336 | 337 | 1800 338 | 35 339 | 1855 340 | 0 341 | 0 342 | B 343 | 0 344 | 0 345 | 0 346 | 0 347 | 348 | 349 | 0 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 161 359 | 360 | 0 361 | 362 | 363 | 364 | 365 | 366 | Varnish Avg NoCache Reqs Aggregated 367 | 368 | 30 369 | 35 370 | 1855 371 | 0 372 | 0 373 | req/s 374 | 0 375 | 0 376 | 0 377 | 0 378 | 379 | 380 | 0 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 161 390 | 391 | 0 392 | 393 | 394 | 395 | 396 | 397 | Varnish Avg Available Mem Aggregated 398 | 399 | 30 400 | 35 401 | 1855 402 | 0 403 | 0 404 | B 405 | 0 406 | 0 407 | 0 408 | 0 409 | 410 | 411 | 0 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 161 421 | 422 | 0 423 | 424 | 425 | 426 | 427 | 428 | Varnish Avg Total Mem Aggregated 429 | 430 | 30 431 | 35 432 | 1855 433 | 0 434 | 0 435 | B 436 | 0 437 | 0 438 | 0 439 | 0 440 | 441 | 442 | 0 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 161 452 | 453 | 0 454 | 455 | 456 | 457 | 458 | 459 | Varnish Total Backend Reqs Aggregated 460 | 461 | 30 462 | 35 463 | 1855 464 | 0 465 | 0 466 | req/s 467 | 0 468 | 0 469 | 0 470 | 0 471 | 472 | 473 | 0 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 161 483 | 484 | 0 485 | 486 | 487 | 488 | 489 | 490 | Varnish Total Cached Reqs Aggregated 491 | 492 | 30 493 | 35 494 | 1855 495 | 0 496 | 0 497 | req/s 498 | 0 499 | 0 500 | 0 501 | 0 502 | 503 | 504 | 0 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 161 514 | 515 | 0 516 | 517 | 518 | 519 | 520 | 521 | Varnish Total Cache Missed Reqs Aggregated 522 | 523 | 30 524 | 35 525 | 1855 526 | 0 527 | 0 528 | req/s 529 | 0 530 | 0 531 | 0 532 | 0 533 | 534 | 535 | 0 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 161 545 | 546 | 0 547 | 548 | 549 | 550 | 551 | 552 | Varnish Total Reqs Aggregated 553 | 554 | 30 555 | 35 556 | 1855 557 | 0 558 | 0 559 | req/s 560 | 0 561 | 0 562 | 0 563 | 0 564 | 565 | 566 | 0 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 161 576 | 577 | 0 578 | 579 | 580 | 581 | 582 | 583 | Varnish Total Eth0-In traffic Aggregated 584 | 585 | 30 586 | 35 587 | 1855 588 | 0 589 | 0 590 | Bps 591 | 0 592 | 0 593 | 0 594 | 0 595 | 596 | 597 | 0 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 161 607 | 608 | 0 609 | 610 | 611 | 612 | 613 | 614 | Varnish Total Eth0-Out traffic Aggregated 615 | 616 | 30 617 | 35 618 | 1855 619 | 0 620 | 0 621 | Bps 622 | 0 623 | 0 624 | 0 625 | 0 626 | 627 | 628 | 0 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 161 638 | 639 | 0 640 | 641 | 642 | 643 | 644 | 645 | Varnish Total CPU Idle Aggregated 646 | 647 | 30 648 | 35 649 | 1855 650 | 0 651 | 0 652 | % 653 | 0 654 | 0 655 | 0 656 | 0 657 | 658 | 659 | 0 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 161 669 | 670 | 0 671 | 672 | 673 | 674 | 675 | 676 | Varnish Total CPU IOWait Aggregated 677 | 678 | 30 679 | 35 680 | 1855 681 | 0 682 | 0 683 | % 684 | 0 685 | 0 686 | 0 687 | 0 688 | 689 | 690 | 0 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 161 700 | 701 | 0 702 | 703 | 704 | 705 | 706 | 707 | Varnish Total Swap Free Aggregated 708 | 709 | 30 710 | 35 711 | 1855 712 | 0 713 | 0 714 | B 715 | 0 716 | 0 717 | 0 718 | 0 719 | 720 | 721 | 0 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 161 731 | 732 | 0 733 | 734 | 735 | 736 | 737 | 738 | Varnish Total Swap % Free Aggregated 739 | 740 | 30 741 | 35 742 | 1855 743 | 0 744 | 0 745 | % 746 | 0 747 | 0 748 | 0 749 | 0 750 | 751 | 752 | 0 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 161 762 | 763 | 0 764 | 765 | 766 | 767 | 768 | 769 | Varnish Total Swap Size Aggregated 770 | 771 | 1800 772 | 35 773 | 1855 774 | 0 775 | 0 776 | B 777 | 0 778 | 0 779 | 0 780 | 0 781 | 782 | 783 | 0 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 161 793 | 794 | 0 795 | 796 | 797 | 798 | 799 | 800 | Varnish Total NoCache Reqs Aggregated 801 | 802 | 30 803 | 35 804 | 1855 805 | 0 806 | 0 807 | req/s 808 | 0 809 | 0 810 | 0 811 | 0 812 | 813 | 814 | 0 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 161 824 | 825 | 0 826 | 827 | 828 | 829 | 830 | 831 | Varnish Total Available Mem Aggregated 832 | 833 | 30 834 | 35 835 | 1855 836 | 0 837 | 0 838 | B 839 | 0 840 | 0 841 | 0 842 | 0 843 | 844 | 845 | 0 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 161 855 | 856 | 0 857 | 858 | 859 | 860 | 861 | 862 | Varnish Total Mem Aggregated 863 | 864 | 30 865 | 35 866 | 1855 867 | 0 868 | 0 869 | B 870 | 0 871 | 0 872 | 0 873 | 0 874 | 875 | 876 | 0 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 161 886 | 887 | 0 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 1 897 | 0 898 | 899 | 900 | 0 901 | 1 902 | 0 903 | 0.0000 904 | 100.0000 905 | 0 906 | 0 907 | 0.0000 908 | 0.0000 909 | 910 | 911 | 5 912 | 0 913 | 770077 914 | 1 915 | 7 916 | 0 917 | 5 918 | 919 | 920 | 1 921 | 1 922 | FFCCFF 923 | 1 924 | 7 925 | 0 926 | 5 927 | 928 | 929 | 2 930 | 2 931 | 444444 932 | 0 933 | 7 934 | 0 935 | 5 936 | 937 | 938 | 2 939 | 3 940 | 888888 941 | 0 942 | 7 943 | 0 944 | 5 945 | 946 | 947 | 948 | 949 | 1 950 | 0 951 | 952 | 953 | 0 954 | 1 955 | 1 956 | 0.0000 957 | 100.0000 958 | 0 959 | 0 960 | 0.0000 961 | 0.0000 962 | 963 | 964 | 1 965 | 3 966 | 000000 967 | 0 968 | 2 969 | 0 970 | 5 971 | 972 | 973 | 1 974 | 4 975 | 444444 976 | 0 977 | 2 978 | 0 979 | 5 980 | 981 | 982 | 1 983 | 5 984 | 888888 985 | 0 986 | 2 987 | 0 988 | 5 989 | 990 | 991 | 1 992 | 11 993 | 770077 994 | 0 995 | 2 996 | 0 997 | 5 998 | 999 | 1000 | 1 1001 | 12 1002 | CC00CC 1003 | 0 1004 | 2 1005 | 0 1006 | 5 1007 | 1008 | 1009 | 1 1010 | 13 1011 | FFCCFF 1012 | 0 1013 | 2 1014 | 0 1015 | 5 1016 | 1017 | 1018 | 1019 | 1020 | 1 1021 | 0 1022 | 1023 | 1024 | 0 1025 | 1 1026 | 0 1027 | 0.0000 1028 | 100.0000 1029 | 0 1030 | 0 1031 | 0.0000 1032 | 0.0000 1033 | 1034 | 1035 | 5 1036 | 0 1037 | 3333FF 1038 | 1 1039 | 7 1040 | 0 1041 | 5 1042 | 1043 | 1044 | 5 1045 | 1 1046 | 33FF33 1047 | 1 1048 | 2 1049 | 0 1050 | 5 1051 | 1052 | 1053 | 2 1054 | 2 1055 | 0000EE 1056 | 0 1057 | 7 1058 | 0 1059 | 5 1060 | 1061 | 1062 | 2 1063 | 3 1064 | 00CC00 1065 | 0 1066 | 7 1067 | 0 1068 | 5 1069 | 1070 | 1071 | 1072 | 1073 | 1 1074 | 0 1075 | 1076 | 1077 | 0 1078 | 1 1079 | 0 1080 | 0.0000 1081 | 100.0000 1082 | 0 1083 | 0 1084 | 0.0000 1085 | 0.0000 1086 | 1087 | 1088 | 2 1089 | 0 1090 | 444444 1091 | 0 1092 | 7 1093 | 0 1094 | 5 1095 | 1096 | 1097 | 5 1098 | 1 1099 | 770077 1100 | 1 1101 | 7 1102 | 0 1103 | 5 1104 | 1105 | 1106 | 1107 | 1108 | 1 1109 | 0 1110 | 1111 | 1112 | 0 1113 | 1 1114 | 0 1115 | 0.0000 1116 | 100.0000 1117 | 0 1118 | 0 1119 | 0.0000 1120 | 0.0000 1121 | 1122 | 1123 | 2 1124 | 0 1125 | 444444 1126 | 0 1127 | 7 1128 | 0 1129 | 5 1130 | 1131 | 1132 | 5 1133 | 1 1134 | 770077 1135 | 1 1136 | 7 1137 | 0 1138 | 5 1139 | 1140 | 1141 | 1142 | 1143 | 1 1144 | 0 1145 | 1146 | 1147 | 0 1148 | 1 1149 | 0 1150 | 0.0000 1151 | 100.0000 1152 | 0 1153 | 0 1154 | 0.0000 1155 | 0.0000 1156 | 1157 | 1158 | 2 1159 | 0 1160 | 770000 1161 | 0 1162 | 7 1163 | 0 1164 | 5 1165 | 1166 | 1167 | 5 1168 | 1 1169 | CC0000 1170 | 1 1171 | 7 1172 | 0 1173 | 5 1174 | 1175 | 1176 | 1177 | 1178 | 1 1179 | 0 1180 | 1181 | 1182 | 0 1183 | 1 1184 | 0 1185 | 0.0000 1186 | 100.0000 1187 | 0 1188 | 0 1189 | 0.0000 1190 | 0.0000 1191 | 1192 | 1193 | 2 1194 | 0 1195 | 444444 1196 | 0 1197 | 7 1198 | 0 1199 | 5 1200 | 1201 | 1202 | 5 1203 | 1 1204 | 770077 1205 | 1 1206 | 7 1207 | 0 1208 | 5 1209 | 1210 | 1211 | 1212 | 1213 | 1 1214 | 0 1215 | 1216 | 1217 | 0 1218 | 1 1219 | 0 1220 | 0.0000 1221 | 100.0000 1222 | 0 1223 | 0 1224 | 0.0000 1225 | 0.0000 1226 | 1227 | 1228 | 2 1229 | 0 1230 | 444444 1231 | 0 1232 | 7 1233 | 0 1234 | 5 1235 | 1236 | 1237 | 5 1238 | 1 1239 | 770077 1240 | 1 1241 | 7 1242 | 0 1243 | 5 1244 | 1245 | 1246 | 1247 | 1248 | 1 1249 | 0 1250 | 1251 | 1252 | 0 1253 | 1 1254 | 0 1255 | 0.0000 1256 | 100.0000 1257 | 0 1258 | 0 1259 | 0.0000 1260 | 0.0000 1261 | 1262 | 1263 | 1 1264 | 0 1265 | 440000 1266 | 1 1267 | 7 1268 | 0 1269 | 5 1270 | 1271 | 1272 | 5 1273 | 1 1274 | DD0000 1275 | 1 1276 | 7 1277 | 0 1278 | 5 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | Varnish 1286 | {$MYGROUP} 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | --------------------------------------------------------------------------------