60
www.icinga.org Why favour Icinga over Nagios 2015-08-22

Why favour Icinga over Nagios @ FrOSCon 2015

  • Upload
    icinga

  • View
    6.812

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Why favour Icinga over Nagios @ FrOSCon 2015

www.icinga.org

Why favour Icinga over Nagios

2015-08-22

Page 2: Why favour Icinga over Nagios @ FrOSCon 2015

Markus Frosch

• Consultant @NETWAYS• Icinga Team since 2012• Organisation of Icinga 2• Debian developer

@lazyfrosch

Page 3: Why favour Icinga over Nagios @ FrOSCon 2015

THE ICINGA PROJECT

Page 4: Why favour Icinga over Nagios @ FrOSCon 2015

Open Source Enterprise Monitoring

Icinga is a scalable and extensible monitoring system which checks the availability of your resources, notifiesusers of outages and provides extensive BI data.

Page 5: Why favour Icinga over Nagios @ FrOSCon 2015

You?

Page 6: Why favour Icinga over Nagios @ FrOSCon 2015

• originally forked from Nagios in 2009• focus on improvements and scalability• independent version Icinga 2 since 2014•web interfaces and addons

Page 7: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga Core

Nagios based C-sourceMySQL, PostgreSQL, Oracle

Icinga Core

Nagios based C-sourceMySQL, PostgreSQL, Oracle

Icinga Quality, Testing and Community Support

Website and Open Source Ticketing System

Icinga Quality, Testing and Community Support

Website and Open Source Ticketing System

3rd Party Tools3rd Party ToolsIcinga Webbased on PHP using ExtJS, Agavi MVCIcinga Webbased on PHP using ExtJS, Agavi MVC

IDOUTILSIDOUTILS

Icinga Web 2Based on PHP / responsive designIcinga Web 2Based on PHP / responsive design

Icinga 2

C++-based sourcewith multiple components

Icinga 2

C++-based sourcewith multiple components

IDOIDO LivestatusLivestatus ClusterCluster APIAPI ……

Page 8: Why favour Icinga over Nagios @ FrOSCon 2015

ICINGA 2 INTRODUCTION

Page 9: Why favour Icinga over Nagios @ FrOSCon 2015

• monitors everything• in a regular interval• preferring active checks• gathering status• collect performance data / metrics

Page 10: Why favour Icinga over Nagios @ FrOSCon 2015

• notifies using any channel• detects dependencies• handles events in configured way

Page 11: Why favour Icinga over Nagios @ FrOSCon 2015

• forwards logs to Logstash and Graylog• passes performance data to Graphite,

OpenTSDB or InfluxDB• integrate with other tools?

Page 12: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2

• release 2.3.8 (2015-07-20)•new code base on C++ and Boost• similar ideas to Nagios• Puppet, Chef and Ansible integration•Packages and Vagrant Box available

Page 13: Why favour Icinga over Nagios @ FrOSCon 2015

WHY NAGIOS™ IS GOOD?

Page 14: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ is good, because:

✔ monitoring things is very easy✔ very simple software stack ✔ no complex external dependencies

Page 15: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ is good, because:

✔ active checks are powerful✔ gathering performance data✔ huge community✔ thousands of Plugins

Page 16: Why favour Icinga over Nagios @ FrOSCon 2015

OK, BUT WHY ICINGA THEN?

Page 17: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ does not scale

✗ it's just a single loop✗ limitations using external interfaces✗ large installations are difficult

Page 18: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2 on the other hand

✔ provides a multithreaded engine✔ distributes load in cluster automatically✔ is able to monitor thousands of devices

every few seconds

Page 19: Why favour Icinga over Nagios @ FrOSCon 2015

MODULES

Page 20: Why favour Icinga over Nagios @ FrOSCon 2015

Modules in Nagios™?

# tar xzvf mk-livestatus-1.2.4.tar.gz# cd mk-livestatus-1.2.4 # ./configure --prefix=/usr/local/icinga

--exec-prefix=/usr/local/icinga# make# cp src/livestatus.o /usr/local/icinga/bin

