Преглед изворни кода

Remove munin monitoring tasks

Emmanuel Bouthenot пре 7 година
родитељ
комит
c2fc05a575

+ 0 - 13
roles/monitoring/defaults/main.yml

@@ -4,19 +4,6 @@
 
 with_mon: False
 
-with_munin: False
-with_munin_node: False
-
-munin_master_vhostname: localhost
-
-with_munin_http_auth: False
-
-munin_masters:
-  - 127.0.0.1/32
-munin_nodes:
-  - node: localhost
-    address: 127.0.0.1
-
 with_zabbix_agent: False
 zabbix_remote_server: 'zabbix.domain.tld'
 zabbix_plugins_config: Null

+ 0 - 1
roles/monitoring/handlers/main.yml

@@ -1,3 +1,2 @@
-- include: munin.yml
 - include: mon.yml
 - include: zabbix.yml

+ 0 - 8
roles/monitoring/handlers/munin.yml

@@ -1,8 +0,0 @@
-- name: Restart munin-node
-  service: name=munin-node state=restarted
-
-- name: Reload nginx for munin
-  service: name=nginx state=reloaded
-
-- name: Reload apache2 for munin
-  service: name=apache2 state=reloaded

+ 0 - 3
roles/monitoring/tasks/main.yml

@@ -1,6 +1,3 @@
-- include: munin.yml
-  tags: [monitoring,munin]
-  when: with_munin or with_munin_node
 - include: mon.yml
   tags: [monitoring,mon]
   when: with_mon

+ 0 - 72
roles/monitoring/tasks/munin.yml

@@ -1,72 +0,0 @@
-- name: Install munin packages
-  apt: pkg=munin state=installed
-  when: with_munin
-
-- name: Install munin configuration
-  template: src=munin/munin.conf.j2 dest=/etc/munin/munin.conf owner=root group=root mode=0644
-  when: with_munin
-
-- name: Install munin-node packages
-  apt: pkg={{ item }} state=installed
-  with_items:
-    - munin-node
-    - munin-plugins-extra
-    - libnet-cidr-perl
-    - libcache-cache-perl
-    - libdbd-pg-perl
-    - libdbd-mysql-perl
-    - liblwp-useragent-determined-perl
-  when: with_munin_node
-
-- name: Create need directories for munin-node configuration
-  file: path=/etc/munin/{{ item }} state=directory owner=root group=root mode=0755
-  with_items:
-    - plugins
-    - plugin-conf.d
-  when: with_munin_node
-
-- name: Install munin node configuration
-  template: src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
-  notify:
-    - Restart munin-node
-  when: with_munin_node
-
-- name: Install munin node plugins configuration
-  template: src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
-  notify:
-    - Restart munin-node
-  when: with_munin_node
-
-#- name: Autoconfigure munin-node plugins
-#  munin_node_autoconf: families=auto,manual,contrib excludes=apc_nis,apt,apt_all,port_,ipmi_fans,ipmi_power,ipmi_temp,ntp_,ircu,ntp_kernel_err,ntp_kernel_pll_freq,ntp_kernel_pll_off,ntp_offset,ntp_states
-#  notify:
-#    - Restart munin-node
-#  when: with_munin_node
-
-- name: Install nginx virtual host for munin (sites-available)
-  template: src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
-  notify:
-    - Reload nginx for munin
-  when: with_munin and with_nginx is defined and with_nginx
-
-- name: Install nginx virtual host for munin (sites-enabled)
-  file: src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
-  notify:
-    - Reload nginx for munin
-  when: with_munin and with_nginx is defined and with_nginx
-
-- name: Install apache2 virtual host for munin (sites-available)
-  template: src=munin/apache2_vhost.j2 dest=/etc/apache2/sites-available/munin.conf owner=root group=root mode=0644
-  notify:
-    - Reload apache2 for munin
-  when: with_munin and with_apache2 is defined and with_apache2
-
-- name: Install apache2 virtual host for munin (sites-enabled)
-  file: src=/etc/apache2/sites-available/munin.conf path=/etc/apache2/sites-enabled/munin.conf state=link
-  notify:
-    - Reload apache2 for munin
-  when: with_munin and with_apache2 is defined and with_apache2
-
-- name: Ensure munin-node is running
-  service: name=munin-node state=started
-  when: with_munin_node

