Changeset 7027
- Timestamp:
- Jun 30, 2009, 3:47:11 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/base.cfg ¶
r6637 r7027 1 1 [buildout] 2 2 parts = 3 extras4 3 django 5 4 testrunner … … 7 6 8 7 [versions] 9 djangorecipe=0.15 8 djangorecipe=0.19.1 9 django-extensions=0.4.1 10 10 zc.recipe.egg=1.0.0 11 11 zc.recipe.testrunner=1.0.0 … … 16 16 ${django:eggs} 17 17 extra-paths = 18 ${django:pythonpath}19 18 ${buildout:directory} 20 19 ${django:location} … … 26 25 os.environ['DJANGO_SETTINGS_MODULE'] = 'exodus.development' 27 26 28 [extras]29 recipe = iw.recipe.subversion30 urls =31 http://django-command-extensions.googlecode.com/svn/trunk@178 django-command-extensions32 33 27 [django] 34 28 recipe = djangorecipe 35 version = 1.0 29 version = 1.0.2 36 30 project = exodus 37 31 wsgi = true 38 32 eggs = 39 33 Werkzeug 40 pythonpath = 41 ${extras:location}/django-command-extensions/ 42 34 django-extensions 35 networkx 43 36 [supervisor] 44 37 recipe = zc.recipe.egg -
TabularUnified trunk/exodus/settings.py ¶
r6645 r7027 21 21 # AP subnet size 22 22 AP_NETMASK = 26 23 # Graph for network24 try:25 import networkx as nx26 G = nx.Graph()27 except:28 G = 'no_networkx'29 23 # Master super path, set to current working path 30 24 EXODUS_ROOT = os.path.dirname(__file__) -
TabularUnified trunk/exodus/urls.py ¶
r6645 r7027 1 1 # (c) Roland van Laar 2 2 3 from django.conf.urls.defaults import *4 from exodus.models import *3 from django.conf.urls.defaults import patterns, url 4 #from exodus.models import * 5 5 from django.conf import settings 6 6 from django.views.generic.simple import direct_to_template -
TabularUnified trunk/exodus/views.py ¶
r6645 r7027 9 9 10 10 from exodus.models import Node, Network, Location 11 from exodus.settings import G 11 import networkx as nx 12 12 13 13 # Views … … 42 42 writer.writerow(['name', 'location', 'longitude', 'latitude', 'masterip']) 43 43 for node in nodes: 44 writer.writerow([node.name, node.location.description, node.location.longitude, node.location.latitude, node.masterip]) 45 44 writer.writerow([node.name, node.location.description, 45 node.location.longitude, node.location.latitude, 46 node.masterip]) 46 47 return response 47 48 … … 53 54 54 55 writer = csv.writer(response) 55 writer.writerow(["iface","node","type","ssid","channel","antenna","polar","direction","mode","ip","netmask","linknode", "linkiface"]) 56 writer.writerow(["iface","node","type","ssid","channel","antenna","polar", 57 "direction","mode","ip","netmask","linknode", 58 "linkiface"]) 56 59 for node in nodes: 57 60 for nic in node.interface_set.all(): … … 74 77 75 78 templateFile = version + '/' + file 76 return render_to_response(templateFile, {'node' : node, 'server' : server}, \79 return render_to_response(templateFile, {'node' : node, 'server' : server}, 77 80 mimetype='text/plain') 78 81 79 def viewNagios(request, monitor= 'none'):82 def viewNagios(request, monitor=None): 80 83 nodes = Node.objects.all() 81 84 networks = Network.objects.all() … … 87 90 viewpoint=monitor 88 91 # check if networkx is available 89 if G == 'no_networkx': 90 monitor = 'none' 91 print 'Networkx is not available' 92 G = nx.Graph() 92 93 #only if monitor is set create a graph to work with 93 if monitor != 'none':94 G.clear 94 if monitor: 95 G.clear() 95 96 for node in Node.objects.all(): 96 97 if node.status == 'up': 97 98 G.add_node(node.name) 98 99 for interface in node.interface_set.all(): 99 if interface.mode == 'mn' and interface.link.node.status == 'up': 100 if interface.mode == 'mn' and \ 101 interface.link.node.status == 'up': 100 102 G.add_edge(node.name,interface.link.node.name) 101 103 102 return render_to_response('nagios/exodus.cfg', {'nodes' : nodes, 'networks' : networks, 'locations' : locations, 'viewpoint' : viewpoint}, mimetype='text/plain') 103 104 104 return render_to_response('nagios/exodus.cfg', 105 {'nodes' : nodes, 'networks' : networks, 106 'locations' : locations, 107 'viewpoint' : viewpoint}, 108 mimetype='text/plain')
Note:
See TracChangeset
for help on using the changeset viewer.