Download - Nllgg - Nagios Cacti Snmp Traps
System/Network monitoring
SNMP Trap Translator
Introductie
Welkom Voorstellen Doel van deze presentatie
Waarom monitoring
Capaciteitsplanning Disk gebruik Netwerk belasting Geheugen gebruik Proces beheer Licenties
SLA rapportages
Status informatie Overschrijding
parameters Beschikbaarheid services Hardware failures Intrusion attempts
Informatie bronnen
Systeem logging Utilities beschikbaar op het systeem
Raid status Temperatuur Ping
WMI (Windows Measurement Interface) SNMP (Simple Network Management Protocol)
Polling Traps
Centraal monitoren
Alle informatie overzicht beschikbaar Checks worden geautomatiseerd uitgevoerd Eenvoudig om 'volcontinue' te monitoren Informatie beschikbaar over defecte hardware, gecrashte
service
Open source tools voor eenCentraal Management Station
syslogd, rsyslogd, syslog-ng Remote ontvangst van log informatie verstuurd door nodes
snmpget, snmpwalk Commando's om remote SNMP servers te ondervragen
snmptrapd, snmptt Proces dat snmptraps van nodes ontvangt en daarna vertaalt naar
'leesbare' meldingen.
Open source tools voor eenCentraal Management Station
nagios Service monitor die actief en passief de status van services
monitort, bewaakt en eventueel 'notifications' verstuurt. cacti
Periodieke poller die data verzameld in zgn. RRD files op basis waarvan historische overzichten en trends getoont worden
splunk Analyseert logfiles en maakt het eenvoudiger om oorzaken te
achterhalen
Cacti
cacti
Poller Vraagt iedere 5 minuten gegevens op via SNMP en/of scripts Bewaart data in RRD databases met een resolutie van 5 min, 30 min, 2
uur en 1 dag
Web interface Configuratie en beheer Toont grafieken op basis van de gegevens in de RRD database
Geen alarmering in geval van overschrijding drempelwaardes/uitval van services
nagios
nagios
Status monitor Actief, circulaire scheduler die via plugins status informatie opvraagt en
toont Passief, ontvangt externe informatie en geeft deze weer nagios begrijpt netwerk hierarchie Alarmerings functie in geval van uitval van nodes/services
Rapportage tool Beschikbaarheid van nodes/services SLA Houdt rekening met geplande downtime
splunk
splunk
Analyseert logfiles Presenteert informatie overzichtelijk Eenvoudige filtermogelijkheden Overzichtelijke weergave van events in de tijd Kan rapportages verzorgen
nagiosadmin
nagiosadmin
Webinterface om nagios te configureren Op basis van data in een database worden iedere keer nieuwe
nagios configuratie files gecreeerd Eenvoudig te bedienen Flexibel, staat toe nieuwe services toe te voegen
nagtrap
Het totaal plaatje
Node 1 Node 2 Node 3
cactipoller
scripts snmptrapd rsyslog
nagios
plugins
snmpttRRD
Logfiles
nagiosadmin
cactipoller
cactiweb
Trapsdb
nagios.cgi nagtrap splunk
cactidb
nagiosdb
snmptrapd
May 7 12:45:01 spider snmptrapd[6109]: 2009-05-07 12:45:01 switch105 [UDP: [192.168.76.105]:161]:#012.1.3.6.1.2.1.1.3.0 = Timeticks: (320942996) 37 days, 3:30:29.96#011.1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.6.3.1.1.5.4#011.1.3.6.1.2.1.2.2.1.1.18 = INTEGER: 18#011.1.3.6.1.2.1.2.2.1.7.18 = INTEGER: up(1)#011.1.3.6.1.2.1.2.2.1.8.18 = INTEGER: up(1)
linkUp NOTIFICATION-TYPE OBJECTS { ifIndex, ifAdminStatus, ifOperStatus } STATUS current DESCRIPTION "A linkUp trap signifies that the SNMP entity, acting in an agent role, has detected that the ifOperStatus object for one of its communication links left the down state and transitioned into some other state (but not into the notPresent state). This other state is indicated by the included value of ifOperStatus." ::= { snmpTraps 4 }
/etc/snmp/snmptrapd.conf
authCommunity log,execute,net community-string
traphandle default /usr/sbin/snmptthandler
snmptt
Thu May 7 12:45:01 2009 IF-MIB::linkUp Normal "Status Events" switch105 - A linkUp trap signifies that the SNMP entity, acting in an 18 up up
EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" NormalFORMAT A linkUp trap signifies that the SNMP entity, acting in an $*SDESCA linkUp trap signifies that the SNMP entity, acting in an agent role, has detected that the ifOperStatus object for one of its communication links left the down state and transitioned into some other state (but not into thenotPresent state). This other state is indicated by the ncluded value of ifOperStatus.Variables: 1: ifIndex 2: ifAdminStatus 3: ifOperStatusEDESC
/etc/snmp/snmptt.ini
# Configures how the OID of the received trap is handled when outputting to a log file /# database. It does NOT apply to the $O variable.# Set to 0 to use the default of numerical OID# Set to 1 to translate the trap OID to short text (symbolic form) (eg: linkUp)# Set to 2 to translate the trap OID to short text with module name (eg: IF-MIB::linkUp)# Set to 3 to translate the trap OID to long text (eg: iso...snmpTraps.linkUp)# Set to 4 to translate the trap OID to long text with module name (eg:# IF-MIB::iso...snmpTraps.linkUp)translate_log_trap_oid = 2
[TrapFiles]# A list of snmptt.conf files (this is NOT the snmptrapd.conf file). The COMPLETE path# and filename. Ex: '/etc/snmp/snmptt.conf'snmptt_conf_files = <<END/etc/snmp/snmptt-nagtrap.confEND
/etc/snmp/snmptt-nagtrap.conf
outfile="snmptt-nagtrap.conf"# Remove existing filerm -f $outfile
# Convert the MIBS to something that snmptt can handlefor mibfile in /usr/share/snmp/mibs/* /usr/share/mibs/*/* /usr/local/share/mibs/*do /usr/sbin/snmpttconvertmib --in="$mibfile" --out="$outfile"done
# The converted file contains various words to describe the severity of# a trap.# We have to normalize them in such a way that nagtrap will understand them.sed -i -e '/^EVENT/s/SEVERE/CRITICAL/' \ -e '/^EVENT/s/MAJOR/CRITICAL/' \ -e '/^EVENT/s/MINOR/WARNING/' \ -e '/^EVENT/s/INFORMATIONAL/NORMAL/' \ $outfile
/etc/nagios/commands.cfg
define command{ command_name check_snmptraps command_line $USER1$/check_snmp_traps -H $HOSTNAME$ }
/usr/lib/nagios/plugins/check_snmp_trap
# Anzahl der Critical TrapsCOUNT_CRITICAL=`echo "select count(*) from snmptt where hostname like '%$HOST%' and severity = 'CRITICAL' and trapread = '0'" | mysql -s -u $MYSQL_USER --password=$MYSQL_PASS $MYSQL_DB`
if [ $COUNT_CRITICAL -gt 0 ] then echo "CRITICAL: $COUNT_CRITICAL Critical Traps for $HOST. $COUNT Traps in Database" exit $STATE_CRITICALelif [ $COUNT_WARNING -gt 0 ] then echo "WARNING: $COUNT_WARNING Warning Traps for $HOST. $COUNT Traps in Database" exit $STATE_WARNINGelse echo "OK: No Warning or Critical Traps for $HOST. $COUNT Traps in Database" exit $STATE_OKfi
/usr/local/share/mibs/UCD-TRAP-TEST-MIB.txt
UCD-TRAP-TEST-MIB DEFINITIONS ::= BEGIN IMPORTS ucdExperimental FROM UCD-SNMP-MIB;
demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }
demoTrap TRAP-TYPE ENTERPRISE demotraps VARIABLES { sysLocation } DESCRIPTION "An example of an SMIv1 trap" ::= 17
END
test trap
snmptrap -v 1 -c communitystring hostname UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" SNMPv2-MIB::sysLocation.0 s "Just here"
Vragen?