Gebruikershulpmiddelen

Site-hulpmiddelen


werkinstructies:snmp:hp1810-24g_switch_monitoren_met_snmp

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Beide kanten vorige revisie Vorige revisie
Volgende revisie
Vorige revisie
werkinstructies:snmp:hp1810-24g_switch_monitoren_met_snmp [2016/03/13 22:49]
abel
werkinstructies:snmp:hp1810-24g_switch_monitoren_met_snmp [2016/03/15 21:54] (huidige)
abel
Regel 17: Regel 17:
  
  
-===== Nagios =====+===== MRTG =====
  
-FIXME+Monitor de bandwidth met MRTG. 
  
-pas de configuratie van de swich monitoring aan:''vi HP-switch.cfg''+Maak een MRTG configuratie file aan door:\\ 
 +''mkdir /var/www/mrtg/switch-H\\ 
 +%%cfgmaker --global 'WorkDir: /var/www/mrtg/switch-H' --global 'Options[_]: bits,growright' --output /etc/mrtg/switch-H.cfg public@192.168.1.252%%''
  
  
 +Maak de webpagina met alle gedefinieerde graphs aan met indexmaker, weer in de betreffende directory:\\
 +''indexmaker %%--%%output=/var/www/mrtg/switch-H/index.html /etc/mrtg/switch-H.cfg''
 +
 +run een aantal keer om de eerste foutmeldingen kwijt te raken:\\
 +''for %%(( i=1 ; i <= 3 ; i++ ));%% do env LANG=C mrtg /etc/mrtg/switch-H.cfg; done ''
 +
 +
 +zorg dat elke 5 minuten data wordt opgehaald, maak hiervoor een cron job aan:\\
 +''vi /etc/cron.d/mrtg''
 +
 +en zet hier in:
 <code> <code>
-# Monitor bandwidth via MRTG logs+ 
 +*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/switch-H.cfg --lock-file /var/lock/mrtg/switch-H_l --confcache-file /var/lib/mrtg/mrtg.ok 
 + 
 +</code> 
 +Na een tijdje kan je kijken op de betreffende web pagina [[http://example.com/mrtg/switch-h]] 
 + 
 +{{ :werkinstructies:snmp:hp-snmp4.png?nolink&800 |}} 
 + 
 +===== Nagios ===== 
 +Maak een nagios conf file aan:\\ 
 +''vi /etc/nagios/objects/network/HP-switch.cfg'' 
 + 
 +en zet daar in: 
 + 
 +<code> 
 +# Define the switch that we'll be monitoring 
 + 
 +define host{ 
 +        use             generic-switch          ; Inherit default values from a template 
 +        host_name       HP_1810-24G             ; The name we're giving to this switch 
 +        alias           Switch beneden          ; A longer name associated with the switch 
 +        address         192.168.1.252           ; IP address of the switch 
 +        hostgroups      switches                ; Host groups this switch is associated with 
 +        } 
 + 
 +# Create a service to PING to switch 
 + 
 +define service{ 
 +        use                     generic-service ; Inherit values from a template 
 +        host_name               HP_1810-24G     ; The name of the host the service is associated with 
 +        service_description     PING            ; The service description 
 +        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service 
 +        normal_check_interval                 ; Check the service every 5 minutes under normal conditions 
 +        retry_check_interval    1               ; Re-check the service every minute until its final/hard state is determined 
 +        } 
 + 
 + 
 +# Monitor uptime via SNMP
  
 define service{ define service{
         use                     generic-service ; Inherit values from a template         use                     generic-service ; Inherit values from a template
         host_name               HP_1810-24G         host_name               HP_1810-24G
-        service_description     Port 1 Bandwidth Usage +        service_description     Uptime 
-        check_command           check_local_mrtgtraf!/var/lib/mrtg/192.168.1.252_1.log!AVG!1000000,1000000!5000000,5000000!10+        check_command           check_snmp!-C public -o sysUpTime.0
         }         }
-</code> + 
-naar: +# Monitor Port 1 status via SNMP 
-<code>+ 
 +define service{ 
 +        use                     generic-service ; Inherit values from a template 
 +        host_name               HP_1810-24G 
 +        service_description     Port 1 Link Status 
 +        check_command           check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB 
 +        } 
 # Monitor bandwidth via MRTG logs # Monitor bandwidth via MRTG logs
  
Regel 42: Regel 99:
         host_name               HP_1810-24G         host_name               HP_1810-24G
         service_description     Port 1 Bandwidth Usage         service_description     Port 1 Bandwidth Usage
-        check_command           check_local_mrtgtraf!/var/www/mrtg/192.168.1.252_1.log!AVG!1000000,1000000!5000000,5000000!10+        check_command           check_local_mrtgtraf!/var/www/mrtg/switch-H/192.168.1.252_1.log!AVG!1000000,1000000!5000000,5000000!10
         }         }
  
 </code> </code>
 +
 +
 +
werkinstructies/snmp/hp1810-24g_switch_monitoren_met_snmp.1457905793.txt.gz · Laatst gewijzigd: 2016/03/13 22:49 door abel