handout: 'open source tools & resources

42
Monitoring your Infrastructure using Open Source Tools by Greg Greenlee

Upload: bdpa-education-and-technology-foundation

Post on 17-Aug-2014

483 views

Category:

Education


2 download

DESCRIPTION

21 people attended the July 2014 program meeting hosted by BDPA Cincinnati chapter. The topic was 'Open Source Tools and Resources'. The guest speaker was Greg Greenlee (Blacks In Technology). 'Open source' refers to a computer program in which the source code is available to the general public for use or modification from its original design. Open source code is typically created as a collaborative effort in which programmers improve upon the code and share the changes within the community. Open source sprouted in the technological community as a response to proprietary software owned by corporations. Over 85% of enterprises are using open source software. Managers are quickly realizing the benefit that community-based development can have on their businesses. This month, we put on our geek hats and detective gloves to learn how we can monitor our computers’ environments using open source tools. This meetup covered some of the most popular ‘Free and Open Source Software’ (FOSS) tools used to monitor various aspects of your computer environment.

TRANSCRIPT

Page 1: Handout: 'Open Source Tools & Resources

Monitoring your Infrastructure using Open

Source ToolsSource Tools

by Greg Greenlee

Page 2: Handout: 'Open Source Tools & Resources

greg@blacksintechnology:~$ whoami

● Founder of Blacks In Technology organization

● Systems Engineer● Systems Engineer● FOSS lover● Avid comic book reader (Marvel)● Father● Husband

Page 3: Handout: 'Open Source Tools & Resources

What is Open Source Software?

● Source code is openly shared

● Licensed to allow freedom to modify, copy, ● Licensed to allow freedom to modify, copy,

study

Page 4: Handout: 'Open Source Tools & Resources

Why Open Source?

● Proso Free (as in beer) and sometimes not o code open to modificationo vulns are detected and fixed quickero vulns are detected and fixed quickero entire community working on it (depends on

popularity)

● Conso documentation sometimes lackso may prove difficult to implement

Page 5: Handout: 'Open Source Tools & Resources

Why monitor?

● You want to know when something goes wrong● Insight into your environment

o proactive● Business needs● Business needs

o analyticso trending data

● Event correlation

Page 6: Handout: 'Open Source Tools & Resources

Tools to monitor your infrastructure

● Nagios (monitoring and alerting)

● ELK Stack (log aggregation, search and analysis)

o ElasticSearch (search engine based on Lucene)

Logstash o Logstash (log aggregator and manipulator)

o Kibana (front end)

● Cacti (data graphing)

● NagVis (visualization)

● nTopNG (protocol analyzer)

Page 7: Handout: 'Open Source Tools & Resources

Nagios

● Created by Ethan Galstad (1999) - originally called NetSaint

● http://www.nagios.org

● http://www.nagios.org/download

● Very customizable

● Nagios XI

