#!/usr/bin/env python # -*- coding: utf-8 -*- info['owner'] = 'munin' info['group'] = 'adm' include("ldap_conn") import annuaires_pg out(""" Weathermap du réseau Cr@ns 0 1 1 3 3 6 6 9 9 12 12 15 15 18 18 21 21 23 23 25 25 40 40 55 55 70 70 85 85 100 100 999 """) # On genere les noeud bat par bat out(""" """) # On recupere le nom du node dans l'annuaire bat_to_prise = {v:k for k, v in annuaires_pg.uplink_prises['backbone'].items()} #Batiment A out(""" """ % (bat_to_prise['bata'],bat_to_prise['bata'])) # Bat B out(""" """ % (bat_to_prise['batb'],bat_to_prise['batb'])) # Bat G out(""" """ % (bat_to_prise['batg'],bat_to_prise['batg'])) # Bat o out(""" """ % (bat_to_prise['bato'],bat_to_prise['bato'])) # Bat K out(""" """ % (bat_to_prise['batk'],bat_to_prise['batk'])) # Bat M out(""" """ % (bat_to_prise['batm'],bat_to_prise['batm'])) # Bat C out(""" """ % (bat_to_prise['batc'],bat_to_prise['batc'])) # Bat h out(""" """ % (bat_to_prise['bath'],bat_to_prise['bath'])) # Bat i out(""" """ % (bat_to_prise['bati'],bat_to_prise['bati'])) # Bat j out(""" """ % (bat_to_prise['batj'],bat_to_prise['batj'])) out(""" """) # On genere les liens bat par bat avec le backbone for prise in annuaires_pg.uplink_prises['backbone']: bat = annuaires_pg.uplink_prises['backbone'][prise] offset = 0 if "B" in prise: offset = 24 interface = offset + int(prise[1:]) if "bat" in bat: out(""" """ % (bat,)) out(""" node_backbone_%s""" % (prise,)) out(""" node_%s """ % (bat,)) out(""" """ % (interface,)) out(""" 1000000 """ % (interface,)) out(""" node_bato node_batp 1000000 1Gbit/s """)