SlideShare ist ein Scribd-Unternehmen logo
1 von 64
Downloaden Sie, um offline zu lesen
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Deploying Icinga2 through Ansible
Multi Zone HA setup
Toshaan Bharvani - VanTosh bvba
<toshaan@vantosh.com>
Open Source Monitoring Conference 2017
22 November 2017
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 1 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
$ whoami
Toshaan Bharvani - VanTosh
• From Antwerp, Belgium
• Self-employed engineer/trainer (available for hire)
http://www.vantosh.com
• Involved with Enterprise OS : PEL, RHEL, CentOS, IBM AIX,
OpenBSD, FreeBSD, . . .
• Likes to keep everything secure : SELinux, WebSec, . . .
• Lives in a virtual world : KVM, Xen, LXC, PowerVM, z/VM, . . .
• Likes automation CfgMgmt / DevOps : Ansible, Foreman,
Puppet, Buildbot, . . .
• Works on both hardware and software side
• Wants to take over the universe
• Twitter : @toshywoshy
• Blog : http://www.toshaan.com
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 2 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Table of contents
1 Monitoring
2 Automation
Inventory
Virtual Machines
3 Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host adding
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 3 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
1
Monitoring
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 4 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Monitoring
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 5 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
HA Monitoring
• Nagios
• Well know
• Icinga
• Better web interface with nagios forked backend
• Shinken
• Distributed, modular, good for smal install base
• Icinga2
• Distributed, scalability, high available, better interface, modular
and integrations
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Shinken (1)
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 7 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Shinken (2)
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 8 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 (1)
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 9 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 (2)
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 10 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 (3)
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 11 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
2
Automation
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 12 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Ansible
“Ansible is a fictional machine capable of instantaneous or
superluminal communication. Typically it is depicted as a
lunch-box-sized object with some combination of microphone, speaker,
keyboard and display. It can send and receive messages to and from a
corresponding device over any distance whatsoever with no delay.”1
• Configuration Management Tool
• System Orchestration Tool
• Remote Execution/Deployment Tool
• . . .
1Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 13 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
An overview
• Python2 based
• Server based, agentless2
• uses SSH protocol (can use accelerated mode uses a daemon and
port)
• host information in flat files, CMDB, scripts, . . .
• executes the task on the host side
• Playbook : combination of tasks with meta information
• YAML
• JSON
• Roles : abstract playbook
• Tasks
• Variables
• Handlers
• Templates : Jinja2
• works where Python2 works3
2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is
not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Internal Design
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 15 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Normal Adhoc Mode
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 16 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Delegation Mode
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 17 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Hypervisors
• hosts file is by default in ini format
§ ¤
1 [hypervisors ]
2 hypervisor0
3 hypervisor1
4 hypervisor2
5 hypervisor3
6
7 [ virtualmachines ]
8 vm0
9 vm1
10 vm2
11 vm3
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 18 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Hypervisor (0)
§ ¤
1 ---
2 distro: powerel7
3 machinearch: ppc64
4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
5 language: en_US
6 keyboard: us
7 timezone: "Europe/Brussels"
8 nics:
9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
10 hostname: hyp0.vantosh.demo
11 sshdrsakeylength : 8192
12 sshdecdsakeylength : 521
13 users:
14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /.
keys/id_hyp0.pub }
15 nrpe: { address: hyp0.vantosh.demo , zone: democenter0 , contact: mrnice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 19 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Hypervisor (1)
§ ¤
1 ---
2 distro: powerel7
3 machinearch: ppc64le
4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
5 language: en_US
6 keyboard: us
7 timezone: "Europe/Brussels"
8 nics:
9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
10 hostname: hyp1.vantosh.demo
11 sshdrsakeylength : 8192
12 sshdecdsakeylength : 521
13 users:
14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /.
keys/id_hyp1.pub }
15 nrpe: { address: hyp1.vantosh.demo , zone: democenter1 , contact: mrnotsonice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 20 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Hypervisor (2)
§ ¤
1 ---
2 distro: centos7
3 machinearch: x86_64
4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
5 language: en_US
6 keyboard: us
7 timezone: "Europe/Brussels"
8 nics:
9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
10 hostname: hyp2.vantosh.demo
11 sshdrsakeylength : 8192
12 sshdecdsakeylength : 521
13 users:
14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /.
keys/id_hyp2.pub }
15 nrpe: { address: hyp2.vantosh.demo , zone: democenter1 , contact: mrnice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 21 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Virtual Machine (0)
§ ¤
1 ---
2 hyper: hypervisor0
3 distro: powerel7
4 machinearch: ppc64
5 virtualcpus: 32
6 virtualsockets : 2
7 virtualcores : 2
8 virtualthreads : 8
9 ramsize: 2048
10 vmwaittime: 15
11 language: en_US
12 keyboard: us
13 timezone: "Europe/Brussels"
14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
15 sshdrsakeylength : 8192
16 sshdecdsakeylength : 521
17 virtualfilespath : /virtual/
18 disks:
19 - { path: /virtual/vm0 -prep0.qcow2 , size: 10M }
20 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M }
21 - { path: /virtual/vm0 -root0.qcow2 , size: 6G }
22 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M }
23 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M }
24 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd
25 partitions:
26 - part prepboot --ondisk=vda --asprimary --fstype="prepboot" --fsoptions=’
prepboot ’ --size =9
27 - part /boot --ondisk=vdb --asprimary --fstype="xfs" --fsoptions=’defaults ,
noatime ,discard ’ --grow --size =1
28 - part pv.01 --ondisk=vdc --asprimary --grow --size =1
29 - volgroup VolGroupRoot --pesize =131072 pv.01
30 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name=
LogVolRoot --vgname= VolGroupRoot --grow --size =1
31 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
32 - part swap --onpart=vde --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
33 hostname: vm0.vantosh.demo
34 nics:
35 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
36 users:
37 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy
/. keys/id_vm0.pub }
38 nrpe: { address: vm0.vantosh.demo , zone: democenter0 , contact: mrnice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 22 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Virtual Machine (1)
§ ¤
1 ---
2 hyper: hypervisor0
3 distro: powerel7
4 machinearch: ppc64le
5 virtualcpus: 32
6 virtualsockets : 2
7 virtualcores : 2
8 virtualthreads : 8
9 ramsize: 2048
10 vmwaittime: 15
11 language: en_US
12 keyboard: us
13 timezone: "Europe/Brussels"
14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
15 sshdrsakeylength : 8192
16 sshdecdsakeylength : 521
17 virtualfilespath : /virtual/
18 disks:
19 - { path: /virtual/vm0 -prep0.qcow2 , size: 10M }
20 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M }
21 - { path: /virtual/vm0 -root0.qcow2 , size: 6G }
22 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M }
23 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M }
24 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd
25 partitions:
26 - part prepboot --ondisk=vda --asprimary --fstype="prepboot" --fsoptions=’
prepboot ’ --size =9
27 - part /boot --ondisk=vdb --asprimary --fstype="xfs" --fsoptions=’defaults ,
noatime ,discard ’ --grow --size =1
28 - part pv.01 --ondisk=vdc --asprimary --grow --size =1
29 - volgroup VolGroupRoot --pesize =131072 pv.01
30 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name=
LogVolRoot --vgname= VolGroupRoot --grow --size =1
31 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
32 - part swap --onpart=vde --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
33 hostname: vm0.vantosh.demo
34 nics:
35 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
36 users:
37 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy
/. keys/id_vm0.pub }
38 nrpe: { address: vm0.vantosh.demo , zone: democenter1 , contact: mrnotsonice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 23 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Inventory - Virtual Machine (2)
§ ¤
1 ---
2 hyper: hypervisor0
3 distro: centos7
4 machinearch: x86_64
5 virtualcpus: 32
6 virtualsockets : 2
7 virtualcores : 2
8 virtualthreads : 8
9 ramsize: 2048
10 vmwaittime: 15
11 language: en_US
12 keyboard: us
13 timezone: "Europe/Brussels"
14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
15 sshdrsakeylength : 8192
16 sshdecdsakeylength : 521
17 virtualfilespath : /virtual/
18 disks:
19 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M }
20 - { path: /virtual/vm0 -root0.qcow2 , size: 6G }
21 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M }
22 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M }
23 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd
24 partitions:
25 - part /boot --ondisk=vda --asprimary --fstype="xfs" --fsoptions=’defaults ,
noatime ,discard ’ --grow --size =1
26 - part pv.01 --ondisk=vdb --asprimary --grow --size =1
27 - volgroup VolGroupRoot --pesize =131072 pv.01
28 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name=
LogVolRoot --vgname= VolGroupRoot --grow --size =1
29 - part swap --onpart=vdc --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
30 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
31 hostname: vm0.vantosh.demo
32 nics:
33 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
34 users:
35 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy
/. keys/id_vm0.pub }
36 nrpe: { address: vm0.vantosh.demo , zone: democenter1 , contact: mrnice }
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 24 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Playbooks - vminstaller
§ ¤
1 - name: set machine arch variables
2 include_vars : "{{ machinearch }}/ console.yml"
3 when: virtconsole is not defined
4
5 - name: set distribution variables
6 include_vars : "{{ distro }}. yml"
7
8 - name: create the qemu disk images
9 action: qemu -img dest ={{ item.path }} size ={{ item.size }} format="qcow2"
options=" preallocation =falloc"
10 with_items: "{{ disks }}"
11 delegate_to: "{{ hyper }}"
12
13 ###
14
15 ### PowerEL 7
16 - name: start distribution installation - PEL7
17 include: install -vm -pel7.yml
18 when: templatetype == ’pel7 ’
19
20 ### EL 7
21 - name: start distribution installation - EL7
22 include: install -vm -el7.yml
23 when: templatetype == ’el7’
24
25 - name: execute minimum ram hack where required
26 include: minimum -ram -hack.yml
27 when: minram is defined
28
29
30 - name: start the vm
31 action: virt guest ={{ inventory_hostname }} command=start
32 delegate_to: "{{ hyper }}"
33 ignore_errors : yes
34
35 - name: wait for vm to become available
36 local_action : wait_for host ={{ ansible_host }} port ={{ ansible_port }} delay
=5 state=started timeout =300
37 become: no
38
39 - name: gather facts
40 action: setup
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 25 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Playbooks - pel7
§ ¤
1 - name: create and copy the kickstart file of the machine
2 action: template src="pel7/kickstart.cfg" dest="{{ virtualfilespath }}{{
inventory_hostname }}. cfg"
3 delegate_to: "{{ hyper }}"
4
5 - name: make install script
6 action: template src="common/install -vm.sh" dest="{{ virtualfilespath }}{{
inventory_hostname }}-create -vm.sh" owner=root group=root mode =770
7 delegate_to: "{{ hyper }}"
8
9 - name: execute install script
10 action: raw {{ virtualfilespath }}{{ inventory_hostname }}-create -vm.sh
11 delegate_to: "{{ hyper }}"
12 register: createdvm
13
14 - name: wait for vm to install
15 local_action : pause minutes ={{ vmwaittime }}
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 26 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Variables - pel7
§ ¤
1 ---
2 distroname: powerel7
3 distrotype: rhel7
4 templatetype : pel7
5 minram: 2048
6 location: http ://10.59.39.200/ yum/pel /7/{{ machinearch }}/os/
7 repos:
8 - name: "PowerEL -base"
9 uri: "http ://10.59.39.200/ yum/pel /7/{{ machinearch }}/ base/packages/"
10 cost: 100
11 textrargs: ’text repo ={{ location }} ks=file :/{{ inventory_hostname }}. cfg
console=hvc0 ,115200 headless noshell nofirewire rd_NO_PLYMOUTH plymouth.enable
=0 biosdevname =0 elevator=noop geoloc =0 nopass kdump_addon =off nopcmia ’
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 27 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
3
Icinga2
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 28 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 - Main Task
§ ¤
1 - name: check whether icinga2 variable are set correctly
2 action: fail msg="Icinga2 variables set incorrectly , please set OR master OR
zone OR client , do not set both at the same time."
3 when: icinga2_master is defined and icinga2_zone is defined
4
5 - name: install icinga2 master
6 include: master.yml
7 when: icinga2_master is defined and icinga2_master == true
8
9 - name: install icinga2 zonemaster
10 include: zonemaster.yml
11 when: icinga2_zonemaster is defined and icinga2_zonemaster == true
12
13 - name: install icinga2 client
14 include: client.yml
15 when: icinga2_client is defined and icinga2_client == true
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 29 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 - Master§ ¤
1 - name: install icinga2 packages
2 yum:
3 name: "{{ item }}"
4 state: latest
5 with_items:
6 - icinga2 -common
7 - icinga2 -bin
8 #- icinga2 -python
9 - icinga2
10 - icinga2 -ido -pgsql
11 - icingaweb2
12 - icingaweb2
13 - python -carbon
14 - python -whisper
15 - graphite -web
16 - libXrender
17 - libX11
18 - nagios -plugins
19 - nagios -plugins -ping
20 - nagios -plugins -nrpe
21 - nagios -plugins -disk
22 - nagios -plugins -load
23 - nagios -plugins -users
24 - nagios -plugins -procs
25 - nagios -plugins -swap
26 - nagios -plugins -ssh
27 - nagios -plugins -tcp
28 #- nagios -plugins -check_rbl
29 - nagios -plugins -by_ssh
30 - nagios -plugins -dig
31 - nagios -plugins -http
32 - nagios -plugins -smtp
33 - nagios -plugins -dns
34 - nagios -plugins -snmp
35 #- nagion -plugins - check_snmp_printer
36 #- nagios -plugins - check_iostat
37
38 - name: copy main icinga2 configuration files
39 template:
40 src: "{{ item }}"
41 dest: "/etc/icinga2 /{{ item }}"
42 owner: icinga
43 group: icinga
44 mode: 0550
45 setype: etc_t
46 with_items:
47 - icinga2.conf
48 - zones.conf
49 - constants.conf
50
51 - name: copy features configuration files into icinga2 feature activation
directory
52 action: template src ={{ item }} dest =/ etc/icinga2/features -available /{{ item
}}
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 30 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 - Zonemaster§ ¤
1 - name: install icinga2 packages
2 yum:
3 name: "{{ item }}"
4 state: latest
5 with_items:
6 - icinga2 -common
7 - icinga2 -bin
8 - icinga2
9 - nrpe
10 - nagios -plugins
11 - nagios -plugins -ping
12 - nagios -plugins -nrpe
13 - nagios -plugins -disk
14 - nagios -plugins -load
15 - nagios -plugins -users
16 - nagios -plugins -procs
17 - nagios -plugins -swap
18 - nagios -plugins -ssh
19 - nagios -plugins -tcp
20 - nagios -plugins -check_rbl
21 - nagios -plugins -by_ssh
22 - nagios -plugins -dig
23 - nagios -plugins -http
24 - nagios -plugins -smtp
25 - nagios -plugins -dns
26 - nagios -plugins - check_cups_queue
27 - nagios -plugins -check_sip
28 - nagios -plugins -dhcp
29 - nagios -plugins -snmp
30
31 - name: copy main icinga2 configuration files
32 template:
33 src: "{{ item }}"
34 dest: "/etc/icinga2 /{{ item }}"
35 owner: icinga
36 group: icinga
37 mode: 0550
38 setype: etc_t
39 with_items:
40 - icinga2.conf
41 - zones.conf
42 - constants.conf
43
44 - name: copy features configuration files into icinga2 feature activation
directory
45 template:
46 src: "{{ item }}"
47 dest: "/etc/icinga2/features -available /{{ item }}"
48 with_items:
49 - api.conf
50
51 - name: activate icinga2 features
52 command: "/sbin/icinga2 -enable -feature {{ item }}"
53 with_items:Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 31 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 - zones.conf
§ ¤
1 /*
2 * --------------------------------------------------
3 * VanTosh Icinga2 Zone Configuration File
4 * (c) copyleft 2014 VanTosh
5 * Author: Toshaan Bharvani <toshaan@vantosh .com >
6 * --------------------------------------------------
7 * {{ ansible_managed }}
8 */
9
10 {% for icinga2_zone in icinga2_zones %}
11 object Endpoint "{{ icinga2_zone .nodename }}" {
12 host = "{{ icinga2_zone .hostname }}"
13 port = {{ icinga2_zone .port }}
14 }
15 object Zone "{{ icinga2_zone .zonename }}" {
16 endpoints = [ "{{ icinga2_zone .nodename }}" ]
17 {% if icinga2_zone .parent is defined %}
18 parent = "{{ icinga2_zone .parent }}"
19 {% endif %}
20 }
21 {% endfor %}
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 32 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 Client (0)§ ¤
1 - name: install icinga2 client packages and dependencies
2 yum:
3 pkg: "{{ item }}"
4 state: latest
5 with_items:
6 - icinga2
7 - nagios -plugins -disk
8 - nagios -plugins -load
9 - nagios -plugins -users
10 - nagios -plugins -procs
11 - nagios -plugins -swap
12 - nagios -plugins - check_iostat
13 - bc
14 - sysstat
15
16 - name: icinga2 client config
17 template:
18 src: icinga2_client .conf
19 dest: /etc/icinga2/client.conf
20
21 - name: icinga2 commands
22 template:
23 src: "{{ item }}. cfg"
24 dest: "/etc/icinga2/conf.d/{{ item }}. conf"
25 with_items:
26 - users
27 - disk
28 - procs
29 - load
30 - swap
31 - iostat
32
33 - name: restart icinga2 daemon
34 service:
35 name: icinga2
36 state: restarted
37 enabled: yes
38
39 - name: add node to master
40 template:
41 src: host.conf
42 dest: "/etc/icinga2/zones.d/{{ icinga2.zone }}/{{ inventory_hostname }}.{{
domain }}. conf"
43 owner: icinga
44 group: icinga
45 mode: 0640
46 setype: etc_t
47 delegate_to: icinga2masters
48 run_once: yes
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 33 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 Client - disk.cfg
§ ¤
1 {% for location in ansible_mounts %}
2 {% if location.fstype != ’cifs ’ and location.fstype != ’nfs’ and location.
fstype != ’fuse ’ and location.fstype != ’linprocfs ’ and location.fstype != ’
fdescfs ’ and location.fstype != ’swap ’ %}
3 command[check_disk_ {{ location.mount }}]={{ nrpe_checkcmddir }} check_disk -w
15% -c 7% -p {{ location.mount }}
4 {% endif %}
5 {% endfor %}
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 34 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 Client - memory.cfg
§ ¤
1 command[ check_memory ]={{ nrpe_checkcmddir }}pmp -check -unix -memory -w 50 -c 75
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 35 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 Client - iostat.cfg
§ ¤
1 {% for disk in ansible_devices %}
2 {% if disk != ’sr0’ %}
3 command[ check_iostat_ {{ disk }}]={{ nrpe_checkcmddir }} check_iostat -d {{ disk
}} -w 750 -c 1250
4 {% endif %}
5 {% endfor %}
¦ ¥
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 36 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Icinga2 Client - host.conf§ ¤
1 /*
2 * --------------------------------------------------
3 * VanTosh Icinga2 Host File
4 * (c) copyleft 2014 VanTosh
5 * Author: Toshaan Bharvani <toshaan@vantosh .com >
6 * --------------------------------------------------
7 * {{ ansible_managed }}
8 * --------------------------------------------------
9 {% if ddns is defined %}
10 * {{ ddns.hostname }}.{{ ddns.domain }}
11 {% else %}
12 * {{ ansible_ssh_host }}
13 {% endif %}
14 * fqdn: {{ ansible_fqdn }}
15 * ansible: {{ inventory_hostname }}
16 * --------------------------------------------------
17 */
18
19
20 object Host "{{ inventory_hostname }}" {
21 import "generic -host"
22 display_name = "{{ inventory_hostname }}"
23 address = "{{ nrpe.address }}"
24 {% if ansible_virtualization_role is defined %}
25 {% if hyper is not defined and ansible_virtualization_role == ’host ’ %}
26 {% elif hyper is defined and ansible_virtualization_role == ’guest ’ %}
27 // parent_host_name = "{{ hyper }}.{{ domain }}"
28 {% endif %}
29 {% endif %}
30 vars.sla = "24x7"
31 }
32
33 object Service "ssh" {
34 import "generic -service"
35 host_name = "{{ inventory_hostname }}"
36 display_name = "SSH {{ inventory_hostname }}"
37 check_command = "ssh"
38 vars.ssh_port = {{ ansible_ssh_port }}
39 }
40
41 object Service " current_users " {
42 import "generic -service"
43 host_name = "{{ inventory_hostname }}"
44 display_name = "Current Users"
45 check_command = "nrpe"
46 vars. nrpe_command = " check_users "
47 {% if nrpe.port is defined %}
48 vars.nrpe_port = {{ nrpe.port }}
49 {% else %}
50 vars.nrpe_port = 5666
51 {% endif %}
52 {% if nrpe_ssl is defined and nrpe_ssl == false %}
53 vars. nrpe_no_ssl = trueDeploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 37 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 39 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
Conclusion
Automation MUST
[RFC2119] be easy
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 39 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
More information
• Icinga : http://www.icinga.org
• Ansible : http://www.ansible.com/
• Ansible Roles Install VM : https:
//github.com/toshywoshy/ansible-roles-vminstall
• Ansible Roles Icinga2 :
https://github.com/toshywoshy/ansible-roles-icinga2
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
More information
• Icinga : http://www.icinga.org
• Ansible : http://www.ansible.com/
• Ansible Roles Install VM : https:
//github.com/toshywoshy/ansible-roles-vminstall
• Ansible Roles Icinga2 :
https://github.com/toshywoshy/ansible-roles-icinga2
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
More information
• Icinga : http://www.icinga.org
• Ansible : http://www.ansible.com/
• Ansible Roles Install VM : https:
//github.com/toshywoshy/ansible-roles-vminstall
• Ansible Roles Icinga2 :
https://github.com/toshywoshy/ansible-roles-icinga2
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
More information
• Icinga : http://www.icinga.org
• Ansible : http://www.ansible.com/
• Ansible Roles Install VM : https:
//github.com/toshywoshy/ansible-roles-vminstall
• Ansible Roles Icinga2 :
https://github.com/toshywoshy/ansible-roles-icinga2
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
Deploying
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Monitoring
Automation
Inventory
Virtual
Machines
Icinga2
Icinga2 Masters
Icinga2 Clients
Icinga2 Host
adding
The End
The End
Thank You
Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com>
http://www.vantosh.com/
Made with Beamer LATEX
a TEXbased Presentation program
Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 41 / 41

Weitere ähnliche Inhalte

Was ist angesagt?

Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write ModulesIcinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga
 
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configurationIcinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga
 

Was ist angesagt? (20)

Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018Icinga Camp New York 2018 - What's evolving in icinga 2018
Icinga Camp New York 2018 - What's evolving in icinga 2018
 
Icinga Director
Icinga DirectorIcinga Director
Icinga Director
 
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
Icinga Camp Berlin 2018 - Automated Monitoring of Proxmox VE with Icinga Dire...
 
Icinga Camp Amsterdam - Icinga2 and Ansible
Icinga Camp Amsterdam - Icinga2 and AnsibleIcinga Camp Amsterdam - Icinga2 and Ansible
Icinga Camp Amsterdam - Icinga2 and Ansible
 
Icinga Camp Bangalore - Enterprise exceptions
Icinga Camp Bangalore - Enterprise exceptions Icinga Camp Bangalore - Enterprise exceptions
Icinga Camp Bangalore - Enterprise exceptions
 
Presentation about Icinga at Kiratech DevOps Day in Verona
Presentation about Icinga at Kiratech DevOps Day in VeronaPresentation about Icinga at Kiratech DevOps Day in Verona
Presentation about Icinga at Kiratech DevOps Day in Verona
 
Icinga Web 2 is more
Icinga Web 2 is moreIcinga Web 2 is more
Icinga Web 2 is more
 
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write ModulesIcinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
 
Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++
Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++
Icinga Camp Berlin 2018 - Dev and Ops Stories - Integrations++
 
Icinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the wayIcinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the way
 
Icinga at Flossuk 2015 in York
Icinga at Flossuk 2015 in YorkIcinga at Flossuk 2015 in York
Icinga at Flossuk 2015 in York
 
Icinga camp ams 2016 icinga2
Icinga camp ams 2016 icinga2Icinga camp ams 2016 icinga2
Icinga camp ams 2016 icinga2
 
Icinga Camp Belgrade - ITAF Monitoring best practices & demo
Icinga Camp Belgrade - ITAF Monitoring best practices & demoIcinga Camp Belgrade - ITAF Monitoring best practices & demo
Icinga Camp Belgrade - ITAF Monitoring best practices & demo
 
Icinga Camp Bangalore - Icinga integrations
Icinga Camp Bangalore - Icinga integrationsIcinga Camp Bangalore - Icinga integrations
Icinga Camp Bangalore - Icinga integrations
 
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configurationIcinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
 
Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2
Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2
Log Monitoring Simplified - Get the best out of Graylog2 & Icinga 2
 
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director
 
Icinga Camp Bangalore - Welcome
Icinga Camp Bangalore - WelcomeIcinga Camp Bangalore - Welcome
Icinga Camp Bangalore - Welcome
 
Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2
 
Loadays 2015 - Enterprise Monitoring with Icinga
Loadays 2015 - Enterprise Monitoring with IcingaLoadays 2015 - Enterprise Monitoring with Icinga
Loadays 2015 - Enterprise Monitoring with Icinga
 

Ähnlich wie OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani

Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
NETWAYS
 
Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
Icinga
 
Nicole Neumann - Let’s Monitor All The Things
Nicole Neumann - Let’s Monitor All The ThingsNicole Neumann - Let’s Monitor All The Things
Nicole Neumann - Let’s Monitor All The Things
Nicole Neumann
 

Ähnlich wie OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani (20)

Icinga Camp Antwerp - Icinga2 Configuration
Icinga Camp Antwerp - Icinga2 ConfigurationIcinga Camp Antwerp - Icinga2 Configuration
Icinga Camp Antwerp - Icinga2 Configuration
 
State of Icinga - Linux Stammtisch München
State of Icinga - Linux Stammtisch MünchenState of Icinga - Linux Stammtisch München
State of Icinga - Linux Stammtisch München
 
Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
 
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrateToshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
 
Icinga 2 @ SIG-NOC Meeting
Icinga 2 @ SIG-NOC MeetingIcinga 2 @ SIG-NOC Meeting
Icinga 2 @ SIG-NOC Meeting
 
Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015
 
Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015
 
Icinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 ClusterIcinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 Cluster
 
Icinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of IcingaIcinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of Icinga
 
Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
 
Why favor Icinga over Nagios @ DebConf15
Why favor Icinga over Nagios @ DebConf15Why favor Icinga over Nagios @ DebConf15
Why favor Icinga over Nagios @ DebConf15
 
OSMC 2014 | Curret State of Icinga by Icinga Team
OSMC 2014 | Curret State of Icinga by Icinga TeamOSMC 2014 | Curret State of Icinga by Icinga Team
OSMC 2014 | Curret State of Icinga by Icinga Team
 
Nicole Neumann - Let’s Monitor All The Things
Nicole Neumann - Let’s Monitor All The ThingsNicole Neumann - Let’s Monitor All The Things
Nicole Neumann - Let’s Monitor All The Things
 
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric LippmannIcinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
Icinga Camp Kuala Lumpur 2015 Opening By Eric Lippmann
 
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben CoughlanLondon Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
 
Barcelona MeetUp - Kontena Intro
Barcelona MeetUp - Kontena IntroBarcelona MeetUp - Kontena Intro
Barcelona MeetUp - Kontena Intro
 
OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...
OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...
OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...
 
Kontena@Berlin OpenSource MeetUp
Kontena@Berlin OpenSource MeetUpKontena@Berlin OpenSource MeetUp
Kontena@Berlin OpenSource MeetUp
 
Encrypt your volumes with barbican open stack 2018
Encrypt your volumes with barbican open stack 2018Encrypt your volumes with barbican open stack 2018
Encrypt your volumes with barbican open stack 2018
 
Running and Scaling Docker Containers with Kontena
Running and Scaling Docker Containers with KontenaRunning and Scaling Docker Containers with Kontena
Running and Scaling Docker Containers with Kontena
 

Kürzlich hochgeladen

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Kürzlich hochgeladen (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

OSMC 2017 | Icinga 2 Multi Zone HA Setup using Ansible by Toshaan Bharvani

  • 1. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Deploying Icinga2 through Ansible Multi Zone HA setup Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com> Open Source Monitoring Conference 2017 22 November 2017 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 1 / 41
  • 2. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End $ whoami Toshaan Bharvani - VanTosh • From Antwerp, Belgium • Self-employed engineer/trainer (available for hire) http://www.vantosh.com • Involved with Enterprise OS : PEL, RHEL, CentOS, IBM AIX, OpenBSD, FreeBSD, . . . • Likes to keep everything secure : SELinux, WebSec, . . . • Lives in a virtual world : KVM, Xen, LXC, PowerVM, z/VM, . . . • Likes automation CfgMgmt / DevOps : Ansible, Foreman, Puppet, Buildbot, . . . • Works on both hardware and software side • Wants to take over the universe • Twitter : @toshywoshy • Blog : http://www.toshaan.com Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 2 / 41
  • 3. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Table of contents 1 Monitoring 2 Automation Inventory Virtual Machines 3 Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 3 / 41
  • 4. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End 1 Monitoring Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 4 / 41
  • 5. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Monitoring Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 5 / 41
  • 6. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 7. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 8. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 9. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 10. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 11. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 12. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 13. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End HA Monitoring • Nagios • Well know • Icinga • Better web interface with nagios forked backend • Shinken • Distributed, modular, good for smal install base • Icinga2 • Distributed, scalability, high available, better interface, modular and integrations Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 6 / 41
  • 14. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Shinken (1) Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 7 / 41
  • 15. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Shinken (2) Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 8 / 41
  • 16. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 (1) Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 9 / 41
  • 17. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 (2) Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 10 / 41
  • 18. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 (3) Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 11 / 41
  • 19. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End 2 Automation Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 12 / 41
  • 20. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Ansible “Ansible is a fictional machine capable of instantaneous or superluminal communication. Typically it is depicted as a lunch-box-sized object with some combination of microphone, speaker, keyboard and display. It can send and receive messages to and from a corresponding device over any distance whatsoever with no delay.”1 • Configuration Management Tool • System Orchestration Tool • Remote Execution/Deployment Tool • . . . 1Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 13 / 41
  • 21. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 22. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 23. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 24. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 25. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 26. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 27. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 28. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 29. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 30. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 31. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 32. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 33. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 34. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End An overview • Python2 based • Server based, agentless2 • uses SSH protocol (can use accelerated mode uses a daemon and port) • host information in flat files, CMDB, scripts, . . . • executes the task on the host side • Playbook : combination of tasks with meta information • YAML • JSON • Roles : abstract playbook • Tasks • Variables • Handlers • Templates : Jinja2 • works where Python2 works3 2Abstraction of SSH / WinRM to connect with the node and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 14 / 41
  • 35. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Internal Design Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 15 / 41
  • 36. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Normal Adhoc Mode Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 16 / 41
  • 37. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Delegation Mode Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 17 / 41
  • 38. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Hypervisors • hosts file is by default in ini format § ¤ 1 [hypervisors ] 2 hypervisor0 3 hypervisor1 4 hypervisor2 5 hypervisor3 6 7 [ virtualmachines ] 8 vm0 9 vm1 10 vm2 11 vm3 ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 18 / 41
  • 39. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Hypervisor (0) § ¤ 1 --- 2 distro: powerel7 3 machinearch: ppc64 4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 5 language: en_US 6 keyboard: us 7 timezone: "Europe/Brussels" 8 nics: 9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 10 hostname: hyp0.vantosh.demo 11 sshdrsakeylength : 8192 12 sshdecdsakeylength : 521 13 users: 14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_hyp0.pub } 15 nrpe: { address: hyp0.vantosh.demo , zone: democenter0 , contact: mrnice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 19 / 41
  • 40. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Hypervisor (1) § ¤ 1 --- 2 distro: powerel7 3 machinearch: ppc64le 4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 5 language: en_US 6 keyboard: us 7 timezone: "Europe/Brussels" 8 nics: 9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 10 hostname: hyp1.vantosh.demo 11 sshdrsakeylength : 8192 12 sshdecdsakeylength : 521 13 users: 14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_hyp1.pub } 15 nrpe: { address: hyp1.vantosh.demo , zone: democenter1 , contact: mrnotsonice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 20 / 41
  • 41. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Hypervisor (2) § ¤ 1 --- 2 distro: centos7 3 machinearch: x86_64 4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 5 language: en_US 6 keyboard: us 7 timezone: "Europe/Brussels" 8 nics: 9 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 10 hostname: hyp2.vantosh.demo 11 sshdrsakeylength : 8192 12 sshdecdsakeylength : 521 13 users: 14 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_hyp2.pub } 15 nrpe: { address: hyp2.vantosh.demo , zone: democenter1 , contact: mrnice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 21 / 41
  • 42. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Virtual Machine (0) § ¤ 1 --- 2 hyper: hypervisor0 3 distro: powerel7 4 machinearch: ppc64 5 virtualcpus: 32 6 virtualsockets : 2 7 virtualcores : 2 8 virtualthreads : 8 9 ramsize: 2048 10 vmwaittime: 15 11 language: en_US 12 keyboard: us 13 timezone: "Europe/Brussels" 14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 15 sshdrsakeylength : 8192 16 sshdecdsakeylength : 521 17 virtualfilespath : /virtual/ 18 disks: 19 - { path: /virtual/vm0 -prep0.qcow2 , size: 10M } 20 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M } 21 - { path: /virtual/vm0 -root0.qcow2 , size: 6G } 22 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M } 23 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M } 24 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd 25 partitions: 26 - part prepboot --ondisk=vda --asprimary --fstype="prepboot" --fsoptions=’ prepboot ’ --size =9 27 - part /boot --ondisk=vdb --asprimary --fstype="xfs" --fsoptions=’defaults , noatime ,discard ’ --grow --size =1 28 - part pv.01 --ondisk=vdc --asprimary --grow --size =1 29 - volgroup VolGroupRoot --pesize =131072 pv.01 30 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name= LogVolRoot --vgname= VolGroupRoot --grow --size =1 31 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 32 - part swap --onpart=vde --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 33 hostname: vm0.vantosh.demo 34 nics: 35 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 36 users: 37 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_vm0.pub } 38 nrpe: { address: vm0.vantosh.demo , zone: democenter0 , contact: mrnice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 22 / 41
  • 43. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Virtual Machine (1) § ¤ 1 --- 2 hyper: hypervisor0 3 distro: powerel7 4 machinearch: ppc64le 5 virtualcpus: 32 6 virtualsockets : 2 7 virtualcores : 2 8 virtualthreads : 8 9 ramsize: 2048 10 vmwaittime: 15 11 language: en_US 12 keyboard: us 13 timezone: "Europe/Brussels" 14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 15 sshdrsakeylength : 8192 16 sshdecdsakeylength : 521 17 virtualfilespath : /virtual/ 18 disks: 19 - { path: /virtual/vm0 -prep0.qcow2 , size: 10M } 20 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M } 21 - { path: /virtual/vm0 -root0.qcow2 , size: 6G } 22 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M } 23 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M } 24 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd 25 partitions: 26 - part prepboot --ondisk=vda --asprimary --fstype="prepboot" --fsoptions=’ prepboot ’ --size =9 27 - part /boot --ondisk=vdb --asprimary --fstype="xfs" --fsoptions=’defaults , noatime ,discard ’ --grow --size =1 28 - part pv.01 --ondisk=vdc --asprimary --grow --size =1 29 - volgroup VolGroupRoot --pesize =131072 pv.01 30 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name= LogVolRoot --vgname= VolGroupRoot --grow --size =1 31 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 32 - part swap --onpart=vde --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 33 hostname: vm0.vantosh.demo 34 nics: 35 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 36 users: 37 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_vm0.pub } 38 nrpe: { address: vm0.vantosh.demo , zone: democenter1 , contact: mrnotsonice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 23 / 41
  • 44. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Inventory - Virtual Machine (2) § ¤ 1 --- 2 hyper: hypervisor0 3 distro: centos7 4 machinearch: x86_64 5 virtualcpus: 32 6 virtualsockets : 2 7 virtualcores : 2 8 virtualthreads : 8 9 ramsize: 2048 10 vmwaittime: 15 11 language: en_US 12 keyboard: us 13 timezone: "Europe/Brussels" 14 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 15 sshdrsakeylength : 8192 16 sshdecdsakeylength : 521 17 virtualfilespath : /virtual/ 18 disks: 19 - { path: /virtual/vm0 -boot0.qcow2 , size: 512M } 20 - { path: /virtual/vm0 -root0.qcow2 , size: 6G } 21 - { path: /virtual/vm0 -swap0.qcow2 , size: 512M } 22 - { path: /virtual/vm0 -swap1.qcow2 , size: 512M } 23 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd 24 partitions: 25 - part /boot --ondisk=vda --asprimary --fstype="xfs" --fsoptions=’defaults , noatime ,discard ’ --grow --size =1 26 - part pv.01 --ondisk=vdb --asprimary --grow --size =1 27 - volgroup VolGroupRoot --pesize =131072 pv.01 28 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name= LogVolRoot --vgname= VolGroupRoot --grow --size =1 29 - part swap --onpart=vdc --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 30 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 31 hostname: vm0.vantosh.demo 32 nics: 33 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 34 users: 35 - { name: administrator , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_vm0.pub } 36 nrpe: { address: vm0.vantosh.demo , zone: democenter1 , contact: mrnice } ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 24 / 41
  • 45. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Playbooks - vminstaller § ¤ 1 - name: set machine arch variables 2 include_vars : "{{ machinearch }}/ console.yml" 3 when: virtconsole is not defined 4 5 - name: set distribution variables 6 include_vars : "{{ distro }}. yml" 7 8 - name: create the qemu disk images 9 action: qemu -img dest ={{ item.path }} size ={{ item.size }} format="qcow2" options=" preallocation =falloc" 10 with_items: "{{ disks }}" 11 delegate_to: "{{ hyper }}" 12 13 ### 14 15 ### PowerEL 7 16 - name: start distribution installation - PEL7 17 include: install -vm -pel7.yml 18 when: templatetype == ’pel7 ’ 19 20 ### EL 7 21 - name: start distribution installation - EL7 22 include: install -vm -el7.yml 23 when: templatetype == ’el7’ 24 25 - name: execute minimum ram hack where required 26 include: minimum -ram -hack.yml 27 when: minram is defined 28 29 30 - name: start the vm 31 action: virt guest ={{ inventory_hostname }} command=start 32 delegate_to: "{{ hyper }}" 33 ignore_errors : yes 34 35 - name: wait for vm to become available 36 local_action : wait_for host ={{ ansible_host }} port ={{ ansible_port }} delay =5 state=started timeout =300 37 become: no 38 39 - name: gather facts 40 action: setup ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 25 / 41
  • 46. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Playbooks - pel7 § ¤ 1 - name: create and copy the kickstart file of the machine 2 action: template src="pel7/kickstart.cfg" dest="{{ virtualfilespath }}{{ inventory_hostname }}. cfg" 3 delegate_to: "{{ hyper }}" 4 5 - name: make install script 6 action: template src="common/install -vm.sh" dest="{{ virtualfilespath }}{{ inventory_hostname }}-create -vm.sh" owner=root group=root mode =770 7 delegate_to: "{{ hyper }}" 8 9 - name: execute install script 10 action: raw {{ virtualfilespath }}{{ inventory_hostname }}-create -vm.sh 11 delegate_to: "{{ hyper }}" 12 register: createdvm 13 14 - name: wait for vm to install 15 local_action : pause minutes ={{ vmwaittime }} ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 26 / 41
  • 47. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Variables - pel7 § ¤ 1 --- 2 distroname: powerel7 3 distrotype: rhel7 4 templatetype : pel7 5 minram: 2048 6 location: http ://10.59.39.200/ yum/pel /7/{{ machinearch }}/os/ 7 repos: 8 - name: "PowerEL -base" 9 uri: "http ://10.59.39.200/ yum/pel /7/{{ machinearch }}/ base/packages/" 10 cost: 100 11 textrargs: ’text repo ={{ location }} ks=file :/{{ inventory_hostname }}. cfg console=hvc0 ,115200 headless noshell nofirewire rd_NO_PLYMOUTH plymouth.enable =0 biosdevname =0 elevator=noop geoloc =0 nopass kdump_addon =off nopcmia ’ ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 27 / 41
  • 48. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End 3 Icinga2 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 28 / 41
  • 49. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 - Main Task § ¤ 1 - name: check whether icinga2 variable are set correctly 2 action: fail msg="Icinga2 variables set incorrectly , please set OR master OR zone OR client , do not set both at the same time." 3 when: icinga2_master is defined and icinga2_zone is defined 4 5 - name: install icinga2 master 6 include: master.yml 7 when: icinga2_master is defined and icinga2_master == true 8 9 - name: install icinga2 zonemaster 10 include: zonemaster.yml 11 when: icinga2_zonemaster is defined and icinga2_zonemaster == true 12 13 - name: install icinga2 client 14 include: client.yml 15 when: icinga2_client is defined and icinga2_client == true ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 29 / 41
  • 50. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 - Master§ ¤ 1 - name: install icinga2 packages 2 yum: 3 name: "{{ item }}" 4 state: latest 5 with_items: 6 - icinga2 -common 7 - icinga2 -bin 8 #- icinga2 -python 9 - icinga2 10 - icinga2 -ido -pgsql 11 - icingaweb2 12 - icingaweb2 13 - python -carbon 14 - python -whisper 15 - graphite -web 16 - libXrender 17 - libX11 18 - nagios -plugins 19 - nagios -plugins -ping 20 - nagios -plugins -nrpe 21 - nagios -plugins -disk 22 - nagios -plugins -load 23 - nagios -plugins -users 24 - nagios -plugins -procs 25 - nagios -plugins -swap 26 - nagios -plugins -ssh 27 - nagios -plugins -tcp 28 #- nagios -plugins -check_rbl 29 - nagios -plugins -by_ssh 30 - nagios -plugins -dig 31 - nagios -plugins -http 32 - nagios -plugins -smtp 33 - nagios -plugins -dns 34 - nagios -plugins -snmp 35 #- nagion -plugins - check_snmp_printer 36 #- nagios -plugins - check_iostat 37 38 - name: copy main icinga2 configuration files 39 template: 40 src: "{{ item }}" 41 dest: "/etc/icinga2 /{{ item }}" 42 owner: icinga 43 group: icinga 44 mode: 0550 45 setype: etc_t 46 with_items: 47 - icinga2.conf 48 - zones.conf 49 - constants.conf 50 51 - name: copy features configuration files into icinga2 feature activation directory 52 action: template src ={{ item }} dest =/ etc/icinga2/features -available /{{ item }} Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 30 / 41
  • 51. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 - Zonemaster§ ¤ 1 - name: install icinga2 packages 2 yum: 3 name: "{{ item }}" 4 state: latest 5 with_items: 6 - icinga2 -common 7 - icinga2 -bin 8 - icinga2 9 - nrpe 10 - nagios -plugins 11 - nagios -plugins -ping 12 - nagios -plugins -nrpe 13 - nagios -plugins -disk 14 - nagios -plugins -load 15 - nagios -plugins -users 16 - nagios -plugins -procs 17 - nagios -plugins -swap 18 - nagios -plugins -ssh 19 - nagios -plugins -tcp 20 - nagios -plugins -check_rbl 21 - nagios -plugins -by_ssh 22 - nagios -plugins -dig 23 - nagios -plugins -http 24 - nagios -plugins -smtp 25 - nagios -plugins -dns 26 - nagios -plugins - check_cups_queue 27 - nagios -plugins -check_sip 28 - nagios -plugins -dhcp 29 - nagios -plugins -snmp 30 31 - name: copy main icinga2 configuration files 32 template: 33 src: "{{ item }}" 34 dest: "/etc/icinga2 /{{ item }}" 35 owner: icinga 36 group: icinga 37 mode: 0550 38 setype: etc_t 39 with_items: 40 - icinga2.conf 41 - zones.conf 42 - constants.conf 43 44 - name: copy features configuration files into icinga2 feature activation directory 45 template: 46 src: "{{ item }}" 47 dest: "/etc/icinga2/features -available /{{ item }}" 48 with_items: 49 - api.conf 50 51 - name: activate icinga2 features 52 command: "/sbin/icinga2 -enable -feature {{ item }}" 53 with_items:Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 31 / 41
  • 52. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 - zones.conf § ¤ 1 /* 2 * -------------------------------------------------- 3 * VanTosh Icinga2 Zone Configuration File 4 * (c) copyleft 2014 VanTosh 5 * Author: Toshaan Bharvani <toshaan@vantosh .com > 6 * -------------------------------------------------- 7 * {{ ansible_managed }} 8 */ 9 10 {% for icinga2_zone in icinga2_zones %} 11 object Endpoint "{{ icinga2_zone .nodename }}" { 12 host = "{{ icinga2_zone .hostname }}" 13 port = {{ icinga2_zone .port }} 14 } 15 object Zone "{{ icinga2_zone .zonename }}" { 16 endpoints = [ "{{ icinga2_zone .nodename }}" ] 17 {% if icinga2_zone .parent is defined %} 18 parent = "{{ icinga2_zone .parent }}" 19 {% endif %} 20 } 21 {% endfor %} ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 32 / 41
  • 53. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 Client (0)§ ¤ 1 - name: install icinga2 client packages and dependencies 2 yum: 3 pkg: "{{ item }}" 4 state: latest 5 with_items: 6 - icinga2 7 - nagios -plugins -disk 8 - nagios -plugins -load 9 - nagios -plugins -users 10 - nagios -plugins -procs 11 - nagios -plugins -swap 12 - nagios -plugins - check_iostat 13 - bc 14 - sysstat 15 16 - name: icinga2 client config 17 template: 18 src: icinga2_client .conf 19 dest: /etc/icinga2/client.conf 20 21 - name: icinga2 commands 22 template: 23 src: "{{ item }}. cfg" 24 dest: "/etc/icinga2/conf.d/{{ item }}. conf" 25 with_items: 26 - users 27 - disk 28 - procs 29 - load 30 - swap 31 - iostat 32 33 - name: restart icinga2 daemon 34 service: 35 name: icinga2 36 state: restarted 37 enabled: yes 38 39 - name: add node to master 40 template: 41 src: host.conf 42 dest: "/etc/icinga2/zones.d/{{ icinga2.zone }}/{{ inventory_hostname }}.{{ domain }}. conf" 43 owner: icinga 44 group: icinga 45 mode: 0640 46 setype: etc_t 47 delegate_to: icinga2masters 48 run_once: yes ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 33 / 41
  • 54. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 Client - disk.cfg § ¤ 1 {% for location in ansible_mounts %} 2 {% if location.fstype != ’cifs ’ and location.fstype != ’nfs’ and location. fstype != ’fuse ’ and location.fstype != ’linprocfs ’ and location.fstype != ’ fdescfs ’ and location.fstype != ’swap ’ %} 3 command[check_disk_ {{ location.mount }}]={{ nrpe_checkcmddir }} check_disk -w 15% -c 7% -p {{ location.mount }} 4 {% endif %} 5 {% endfor %} ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 34 / 41
  • 55. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 Client - memory.cfg § ¤ 1 command[ check_memory ]={{ nrpe_checkcmddir }}pmp -check -unix -memory -w 50 -c 75 ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 35 / 41
  • 56. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 Client - iostat.cfg § ¤ 1 {% for disk in ansible_devices %} 2 {% if disk != ’sr0’ %} 3 command[ check_iostat_ {{ disk }}]={{ nrpe_checkcmddir }} check_iostat -d {{ disk }} -w 750 -c 1250 4 {% endif %} 5 {% endfor %} ¦ ¥ Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 36 / 41
  • 57. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Icinga2 Client - host.conf§ ¤ 1 /* 2 * -------------------------------------------------- 3 * VanTosh Icinga2 Host File 4 * (c) copyleft 2014 VanTosh 5 * Author: Toshaan Bharvani <toshaan@vantosh .com > 6 * -------------------------------------------------- 7 * {{ ansible_managed }} 8 * -------------------------------------------------- 9 {% if ddns is defined %} 10 * {{ ddns.hostname }}.{{ ddns.domain }} 11 {% else %} 12 * {{ ansible_ssh_host }} 13 {% endif %} 14 * fqdn: {{ ansible_fqdn }} 15 * ansible: {{ inventory_hostname }} 16 * -------------------------------------------------- 17 */ 18 19 20 object Host "{{ inventory_hostname }}" { 21 import "generic -host" 22 display_name = "{{ inventory_hostname }}" 23 address = "{{ nrpe.address }}" 24 {% if ansible_virtualization_role is defined %} 25 {% if hyper is not defined and ansible_virtualization_role == ’host ’ %} 26 {% elif hyper is defined and ansible_virtualization_role == ’guest ’ %} 27 // parent_host_name = "{{ hyper }}.{{ domain }}" 28 {% endif %} 29 {% endif %} 30 vars.sla = "24x7" 31 } 32 33 object Service "ssh" { 34 import "generic -service" 35 host_name = "{{ inventory_hostname }}" 36 display_name = "SSH {{ inventory_hostname }}" 37 check_command = "ssh" 38 vars.ssh_port = {{ ansible_ssh_port }} 39 } 40 41 object Service " current_users " { 42 import "generic -service" 43 host_name = "{{ inventory_hostname }}" 44 display_name = "Current Users" 45 check_command = "nrpe" 46 vars. nrpe_command = " check_users " 47 {% if nrpe.port is defined %} 48 vars.nrpe_port = {{ nrpe.port }} 49 {% else %} 50 vars.nrpe_port = 5666 51 {% endif %} 52 {% if nrpe_ssl is defined and nrpe_ssl == false %} 53 vars. nrpe_no_ssl = trueDeploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 37 / 41
  • 58. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 39 / 41
  • 59. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End Conclusion Automation MUST [RFC2119] be easy Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 39 / 41
  • 60. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End More information • Icinga : http://www.icinga.org • Ansible : http://www.ansible.com/ • Ansible Roles Install VM : https: //github.com/toshywoshy/ansible-roles-vminstall • Ansible Roles Icinga2 : https://github.com/toshywoshy/ansible-roles-icinga2 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
  • 61. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End More information • Icinga : http://www.icinga.org • Ansible : http://www.ansible.com/ • Ansible Roles Install VM : https: //github.com/toshywoshy/ansible-roles-vminstall • Ansible Roles Icinga2 : https://github.com/toshywoshy/ansible-roles-icinga2 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
  • 62. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End More information • Icinga : http://www.icinga.org • Ansible : http://www.ansible.com/ • Ansible Roles Install VM : https: //github.com/toshywoshy/ansible-roles-vminstall • Ansible Roles Icinga2 : https://github.com/toshywoshy/ansible-roles-icinga2 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
  • 63. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End More information • Icinga : http://www.icinga.org • Ansible : http://www.ansible.com/ • Ansible Roles Install VM : https: //github.com/toshywoshy/ansible-roles-vminstall • Ansible Roles Icinga2 : https://github.com/toshywoshy/ansible-roles-icinga2 Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 40 / 41
  • 64. Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Monitoring Automation Inventory Virtual Machines Icinga2 Icinga2 Masters Icinga2 Clients Icinga2 Host adding The End The End Thank You Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com> http://www.vantosh.com/ Made with Beamer LATEX a TEXbased Presentation program Deploying Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba () 41 / 41