[Ditedi]monitoring

24
Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche MONITORING

description

Slide del seminario DiTeDi 2013 su sistemi di monitoraggio

Transcript of [Ditedi]monitoring

Page 1: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING

Page 2: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING perchè monitorare?

● Ambienti mission-critical

● Identificazione e limitazione dei danni

● Necessità di prevenire i problemi (essere proattivi)

● Visione complessiva dell'infrastruttura

● Misurazione delle performance/prestazioni

Page 3: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING cosa monitorare?

● server

● dispositivi di rete

● appliance

● UPS/devices generici

● parametri ambientali

Page 4: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING come monitorare?

AgentlessAgentless

● Nessuna installazione su server● Carico minore (ma siamo proprio sicuri)?● Monitoraggio blackbox – network devices● Controllo dispositivi vari (UPS/adapter/ecc)

ma● Raggiungibilità e firewalling● Problemi configurazione complicata (MIB?)● Comandi/opzioni limitate (ma è proprio vero?)

Page 5: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING SNMP

SNMPSNMP

● Acronimo di “Simple Network Management Protocol”● Internet-standard protocol for managing devices on IP

networks● SNMP versione 3 (RFC 3411/3418)

– opzionali funzioni di cifratura– Management Information Bases (MIBs)

● Monodirezionale/passivo (read-only) ● Bidirezionale/attivo (read and write)

Page 6: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING VERSIONI SNMP

SNMP - versioniSNMP - versioni

1

autenticazione solo tramite community string (in chiaro)comunicazioni “clear-text”

2/2c GetBulkRequest / InformRequest (ACK)

non compatibile con versione 1

3 Confidenzialità (cifratura del dato)

Integrità dei pacchetti

Autenticazione (cifrata)

Page 7: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING SNMP

Polling & TrapPolling & Trap

Modalità di comuniczione● Polling (porta

161/UDP)● Trap (porta 162/UDP)

Page 8: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING SNMP: un esempio

% snmpwalk -mALL -v1 -cpublic xxx.xxx.xxx.xxx:161 systemSNMPv2-MIB::sysDescr.0 = STRING: ILOM machine custom descriptionSNMPv2-MIB::sysObjectID.0 = OID: SUN-ILOM-SMI-MIB::sunILOMSystemsDISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (16439826) 1 day, 21:39:58.26SNMPv2-MIB::sysContact.0 = STRING: set via snmp testSNMPv2-MIB::sysName.0 = STRING: SUNSPHOSTNAMESNMPv2-MIB::sysLocation.0 = STRING:SNMPv2-MIB::sysServices.0 = INTEGER: 72SNMPv2-MIB::sysORLastChange.0 = Timeticks: (14) 0:00:00.14SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIBSNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIBSNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIBSNMPv2-MIB::sysORID.4 = OID: RFC1213-MIB::ipSNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIBSNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroupSNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBComplianceSNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDComplianceSNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBComplianceSNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layersSNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entitiesSNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementationsSNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementationsSNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementationsSNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.SNMPv2-MIB::sysORDescr.7 = STRING: The SNMP Management Architecture MIB.SNMPv2-MIB::sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching.SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.SNMPv2-MIB::sysORUpTime.1 = Timeticks: (1) 0:00:00.01SNMPv2-MIB::sysORUpTime.2 = Timeticks: (2) 0:00:00.02SNMPv2-MIB::sysORUpTime.3 = Timeticks: (2) 0:00:00.02SNMPv2-MIB::sysORUpTime.4 = Timeticks: (2) 0:00:00.02SNMPv2-MIB::sysORUpTime.5 = Timeticks: (2) 0:00:00.02SNMPv2-MIB::sysORUpTime.6 = Timeticks: (2) 0:00:00.02SNMPv2-MIB::sysORUpTime.7 = Timeticks: (14) 0:00:00.14SNMPv2-MIB::sysORUpTime.8 = Timeticks: (14) 0:00:00.14SNMPv2-MIB::sysORUpTime.9 = Timeticks: (14) 0:00:00.14

Page 9: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING SNMP

SNMP... ma è proprio agentless?SNMP... ma è proprio agentless?

● Richiede tre componenti

– Oggetto da monitorare– Agente di monitoraggio (spesso built-in)

● Snmp daemon (unix/linux)● Snmp daemon (embedded/devices)

SNMP... ma è così semplice usarlo?SNMP... ma è così semplice usarlo?

● Identificare i MIB (discovery-snmpwalk-documentazione)● Possibilità di personalizzazione MIB

Page 10: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING SNMP Security

SNMP... sicurezza dei sistemiSNMP... sicurezza dei sistemi

● Spesso i sistemi sono pre-impostati con community di default e con possibilità di accesso dall'esterno

● v1 e v2 usano password in chiaro e

trasportano dati su UDP senza verifica integrità ● Possono fornire informazioni sulla rete● Possono consentire attacchi alla rete● A volte generano traffico inatteso● E' un protocollo facilmente intercettabile

Page 11: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING come monitorare?

AgentAgent

● Maggori potenzialità di monitoraggio● Semplicità di configurazione/gestione (server side)● Funzionalità di sicurezza (autenticazione/cifratura canale)● Customizzazioni su oggetti/comandi monitoraggio

ma● Tempi installazione / carico dei sistemi (sistemisti terribili!)● Problemi sicurezza (?)● Distribuzioni legacy software in uso

