diff --git a/Bundler/weathermap.xml b/Bundler/weathermap.xml new file mode 100644 index 0000000..2479c34 --- /dev/null +++ b/Bundler/weathermap.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Cfg/etc/cron.d/weathermap/info.xml b/Cfg/etc/cron.d/weathermap/info.xml new file mode 100644 index 0000000..50d8d36 --- /dev/null +++ b/Cfg/etc/cron.d/weathermap/info.xml @@ -0,0 +1,3 @@ + + + diff --git a/Cfg/etc/cron.d/weathermap/weathermap b/Cfg/etc/cron.d/weathermap/weathermap new file mode 100644 index 0000000..57c88c5 --- /dev/null +++ b/Cfg/etc/cron.d/weathermap/weathermap @@ -0,0 +1,4 @@ +# !! Beware: fichier géré par bcgfg2 !! +# (module Cfg) Regénère la weathermap chaque minute + +*/1 * * * * root /var/lib/weathermap/weathermap -o /var/www/weathermap/weathermap.svg --config /etc/weathermap/weathermap.xml diff --git a/Cfg/etc/nginx/sites-available/weathermap/info.xml b/Cfg/etc/nginx/sites-available/weathermap/info.xml new file mode 100644 index 0000000..50d8d36 --- /dev/null +++ b/Cfg/etc/nginx/sites-available/weathermap/info.xml @@ -0,0 +1,3 @@ + + + diff --git a/Cfg/etc/nginx/sites-available/weathermap/weathermap b/Cfg/etc/nginx/sites-available/weathermap/weathermap new file mode 100644 index 0000000..78576f1 --- /dev/null +++ b/Cfg/etc/nginx/sites-available/weathermap/weathermap @@ -0,0 +1,12 @@ +# Fichier géré par bcfg2 +# Sites basique pour la weathermap +server { + listen 80; + listen [::]:80; + server_name weathermap.crans.org; + access_log /var/log/nginx/weathermap.log combined; + error_log /var/log/nginx/weathermap_error.log; + root /var/www/weathermap/; + index weathermap.svg; +} + diff --git a/Metadata/groups.xml b/Metadata/groups.xml index 86644f2..6473046 100644 --- a/Metadata/groups.xml +++ b/Metadata/groups.xml @@ -259,6 +259,7 @@ + @@ -1559,6 +1560,11 @@ + + + + + diff --git a/Python/etc/weathermap/weathermap.xml b/Python/etc/weathermap/weathermap.xml new file mode 100644 index 0000000..57f8f71 --- /dev/null +++ b/Python/etc/weathermap/weathermap.xml @@ -0,0 +1,250 @@ +#!/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 + + + + + + + + + +""")