define module { module_name mklivestatus path /usr/local/icinga/bin/livestatus.o module_type neb args /usr/local/icinga/var/rw/live }

Page 21: Why favour Icinga over Nagios @ FrOSCon 2015

CheckerChecker

NotifyNotify

API(soon)API(soon)

CompatCompat ClusterCluster

IDOIDO GELFGELF

GraphiteGraphite

PerfdataPerfdata

OpenTSDBOpenTSDB

LivestatusLivestatus

Page 22: Why favour Icinga over Nagios @ FrOSCon 2015

# icinga2 feature enable livestatus# icinga2 feature enable ido-mysql

# vim /etc/icinga2/features- available/ido-mysql.conf

Page 23: Why favour Icinga over Nagios @ FrOSCon 2015

DEMO

Page 24: Why favour Icinga over Nagios @ FrOSCon 2015

CLUSTERING

Page 25: Why favour Icinga over Nagios @ FrOSCon 2015

How about high available Nagios™?

✗ there is no integrated failover mechanism✗ configuration is not distributed✗ no shared monitoring information

Page 26: Why favour Icinga over Nagios @ FrOSCon 2015

What Icinga 2 provides you

✔ zones for multitenancy environments✔ support for logic splits in the config✔ availability and scaling zones✔ automatic redistribution of checks✔ master / satellite / agent

Page 27: Why favour Icinga over Nagios @ FrOSCon 2015

centra

l

datace

nter

centra

l

datace

nter

CheckerChecker ConfigConfig

LivestatusLive

status

CheckerChecker

DatabaseDatabase

IDOIDO

IDOIDO

remotelocation

CheckerChecker

Page 28: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ and security

✗ NSCA works, but not in a good way✗ NRPE has a couple of security issues✗ You can make it secure … by hand

Page 29: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2 clustering is PKI TLS only

✔ bidirectional connections✔ helps you setting up a CA✔ replication of events and status

Page 30: Why favour Icinga over Nagios @ FrOSCon 2015

DEMO

Page 31: Why favour Icinga over Nagios @ FrOSCon 2015

CONFIGURATION

Page 32: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ config tricks are weird…

define service{host_name linux1,linux2,linux3,...,linux9service_description ssh-checkother service directives ...}

Page 33: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios™ can only do lists

define hostgroup{hostgroup_name linux-serversalias Linux Serversmembers linux1,linux2,linux3}

Page 34: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2 brings logic

apply Service "ssh" {import "generic-service”

check_command = "ssh” assign where host.address && host.vars.os == "Linux” ignore where host.vars.test == true}

Page 35: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2 wants to unterstand you

object HostGroup "mysql-server" {display_name = "MySQL Server"

assign where match("*mysql*", host.name) assign where host.vars.role == "mysql-server" ignore where host.vars.environment != "production"}

Page 36: Why favour Icinga over Nagios @ FrOSCon 2015

Imagine a host you manage

object Host "shop1.nbg.de.bratwurst.de" { import "generic-host" address = "192.0.2.123"

vars = { environment = "production" role = "webserver" location = "nbg1" application = "bratwurstshop" team = "appsupport" }}

Page 37: Why favour Icinga over Nagios @ FrOSCon 2015

Maybe add templates

template Host "webserver-default" { import "generic-host" vars = { environment = "production" role = "webserver" }}object Host "shop1.nbg.de.bratwurst.de" { import "webserver-default" address = "192.0.2.123"

vars.location = "nbg1" [...]}

Page 38: Why favour Icinga over Nagios @ FrOSCon 2015

Now add some services

apply Service "http" { import "generic-service" check_command = "http" assign where host.role == "webserver"}

apply Service "https" { import "generic-service" check_command = "http" vars.http_ssl = true assign where host.role == "webserver"}

Page 39: Why favour Icinga over Nagios @ FrOSCon 2015

Get notified

apply Notification "host-prod-oncall" to Host { import "mail-host-notification" user_groups = [ "datacenter-oncall" ] timeperiod = "non-workhours" assign where host.environment == "production"}

