#!/usr/bin/python
-import soltesz
-import plc
+import database
class NagiosObject(object):
trans = {'d2_coords': '2d_coords'}
for obj in globalhost + globalservices:
print obj.toString()
-plcdb = soltesz.dbLoad("l_plcsites")
-netid2ip = soltesz.dbLoad("plcdb_netid2ip")
-lb2hn = soltesz.dbLoad("plcdb_lb2hn")
+plcdb = database.dbLoad("l_plcsites")
+netid2ip = database.dbLoad("plcdb_netid2ip")
+lb2hn = database.dbLoad("plcdb_lb2hn")
for site in plcdb:
shortname = site['abbreviated_name']
lat_y = int(180 - (lat + 90)) * scale
if site['login_base'] in lb2hn:
- nodes = lb2hn[site['login_base']] # plc.getSiteNodes2(site['login_base'])
+ nodes = lb2hn[site['login_base']]
else:
continue
for node in nodes:
hn = node['hostname']
- if len(node['nodenetwork_ids']) == 0:
+ if len(node['interface_ids']) == 0:
continue
- ip = netid2ip[node['nodenetwork_ids'][0]]
+ ip = netid2ip[node['interface_ids'][0]]
if lon_x is not -1 and lat_y is not -1:
coords="%s,%s" % (lon_x, lat_y)