start:supervision:check_mk:quagga
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| start:supervision:check_mk:quagga [2012/12/28 15:40] – créée domi | start:supervision:check_mk:quagga [2012/12/28 15:49] (Version actuelle) – domi | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| Pour vérifier l' | Pour vérifier l' | ||
| - | |||
| - | Le script communiquant avec Quagga utilise expect. | ||
| * '' | * '' | ||
| Ligne 10: | Ligne 8: | ||
| #!/bin/bash | #!/bin/bash | ||
| + | ## Neuronnexion - www.neuronnexion.coop - tech@nnx.com | ||
| + | ## Released under the terms of GNU/GPL | ||
| + | | ||
| conf="/ | conf="/ | ||
| script_expect="/ | script_expect="/ | ||
| Ligne 58: | Ligne 59: | ||
| </ | </ | ||
| + | Exemple de fichier de configuration. | ||
| + | <file bash / | ||
| + | # Keywords : critical or exclude | ||
| + | # AS like ASXXXX | ||
| + | # Description is not an option ;) | ||
| + | |||
| + | # this one is a transit | ||
| + | critical: | ||
| + | # this one keeps flapping | ||
| + | exclude: | ||
| + | </ | ||
| + | |||
| + | (en vrai, on a pas de session avec l'AS 666 ;-) | ||
| + | |||
| + | |||
| + | Le script communiquant avec Quagga utilise expect. | ||
| + | |||
| + | <file expect / | ||
| + | # | ||
| + | |||
| + | # Utilisé par le check_mk_agent pour gérer la vue des sessions BGP | ||
| + | # Viva NNX | ||
| + | |||
| + | # Note: this script is NOT good example of writting code in Expect at all. | ||
| + | |||
| + | if { [llength $argv] != 4 } { | ||
| + | |||
| + | puts " | ||
| + | puts " | ||
| + | puts " | ||
| + | puts " | ||
| + | puts " | ||
| + | puts "Use with extreme caution! You have been warned..." | ||
| + | exit 1 | ||
| + | } | ||
| + | |||
| + | set hostname [lindex $argv 0] | ||
| + | set service [lindex $argv 1] | ||
| + | set disable_password [lindex $argv 2] | ||
| + | set enable_password [lindex $argv 3] | ||
| + | |||
| + | set disable_prompt " | ||
| + | set enable_prompt " | ||
| + | |||
| + | set disable_password_prompt " | ||
| + | set enable_password_prompt " | ||
| + | |||
| + | set terminal_length_command " | ||
| + | set enable_command " | ||
| + | set disable_command " | ||
| + | set quit_command " | ||
| + | set show_running_config_command "show running-config" | ||
| + | set show_ip_bgp_summary "show ip bgp summary" | ||
| + | |||
| + | set timeout 10 | ||
| + | |||
| + | set telnet / | ||
| + | |||
| + | spawn " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | #send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect " | ||
| + | send " | ||
| + | |||
| + | expect eof | ||
| + | puts " | ||
| + | |||
| + | exit 0 | ||
| + | |||
| + | </ | ||
start/supervision/check_mk/quagga.1356705645.txt.gz · Dernière modification : 2012/12/28 15:40 de domi