apply Notification "appsupport-prod-oncall" to Service { import "mail-service-notification" user_groups = [ "appsupport-oncall" ] timeperiod = "non-workhours" assign where host.team == "appsupport" \ && host.environment == "production"}

Page 40: Why favour Icinga over Nagios @ FrOSCon 2015

Define dependencies

apply Dependency "host-in-nbg1" to Host { parent_host_name = "router.nbg1.bratwurst.de"

disable_checks = true disable_notifications = true

assign where host.location == "nbg1" && \ host.role != "router"}

Page 41: Why favour Icinga over Nagios @ FrOSCon 2015

Safe and powerful commands

object CheckCommand "fancy-vendor-check" { import "plugin-check-command"

command = [ PluginDir + "/check_vendor_foo" ]

arguments = { "-H" = "$host.name$" "-C" = "$snmp_community$" "-m" = "$vendor_mode$" "-w" = "$vendor_warning$" "-c" = "$vendor_critical$" } vars.snmp_community = "public"}

Page 42: Why favour Icinga over Nagios @ FrOSCon 2015

Easy to use

apply Service "fancy-vendor test" { import "generic-service"

check_command = "fancy-vendor-check"

vars.snmp_community = "isthissecure" vars.vendor_mode = "proprietary-magic" vars.vendor_warning = "80" vars.vendor_warning = "90"

assign where host.type = "fancy-vendor-node"}

Page 43: Why favour Icinga over Nagios @ FrOSCon 2015

Using commands

● safe against shell injections● clean interface, easy to write● just set a var in service or host● check our ITL template library

Page 44: Why favour Icinga over Nagios @ FrOSCon 2015

ONE MORE THING...

Page 45: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga 2 is enhanceable

object Service "webservice" { import "generic-service" check_command = "load" host_name = "a really great server"

vars.load_wload1 = {{ if (get_time_period("9to5").is_inside) { return 40 } else { return 60 } }}

}

Page 46: Why favour Icinga over Nagios @ FrOSCon 2015

WHAT YOU SEE IS WHAT YOU GET

Page 47: Why favour Icinga over Nagios @ FrOSCon 2015

Nagios CGI

Page 48: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga Classic

Page 49: Why favour Icinga over Nagios @ FrOSCon 2015

Icinga Web 1

Page 50: Why favour Icinga over Nagios @ FrOSCon 2015

✗ limitations in current Icinga interfaces✗ parsing the status.dat is not fast✗ executing commands is tedious✗ really hard to extend and integrate✗ no unified interface so far

Page 51: Why favour Icinga over Nagios @ FrOSCon 2015

Icingaweb 2

• easy to extend and embed•multiple authentication providers• reads from IDO database • responsive

release soonTM

Page 52: Why favour Icinga over Nagios @ FrOSCon 2015

Web 2MySQL /PostgreSQL

MySQL /PostgreSQL2

or Icinga 1

The simplest setup

set up within a few minutes...

Page 53: Why favour Icinga over Nagios @ FrOSCon 2015

Web 2

MonitoringMonitoring DocsDocs

BPBP GraphiteGraphite PNPPNP

Page 54: Why favour Icinga over Nagios @ FrOSCon 2015

Demo

Page 55: Why favour Icinga over Nagios @ FrOSCon 2015
Page 56: Why favour Icinga over Nagios @ FrOSCon 2015

CONCLUSION

Page 57: Why favour Icinga over Nagios @ FrOSCon 2015

Where to start?

•Go to docs.icinga.org• Try our Vagrant VMs•Use Icinga 2 packages•Rethink you configuration• Install Icinga Web 2 and play with it•Give us feedback

#icinga

Page 58: Why favour Icinga over Nagios @ FrOSCon 2015

You?

Page 59: Why favour Icinga over Nagios @ FrOSCon 2015

Berlin 2016

March 1st

Berlin 2016

March 1st

Portland 2015

October 10th

Portland 2015

October 10th

Icinga Camp community meetups

Page 60: Why favour Icinga over Nagios @ FrOSCon 2015

THANK YOU!www.icinga.org

exchange.icinga.org

docs.icinga.org

dev.icinga.org

git.icinga.org

@icinga

/icinga

+icinga