WWW.ICINGA.ORG Icinga Camp Barcelona 27/02/2015 Icinga 2 Open Source Monitoring Redesigned
Jul 18, 2015
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Me
• Michael Friedrich
• @dnsmichi, 31, Austrian
• Working @NETWAYS
• Icinga responsibilities
• Core 1.x & 2.x Developer
• Release Manager
• On the team since 2009
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 - Overview
• Stable Version: 2.2.4 (5.2.2015)
• Next major version: 2.3.0 (10.3.2015)
• Supports all major distributions
• New configuration format
• Compatible with plugins, addons, UIs
• Use packages!
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 - Overview
• Features (DB IDO, Livestatus, Graphite, …)
• Icinga Template Library (CheckCommands, …)
• Performance & Real-time monitoring
• Clients, Satellites, Distributed Monitoring & HA Clusters
• Too much for any presentation ;-)
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – What’s new in 2.3
• Improved configuration validation
• New language features
• Additional ITL CheckCommand definitions
• CLI improvements (# icinga2 console)
• OpenTSDB support
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – New languages features in 2.3
• User-defined functions
• Conditional statements (if/else)
• for/while loops
• Local variables (var keyword)
• Methods for types (e.g. array#sort())
• Access objects and their runtime attributes in functions
• Use functions as custom attribute values
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration
# cd /usr/share/doc/icinga2-common*/syntax
# PREFIX=~/.vim
# mkdir –p $PREFIX/{syntax,ftdetect}
# cp vim/syntax/icinga2.vim $PREFIX/syntax/
# cp vim ftdetect/icinga2.vim $PREFIX/ftdetect/
# vim /etc/icinga2/icinga2.conf
• Use syntax highlighting!
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration
# yum install rlwrap
# rlwrap icinga2 console
• Use ‘icinga2 console’ to test values, functions, etc!
• https://www.icinga.org/resources/live-console/
• Install rlwrap
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration
• Get to know all the value types!
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Constants
• PluginDir, MysqlPassword, SnmpCommunity, …
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Templates
• Templates for generic attributes
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Custom Attributes
• Numbers, Strings, Booleans, Arrays, Dictionaries
• Filters, Match Conditions, additional information
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Commands
• Optional/conditional arguments, functions, default values
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Hosts and Services
• Checkable objects and attributes
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Apply Services
• Match on (custom) attributes, names (assign)
• Exclude objects (ignore)
• For loops over arrays/dictionaries
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Notifications
• Dynamic notification rules
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Dependencies
• Host-on-Service, Service-on-Host, Classic
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Conditionals
• If-then-else
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Functions
• Use pre-defined or your own
• Custom attributes, command, argument values
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Loops
• While, for and break/continue
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Configuration: Type methods
• Array#sort, Dictionary#contains, String#find, …
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
#icinga
Icinga 2 – Demo
Get VirtualBox >= 4.2.16 && Vagrant >= 1.6.5
$ git clone --recursive https://github.com/Icinga/icinga-vagrant.git
$ cd icinga-vagrant
$ cd icinga2x-cluster
$ vagrant up
$ vagrant ssh icinga2a
$ vagrant ssh icinga2b
$> sudo –i
http://192.168.33.10 & http://192.168.33.20
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Conclusion
• Getting started
• http://docs.icinga.org/icinga2
• Icinga 2 Standalone & Cluster Vagrant Boxes
• https://github.com/icinga/icinga-vagrant
• Snapshots and release builds
• http://packages.icinga.org
#icinga