Page 12: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING cosa posso controllare?

● Raggiungibilità (stato, latenze, loss)

● Processi / Servizi (impostazioni, stato, carico)

● Filesystem/Partizioni (mount, occupazione spazio disco)

● File (presenza, contenuto, hash)

● Parametri di sistema (I/O, file aperti, memoria, latenze)

● Rete (interface status, I/O, dropped packet)

● Porte (status, velocità, collisioni, traffico, parametri)

● Tabelle, registri,flags (routing, nat, ecc)

● Parametri ambientali (tensione, corrente, cos Phi, temperatura)

● Servizi complessi (web/db/smtp)

Page 13: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING punti di forza

● Storico ==> ricostruzione pregresso

● Medie/andamenti ==> “previsione del futuro”

● Grafici ==> identificazione di “pattern” di anomalia

● Trigger ==> avviso superamento soglia (o disarmo)

● Allarmi ==> multi gruppo/multi tecnologia/soglia

● Mappe ==> visualizzazione semplificata

● Servizi ==> opero a layer elevati (L7 ISO/OSI)

● Template ==> semplificazione gestione reti complesse

● Autodiscovery ==> velocità attivazione monitoraggio

● Bare metal ==> velocità setup infrastruttura

● Oggetti parent ==> detecting guasti semplificato

==> allarmistica limitata

Page 14: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING come si procede?

● COME TUTTE LE ATTIVITA' (IT?) DEVE ESSERE PIANIFICATA, sebbene i sistemi siano nati per garantire flessibilità anche in fase post installazione (soprattutto agent)

● Definizione:

● obiettivi monitoraggio● oggetti monitoraggio (protocollo, nomenclatura, parentele)● Progettazione template secondo le logiche di prodotto● Parametri/servizi da monitorare (elenco, scelta modalità)● Utenti/gruppi interessati e allarmi da gestire● Valutazione problematiche networking/firewalling (VPN?)

● Installazione agenti sugli host

● Configurazione del monitoraggio e inizio raccolta

Page 15: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING come si procede?

● Creazione grafici

● Analisi dati raccolti e storico (non conosciamo a priori la nostra infrastruttura)

● Decisione punti di soglia

● Attivazione trigger e destinazione allarmi

● Valutazione funzionamento in test dei trigger

● Messa in produzione trigger

● Simulazioni condizioni problematiche e valutazione funzionamento (tutte!)

● Attivazione funzioni accessorie (pannelli, mappe, slideshow)

Page 16: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING che strumenti usare?

Esistono moltissime soluzioni di monitoraggio

● OpenSource vs Closed

Page 17: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING che strumenti usare?

Esistono moltissime soluzioni di monitoraggio, ne segnaliamo solo alcune

● Nagios (modulare, chiaro, plugin)● OpenNMS (bare metal, approccio enterprise)● Zabbix (flessibile, veloce, intuitivo)

Page 18: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING quanto costa monitorare?

● Il monitoraggio richiede:

● Progettazione● Attenta implementazione● Verifica post implementazione● Qualcuno che controlli i dati (oltre i trigger)● Test ciclici● Gestione dei falsi positivi

Un sistema di monitoraggio senza qualcuno che lo “monitori” non ha senso sul lungo periodo

Page 19: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING quanti monitorano propria rete?

Page 20: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING Zabbix

Page 21: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING Zabbix OverviewOverview

Zabbix was created by Alexei Vladishev, and currently is actively developed and supported by Zabbix SIA.

Zabbix is an enterprise-class open source distributed monitoring solution.

Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.

Zabbix supports both polling and trapping. All Zabbix reports and statistics, as well as configuration parameters, are accessed through a web-based front end. A web-based front end ensures that the status of your network and the health of your servers can be assessed from any location. Properly configured, Zabbix can play an important role in monitoring IT infrastructure. This is equally true for small organisations with a few servers and for large companies with a multitude of servers.

Zabbix is free of cost. Zabbix is written and distributed under the GPL General Public License version 2. It means that its source code is freely distributed and available for the general public.

Commercial support is available and provided by Zabbix Company

Page 22: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING Zabbix Features

FeaturesData gathering (custom command)

Flexible threshold definitions (triggers)

Highly configurable alerting (macro)

Real-time graphing

Web monitoring capabilities

Extensive visualisaticon options

Historical data storage

Easy configuration

Use of templates

Network discovery

Fast web interface

Zabbix API

Permissions system

Full featured and easily extensible agent

Binary daemons

Ready for complex environments

ProtocolsSNMP

(both trapping and polling)

IPMI

(The Intelligent Platform Management Interface (IPMI) is a standardized computer system interface used by system administrators for out-of-band management of computer systems and monitoring of their operation. It is a way to manage a computer that may be powered off or otherwise unresponsive by using a network connection to the hardware rather than to an operating system or login shell)

JMX

Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices) and service oriented networks. Those resources are represented by objects called MBeans. In the API, classes can be dynamically loaded and instantiated. Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit.

Page 23: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING qualche consiglio per il weekend

Page 24: [Ditedi]monitoring

Dario Tion- [email protected] Monitoraggig di infrastrutture informatiche

MONITORING

CREDITSTutti i loghi e le immagini qui utilizzate sono

dei legittimi proprietari; a tal proposito si ringraziano:

Google :)

The Simpson family

Zabbix community

All the O.S.developers communities

All the O.S. fans communities

All the penguins & All the Beastie