Automating Monitoring

Anton Dollmaier @ MiniDebConf Regensburg

The issue at hand

Harddrive
Controller

Let's automate this

Automatisierung

config management

Puppet

class minidebconf::webserver () {
  nginx::resource::server { $facts['fqdn']:
    www_root    => '/var/www/html',
    index_files => [
      'index.html',
      'index.nginx-debian.html',
    ],
    ipv6_enable => true,
  }
}

Zabbix

Zabbix Architecture
Templates

Agent Auto-Registration

Demo

PuppetDB

  • puppet.conf
    [server]
    reports = store,puppetdb
    storeconfigs = true
    storeconfigs_backend = puppetdb
  • routes.yaml
    ---
    master:
      facts:
        terminus: puppetdb
        cache: yaml

PuppetDB setup

puppetdb ssl-setup

PuppetDB: Exported Ressources

class ssh {
  # Declare:
  @@sshkey { $facts['fqdn']:
    type => dsa,
    key  => $facts['sshdsakey'],
  }
  # Collect:
  Sshkey <<| |>>
  Concat::Fragment <<| tag == "bacula-storage-dir-${bacula_director}" |>>
}

Demo

Prometheus

Architecture

voxpupuli/puppet-prometheus

include prometheus::node_exporter
include prometheus::elasticsearch_exporter
prometheus::node_exporter::export_scrape_job: true
prometheus::elasticsearch_exporter::export_scrape_job: true
prometheus::node_exporter::scrape_job_name: node

voxpupuli/puppet-prometheus

include prometheus::server
prometheus::collect_scrape_jobs:
  - job_name: node
  - job_name: elasticsearch

Demo

Thanks for your attention! ⛾

P.S.: We're hiring!