+ 0 - 31
roles/monitoring/templates/munin/apache2_vhost.j2

@@ -1,31 +0,0 @@
-{% if ansible_prolog -%}
-{% from 'templates/ansible/prolog.j2' import prolog with context %}
-{{ prolog() }}
-{% endif -%}
-# Apache vhost for munin
-
-<VirtualHost *:80>
-    ServerName {{ munin_master_vhostname }}
-
-    DocumentRoot /var/cache/munin/www
-    DirectoryIndex index.html
-
-    <Location />
-        AuthType basic
-        AuthName "Restricted Access"
-        AuthUserFile /etc/apache2/auth_admin
-        Require valid-user
-    </Location>
-
-    <Directory /var/cache/munin/www>
-        Options None
-        AllowOverride None
-        Order allow,deny
-        Allow from all
-    </Directory>
-
-    LogLevel warn
-    CustomLog ${APACHE_LOG_DIR}/munin.access.log combined
-    ErrorLog ${APACHE_LOG_DIR}/munin.error.log
-
-</VirtualHost>

+ 0 - 70
roles/monitoring/templates/munin/munin-node.conf.j2

@@ -1,70 +0,0 @@
-{% if ansible_prolog -%}
-{% from 'templates/ansible/prolog.j2' import prolog with context %}
-{{ prolog() }}
-{% endif -%}
-#
-# Example config-file for munin-node
-#
-
-log_level 4
-log_file /var/log/munin/munin-node.log
-pid_file /var/run/munin/munin-node.pid
-
-background 1
-setsid 1
-
-user root
-group root
-
-# Regexps for files to ignore
-{% if ansible_lsb.codename != 'lenny' and ansible_lsb.codename != 'squeeze' %}
-ignore_file [\#~]$
-{% endif %}
-ignore_file DEADJOE$
-ignore_file \.bak$
-ignore_file %$
-ignore_file \.dpkg-(tmp|new|old|dist)$
-ignore_file \.rpm(save|new)$
-ignore_file \.pod$
-
-# Set this if the client doesn't report the correct hostname when
-# telnetting to localhost, port 4949
-#
-#host_name localhost.localdomain
-host_name {{ ansible_fqdn }}
-
-# A list of addresses that are allowed to connect.  This must be a
-# regular expression, since Net::Server does not understand CIDR-style
-# network notation unless the perl module Net::CIDR is installed.  You
-# may repeat the allow line as many times as you'd like
-
-allow ^127\.0\.0\.1$
-allow ^::1$
-
-# If you have installed the Net::CIDR perl module, you can use one or more
-# cidr_allow and cidr_deny address/mask patterns.  A connecting client must
-# match any cidr_allow, and not match any cidr_deny.  Note that a netmask
-# *must* be provided, even if it's /32
-#
-# Example:
-#
-# cidr_allow 127.0.0.1/32
-# cidr_allow 192.0.2.0/24
-# cidr_deny  192.0.2.42/32
-{% if munin_masters is defined %}
-{% for master in munin_masters %}
-cidr_allow {{ master }}
-{% endfor %}
-{% endif %}
-
-# Which address to bind to;
-host *
-# host 127.0.0.1
-
-# And which port
-port 4949
-
-{% if munin_node_timeout is defined %}
-# Timeout
-timeout = {{ munin_node_timeout }}
-{% endif %}

+ 0 - 129
roles/monitoring/templates/munin/munin-node.conf.plugins.j2

@@ -1,129 +0,0 @@
-{% if ansible_prolog -%}
-{% from 'templates/ansible/prolog.j2' import prolog with context %}
-{{ prolog() }}
-{% endif -%}
-# This file is used to configure how the plugins are invoked.
-# Place in /etc/munin/plugin-conf.d/ or corresponding directory.
-#
-# PLEASE NOTE: Changes in the plugin-conf.d directory are only
-# read at munin-node startup, so restart at any changes.
-#
-# user <user>         # Set the user to run the plugin as.
-# group <group>       # Set the group to run the plugin as.
-# command <command>   # Run <command> instead of the plugin. %c expands to
-#                       what would normally be run.
-# env.<variable> <value> # Sets <variable> in the plugin's environment, see the
-#                       individual plugins to find out which variables they
-#                       care about.
-
-[amavis]
-group adm
-env.MUNIN_MKTEMP /bin/mktemp -p /tmp/ $1
-env.amavislog /var/log/mail.info
-
-[apt]
-user root
-
-[courier_mta_mailqueue]
-group daemon
-
-[courier_mta_mailstats]
-group adm
-
-[courier_mta_mailvolume]
-group adm
-
-[cps*]
-user root
-
-[df*]
-env.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs
-env.warning 85
-env.critical 95
-
-[exim_mailqueue]
-group adm, (Debian-exim)
-
-[exim_mailstats]
-group adm, (Debian-exim)
-env.logdir /var/log/exim4/
-env.logname mainlog
-
-[fw_conntrack]
-user root
-
-[fw_forwarded_local]
-user root
-
-[hddtemp_smartctl]
-user root
-
-[hddtemp2]
-user root
-
-[if_*]
-user root
-
-[if_err_*]
-user nobody
-
-[ip_*]
-user root
-
-[ipmi_*]
-user root
-
-[mysql*]
-user root
-env.mysqlopts --defaults-file=/etc/mysql/debian.cnf
-env.mysqluser debian-sys-maint
-env.mysqlconnection DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf
-
-[mysql_innodb]
-env.warning 0
-env.critical 0
-
-[postfix_mailqueue]
-user postfix
-
-[postfix_mailstats]
-group adm
-
-[postfix_mailvolume]
-group adm
-env.logfile mail.log
-
-[smart_*]
-user root
-
-[vlan*]
-user root
-
-[ejabberd*]
-user ejabberd
-env.statuses available away chat xa
-env.days 1 7 30
-
-[dhcpd3]
-user root
-env.leasefile /var/lib/dhcp3/dhcpd.leases
-env.configfile /etc/dhcp3/dhcpd.conf
-
-[jmx_*]
-env.ip 127.0.0.1
-env.port 5400
-
-[samba]
-user root
-
-[munin_stats]
-user munin
-group munin
-
-[postgres_*]
-user postgres
-env.PGUSER postgres
-env.PGPORT 5432
-
-[fail2ban]
-user root

+ 0 - 139
roles/monitoring/templates/munin/munin.conf.j2

@@ -1,139 +0,0 @@
-{% if ansible_prolog -%}
-{% from 'templates/ansible/prolog.j2' import prolog with context %}
-{{ prolog() }}
-{% endif -%}
-# Example configuration file for Munin, generated by 'make build'
-
-# The next three variables specifies where the location of the RRD
-# databases, the HTML output, logs and the lock/pid files.  They all
-# must be writable by the user running munin-cron.  They are all
-# defaulted to the values you see here.
-#
-# dbdir /var/lib/munin
-# htmldir /var/cache/munin/www
-# logdir /var/log/munin
-# rundir  /var/run/munin
-#
-# Where to look for the HTML templates
-# tmpldir   /etc/munin/templates
-
-# (Exactly one) directory to include all files from.
-#
-includedir /etc/munin/munin-conf.d
-
-# Make graphs show values per minute instead of per second
-#graph_period minute
-
-# Graphics files are normaly generated by munin-graph, no matter if
-# the graphs are used or not.  You can change this to
-# on-demand-graphing by following the instructions in
-# http://munin.projects.linpro.no/wiki/CgiHowto
-#
-#graph_strategy cgi
-
-# munin-cgi-graph is invoked by the web server up to very many times at the
-# same time.  This is not optimal since it results in high CPU and memory
-# consumption to the degree that the system can thrash.  Again the default is
-# 6.  Most likely the optimal number for max_cgi_graph_jobs is the same as
-# max_graph_jobs.
-#
-#munin_cgi_graph_jobs 6
-
-# If the automatic CGI url is wrong for your system override it here:
-#
-#cgiurl_graph /cgi-bin/munin-cgi-graph
-
-# munin-graph runs in parallel, the number of concurrent processes is
-# 6.  If you want munin-graph to not be parallel set to 0.  If set too
-# high it will slow down munin-graph.  Some experiments are needed to
-# determine how many are optimal on your system.  On a multi-core
-# system with good SCSI disks the number can probably be quite high.
-# 
-#max_graph_jobs 6
-
-# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime 
-# something changes (OK -> WARNING, CRITICAL -> OK, etc)
-#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
-#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
-contacts root
-contact.root.command mail -s 'MUNIN – [${var:host}] ~ ${var:graph_title}' root
-contact.root.always_send warning critical
-
-# For those with Nagios, the following might come in handy. In addition,
-# the services must be defined in the Nagios server as well.
-#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
-
-# a simple host tree
-{% if munin_nodes is defined %}
-{% for node in munin_nodes %}
-[{{ node.node }}]
-{% if node.address is defined %}
-    address {{ node.address }}
-{% else %}
-    address {{ node.node }}
-{% endif %}
-    use_node_name yes
-{% if node.port is defined %}
-    port {{ node.port }}
-{% endif %}
-{% if munin_load_warning is defined %}
-    load.load.warning {{ munin_load_warning }}
-{% endif %}
-{% if munin_load_critical is defined %}
-    load.load.critical {{ munin_load_critical }}
-{% endif %}
-{% if munin_swap_warning is defined %}
-    memory.swap.warning {{ munin_swap_warning }}
-{% endif %}
-{% if munin_swap_critical is defined %}
-    memory.swap.critical {{ munin_swap_critical }}
-{% endif %}
-{% if munin_postfix_mailqueue_warning is defined %}
-    postfix_mailqueue.deferred.warning {{ munin_postfix_mailqueue_warning }}
-{% endif %}
-{% if munin_postfix_mailqueue_critical is defined %}
-    postfix_mailqueue.deferred.critical {{ munin_postfix_mailqueue_critical }}
-{% endif %}
-{% endfor %}
-{% endif %}
-
-#
-# A more complex example of a host tree
-#
-## First our "normal" host.
-# [fii.foo.com]
-#       address foo
-#
-## Then our other host...
-# [fay.foo.com]
-#       address fay
-#
-## Then we want totals...
-# [foo.com;Totals] #Force it into the "foo.com"-domain...
-#       update no   # Turn off data-fetching for this "host".
-#
-#   # The graph "load1". We want to see the loads of both machines... 
-#   # "fii=fii.foo.com:load.load" means "label=machine:graph.field"
-#       load1.graph_title Loads side by side
-#       load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load
-#
-#   # The graph "load2". Now we want them stacked on top of each other.
-#       load2.graph_title Loads on top of each other
-#       load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load
-#       load2.dummy_field.draw AREA # We want area instead the default LINE2.
-#       load2.dummy_field.label dummy # This is needed. Silly, really.
-#
-#   # The graph "load3". Now we want them summarised into one field
-#       load3.graph_title Loads summarised
-#       load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load
-#       load3.combined_loads.label Combined loads # Must be set, as this is
-#                                                 # not a dummy field!
-#
-## ...and on a side note, I want them listen in another order (default is
-## alphabetically)
-#
-# # Since [foo.com] would be interpreted as a host in the domain "com", we
-# # specify that this is a domain by adding a semicolon.
-# [foo.com;]
-#       node_order Totals fii.foo.com fay.foo.com
-#

+ 0 - 21
roles/monitoring/templates/munin/nginx_vhost.j2

@@ -1,21 +0,0 @@
-{% if ansible_prolog -%}
-{% from 'templates/ansible/prolog.j2' import prolog with context %}
-{{ prolog() }}
-{% endif -%}
-# Nginx vhost for munin master
-
-server {
-    server_name {{ munin_master_vhostname }};
-
-    access_log  /var/log/nginx/munin.access.log;
-    error_log   /var/log/nginx/munin.error.log;
-
-    location / {
-{% if with_munin_http_auth %}
-        auth_basic "Restricted Access";
-        auth_basic_user_file /etc/nginx/auth_admin;
-{% endif %}
-        root /var/cache/munin/www/;
-        break;
-    }
-}