o standard and enterprise edition (http://www.nagios.com/products/nagiosxi/edition-comparison)

o aids in large scale configuration, reporting

o includes support services (http://www.nagios.com/products/nagiosxi/pricing)

● Nagios core

o free

o can purchase support

Page 8: Handout: 'Open Source Tools & Resources

What does Nagios do?

Monitors and alerts

Page 9: Handout: 'Open Source Tools & Resources

What can Nagios monitor?

1. Applications2. Network services (smtp, http, dns, ssh….)3. Hosts4. Host resources (disk, cpu, memory, processes)4. Host resources (disk, cpu, memory, processes)5. Web sites6. Sensors (temperature, humidity, power consumption..)7. Just about anything you can write a script for!!!

Page 10: Handout: 'Open Source Tools & Resources

How does Nagios monitor?

● Local plugins

o network services are running

● Remote plugins (NRPE NSClient++)

o disk utilizationo disk utilization

o memory utilization

o cpu utiliziation

● Custom Scripts (Perl, Python, Bash, etc.)

● More plugins and nagios goodness

o http://exchange.nagios.org/#/

Page 11: Handout: 'Open Source Tools & Resources

How does it work?

Uses a host to service relationship● Hosts (switch, router, server, sensors)● Service (http, dns, temperature, ping, ftp)

Uses traffic light system to indicate stateUses traffic light system to indicate state● Red - critical● Yellow - warning● Green - ok

Page 12: Handout: 'Open Source Tools & Resources

How does it work cont’d

Makes use of configuration files● templates● hosts and host groups● hosts and host groups● services and services groups● contacts and contact groups● notifications● escalations

Page 13: Handout: 'Open Source Tools & Resources

Host and service config file# Host definition

define host{use generic-host ; Name of host template to

usehost_name domain-

server-1alias Name

Serveraddress x.x.x.xcheck_command check-host-

alivehostgroups fakegroup

# Service definitiondefine service{

use generic-service ; Name of service template to use

host_name domain-server-1service_description DNSis_volatile

0check_period 24x7max_check_attempts 3normal_check_interval 1retry_check_interval 1

# 'check_dns' command definition

define command{

command_name check_dns

command_line $USER1$/check_dns

-H www.profitability.net -s $HOSTADDRESS$

}

hostgroups fakegroupcontact_groups novell-

adminsmax_check_attempts 10notification_interval 30notification_period 24x7notification_options d,u,rparents internalswitch-4-3-7-1}

retry_check_interval 1contact_groups novell-adminsnotification_interval 30notification_period 24x7notification_options w,u,c,r,f,scheck_command check_dns}

Page 14: Handout: 'Open Source Tools & Resources

How does it look?

ping check

ping check

● service check○ http○ ftp

Page 15: Handout: 'Open Source Tools & Resources

How do I get alerts?

emailtext IMIM

Page 16: Handout: 'Open Source Tools & Resources

Nagios demoNagios demo

Page 17: Handout: 'Open Source Tools & Resources

ELK Stack (log aggregation and analysis)

● Elasticsearch (Apache Lucene search engine)

● Logstash (collects and parses logs)● Logstash

● Kibana (front end gui allows you to visualize data)

Page 18: Handout: 'Open Source Tools & Resources

Why do we need centralized log server?

● Easy to find stuff

● Everything has logs

o operating systemso operating systems

o applications

o devices

● Correlation of events

● Insight into environment

Page 19: Handout: 'Open Source Tools & Resources

Elasticsearch

● http://www.elasticsearch.org/

● based on Apache Lucene

● indexes data

● full text search

● distributed (scales out)

● highly available (can build clusters)

● schema free (tries to structure data)

● real time data

Page 20: Handout: 'Open Source Tools & Resources

Elasticsearch DemoElasticsearch Demo

look at Elasticsearch Head

Page 21: Handout: 'Open Source Tools & Resources

Logstash

Created by Jordan Sissel

Allows you to ingest data from anywhere (input)Allows you to ingest data from anywhere (input)

Centralizes and parses log data (filter)

Display data (output)

Page 22: Handout: 'Open Source Tools & Resources

logstash● input

o syslogo fileo tcpo udpo eventlogo twitter

o irco irc

● filter (modifies)

o grok (parses unstructured data)

o mutate (mutates your events such as renaming, replacing, modifying fields)

● output

o csvo emailo fileo elasticsearcho http

Page 23: Handout: 'Open Source Tools & Resources

flow of data

input(tcp, syslog, file)

filter(grok, mutate)

output(stdout,

elasticsearch)

Page 24: Handout: 'Open Source Tools & Resources

Logstash formatinput {tcp {port => 5000type => syslog

}udp {port => 5000type => syslog

}}

filter {if [type] == "syslog" {if [type] == "syslog" {grok {match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?:

%{GREEDYDATA:syslog_message}" }add_field => [ "received_at", "%{@timestamp}" ]add_field => [ "received_from", "%{host}" ]

}syslog_pri { }date {match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]

}}

}

output {elasticsearch { host => localhost }stdout { codec => rubydebug }

}

Page 25: Handout: 'Open Source Tools & Resources

Kibana

● visualization tool

● interact with your data in real time● interact with your data in real time

● drill down and view only data you want

● make sense of your data

o bar or line graphs, maps and pie charts

Page 26: Handout: 'Open Source Tools & Resources

ELK stack demoELK stack demo

Page 27: Handout: 'Open Source Tools & Resources

NagVis

● http://www.nagvis.org/

● Nagios add on visualisation tool

o allows you to visualize Nagios data

● Allows you to create maps of your IT environment● Allows you to create maps of your IT environment

● Allows you to visualize work flows and processes

● create graphic out of performance data

o disk usage

o cpu usage

Page 28: Handout: 'Open Source Tools & Resources

Nagvis screenshots

Page 29: Handout: 'Open Source Tools & Resources

Nagvis demoNagvis demo

Page 30: Handout: 'Open Source Tools & Resources

Cacti● http://www.cacti.net/

● front end for RRDTool (Round Robin Database)

o records data in intervals

o graphs data pointso graphs data points

● Useful for seeing data trends

o bandwidth

o power consumption

o cpu usage

o memory usage

Page 31: Handout: 'Open Source Tools & Resources

Cacti demoCacti demo

Page 32: Handout: 'Open Source Tools & Resources
Page 33: Handout: 'Open Source Tools & Resources
Page 34: Handout: 'Open Source Tools & Resources

nTOPng

http://www.ntop.org/Network traffic probe and analyzerBased on original ntopSupported platforms (Windows and Unix)● Sort network traffic according to many protocols● Show network traffic and IPv4/v6 active hosts● Store on disk persistent traffic statistics in RRD format● Geolocate hosts● Analyse IP traffic and sort it according to the source/destination● Display IP Traffic Subnet matrix (who’s talking to who?)● Report IP protocol usage sorted by protocol type● Act as a NetFlow/sFlow collector for flows generated by routers (e.g. Cisco and Juniper) or switches (e.g.

Foundry Networks) when used together with nProbe.● Produce HTML5/AJAX network traffic statistics

Page 35: Handout: 'Open Source Tools & Resources

What can you do with nTOPng?

● Network troubleshooting● Drill down into traffic flows

o source and destination ip addresso source and destination porto source and destination porto bandwidtho protocolo application

Page 36: Handout: 'Open Source Tools & Resources

nTOPng screen shotsnTOPng screen shots

Page 37: Handout: 'Open Source Tools & Resources

nTopNG set up

Page 38: Handout: 'Open Source Tools & Resources
Page 39: Handout: 'Open Source Tools & Resources
Page 40: Handout: 'Open Source Tools & Resources
Page 41: Handout: 'Open Source Tools & Resources

Thank you!!!

email: [email protected]: @blkintechnologyfacebook: http://www.facebook.com/blacksintechnologywebsite: http://www.blacksintechnology.netwebsite: http://www.blacksintechnology.netLinkedIn: Blacks In Technology

Page 42: Handout: 'Open Source Tools & Resources

????????????