fixed errors with includes in scanapi
[monitor.git] / web / MonitorWeb / monitorweb / controllers.py
index a3e3021..f4832ba 100644 (file)
@@ -19,7 +19,7 @@ from monitor.wrapper.plccache import plcdb_lb2hn as site_lb2hn
 
 from monitorweb.templates.links import *
 
-import findbad
+from monitor import scanapi
 
 
 def query_to_dict(query):
@@ -135,8 +135,8 @@ def prep_node_for_display(node):
 
        node.history = HistoryNodeRecord.by_hostname(node.hostname)
 
-       if node.port_status:
-               node.ports = format_ports(node.port_status)
+       node.ports = format_ports(node.port_status)
+
        try:
                exists = node.plc_node_stats['last_contact']
        except:
@@ -251,10 +251,10 @@ class Root(controllers.RootController):
                        flash("Reboot appeared to work.  All at most 5 minutes.  Run ExternalScan to check current status.")
 
                elif action == "ExternalScan":
-                       findbad.externalprobe(str(hostname))
+                       scanapi.externalprobe(str(hostname))
                        flash("External Scan Successful!")
                elif action == "InternalScan":
-                       findbad.probe(str(hostname))
+                       scanapi.internalprobe(str(hostname))
                        flash("Internal Scan Successful!")
                else:
                        # unknown action
@@ -408,7 +408,7 @@ class Root(controllers.RootController):
                session.bind = metadata.bind
                filtercount = {'active' : 0, 'acknowledged': 0, 'all' : 0}
                # With Acknowledgement
-               sql_ack = 'SELECT DISTINCT h.host,t.description,t.priority,t.lastchange,a.message '+ \
+               sql_ack = 'SELECT DISTINCT h.host,t.description,t.priority,t.lastchange,a.message,e.eventid '+ \
               ' FROM triggers t,hosts h,items i,functions f, hosts_groups hg,escalations e,acknowledges a ' + \
               ' WHERE f.itemid=i.itemid ' + \
                   ' AND h.hostid=i.hostid ' + \