author | Tero Marttila <terom@fixme.fi> |
Tue, 25 Jan 2011 01:19:40 +0200 | |
changeset 31 | cd9ca8068b09 |
parent 6 | 36b9aa4a7697 |
permissions | -rw-r--r-- |
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
from mrtg import * |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
|
5
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
3 |
# port = 1xx |
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
class Sw3com3300 (Host) : |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
def port (self, port_name, mbps, port) : |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
return super(Sw3com3300, self).port(port_name, mbps, port=port+100, port_title="#%d" % port) |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
|
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
# switches |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
armo = Sw3com3300('armo', 'armo.switches.pvl', 'geuGo6eecu') |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
kt_aula = Host('aula.kivitalo', 'aula.kivitalo.switches.pvl', 'chooyaizoizeimoi') |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
kt_atk = Host('atk-luokka.kivitalo', 'atk-luokka.kivitalo.switches.pvl', 'voichahphahqueej') |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
vt_atk = Host('atk-luokka.veturi', 'atk-luokka.veturi.switches.pvl', 'kuegenohthoogeex') |
6 | 13 |
puffy = Host('puffy', 'puffy.paivola.fi', 'public') |
14 |
||
15 |
wl_kt_tyttojensiipi = Host('tyttojensiipi.kivitalo', 'tyttojensiipi.kivitalo.wlan.pvl', 'qF7r6ubIOpOItK0t') |
|
16 |
||
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
|
5
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
18 |
# XXX: add missing hosts |
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
|
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
targets = [ |
5
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
21 |
armo.port('ranssila', 100, 17), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
22 |
armo.port('wlan', 100, 18), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
23 |
armo.port('jeriko', 100, 19), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
24 |
armo.port('olohuone', 100, 20), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
25 |
armo.port('puffy', 100, 21), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
26 |
armo.port('veturi-backup', 10, 22), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
27 |
armo.port('ranssi', 100, 23), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
28 |
armo.port('ylakerta', 100, 24), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
29 |
armo.port('atk-luokka', 1000, 25), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
30 |
armo.port('aula', 1000, 26), |
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
|
5
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
32 |
kt_aula.port('ranssi', 1000, 25), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
33 |
kt_aula.port('armo', 1000, 26), |
e716718482c3
hack hack hack some HTML output
Tero Marttila <terom@fixme.fi>
parents:
4
diff
changeset
|
34 |
kt_aula.port('kellari', 100, 27), |
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
35 |
|
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
36 |
kt_atk.port('luokka', 100, 17), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
37 |
kt_atk.port('atk-luokka.veturi', 1000, 25), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
38 |
kt_atk.port('armo', 1000, 26), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
39 |
|
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
vt_atk.port('auditorio', 100, 20), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
vt_atk.port('wlan', 100, 23), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
42 |
vt_atk.port('ilari', 100, 24), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
43 |
vt_atk.port('atk-luokka.kivitalo', 1000, 25), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
44 |
vt_atk.port('severi', 10, 27), |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
45 |
vt_atk.port('asuntola1', 10, 28), |
6 | 46 |
|
47 |
puffy.port('lan', 100, desc='re0'), |
|
48 |
puffy.port('wan', 100, desc='re1'), |
|
49 |
||
50 |
wl_kt_tyttojensiipi.port('lan', 100, desc='eth0.1'), |
|
51 |
wl_kt_tyttojensiipi.port('wlan', 54, desc='wl0'), |
|
4
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
52 |
] |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
53 |
|
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
54 |
if __name__ == '__main__' : |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
55 |
write_cfg("etc/mrtg-hosts.conf", targets) |
8cd81ed8fadd
MRTG target definitions for pvl switches
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
56 |