check_mk & ansible - cmk 2nd conf 2015

24
Check_MK Conference

Upload: ngoque

Post on 11-Jan-2017

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Check_MK & Ansible - CMK 2nd Conf 2015

Check_MK Conference

Page 2: Check_MK & Ansible - CMK 2nd Conf 2015

Check_MK & Ansible

A step towards self healing IT systems

Page 3: Check_MK & Ansible - CMK 2nd Conf 2015

A bit about us

IT Service ProviderFull stack monitoringCloudHPC SecurityTraining & Coaching

Page 4: Check_MK & Ansible - CMK 2nd Conf 2015

A bit about us

Check_MK initiativesSome checksRomanian translation

———————————————— https://github.com/spearheadsys https://github.com/orgs/spearheadsys/people/mariuspanahttps://www.youtube.com/user/spearheadsystemshttps://www.youtube.com/channel/UCJW5NSgY-G99Czbu4FJzVGQ

Page 5: Check_MK & Ansible - CMK 2nd Conf 2015

A bit about this presentation

IT is a tool IT should make life easier

Self configuration Self healing

Page 6: Check_MK & Ansible - CMK 2nd Conf 2015

Caveats

Some things may not work properly Some things are a bit ugly Security should be thought out

Page 7: Check_MK & Ansible - CMK 2nd Conf 2015

Feedback Loop

Page 8: Check_MK & Ansible - CMK 2nd Conf 2015

A bit about Ansible

Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.

Page 9: Check_MK & Ansible - CMK 2nd Conf 2015

A bit about Ansible

Configuration ManagementContinuous DeliveryApplication DeploymentProvisioningSecurity & Compliance

Page 10: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible & Check_MK

We model our IT infrastructures using Ansible.

We define what our servers should look like and what their state should be.

Check_MK ensures that services and states match our desired model.

Page 11: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible & Check_MK

Deploy Monitor

Enforce

Page 12: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible & Check_MK

Ansib

le

Check_MK

Check_MK+ Ansible

Page 13: Check_MK & Ansible - CMK 2nd Conf 2015

A bit more about Ansible

Inventory simple text file inventory plugin

Playbooks simple, elegant orchestration

Ad hoc parallel task execution ansible all -m ping

Page 14: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible inventory example

192.168.0.1

[test]10.88.88.192 our.internal.host.com

[webservers]www[01:50].example.comjumper ansible_port=5555 ansible_host=192.168.1.50

[atlanta]host1 http_port=80 maxRequestsPerChild=808

[southeast:children]atlanta

Page 15: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible playbook example

---- hosts: loadbalancers roles: - common - loadbalancer

- hosts: webservers roles: - common - content

Page 16: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible playbook example (cont.)

---- yum: name=ntp state=installed tags:

- packages

- service: name=ntpd state=running enabled=yes tags:

- ntpd

- template: src/opt/tpl/ntp.j2 dest=/etc/ntp.conf notify: - restart ntpd

Page 17: Check_MK & Ansible - CMK 2nd Conf 2015

Ansible playbook example (cont.)

---- name: restart ntpd service: name=ntpd state=restarted tags: - ntpd

- name: restart ssh service: name=sshd state=restarted tags: - sshd

Page 18: Check_MK & Ansible - CMK 2nd Conf 2015

Deploy phase

web web

LB

InternetDeploy

Page 19: Check_MK & Ansible - CMK 2nd Conf 2015

Deploy phase (cont.)

Deploy

check_mk_agent(inc.plugins,localchecks,etc.)

addhosttocheck_mkserver(WATOwebapi)

Page 20: Check_MK & Ansible - CMK 2nd Conf 2015

Monitoring phase

Deploy Monitor

Enforce

Page 21: Check_MK & Ansible - CMK 2nd Conf 2015

Enforce phase

Deploy Monitor

Enforce

Page 22: Check_MK & Ansible - CMK 2nd Conf 2015

Enforce phase - autoscaling

Deploy Monitor

Enforce

Scale up or down based on metrics

Scaling pushes back into deploy

Use with cluster mgmt tools

Page 23: Check_MK & Ansible - CMK 2nd Conf 2015

Demo

Page 24: Check_MK & Ansible - CMK 2nd Conf 2015

Spearhead Systems S.R.L.64th I.P. Pavlov Street, Sector 1

Bucuresti, ROMANIAPhone: +40 21 322 5757

Fax: +40 21 322 2522www.spearheadsystems.ro

Danke schön