unify the model by which probes are made to collect information about nodes or
[monitor.git] / nodecommon.py
index 9551a4a..051cd61 100644 (file)
@@ -1,7 +1,7 @@
 
 import time
 import struct
-from monitor.pcu import reboot
+from pcucontrol import reboot
 
 from monitor import util
 from monitor import database
@@ -122,6 +122,20 @@ def getvalue(fb, path):
             return None
     return values
 
+def nmap_port_status(status):
+       ps = {}
+       l_nmap = status.split()
+       ports = l_nmap[4:]
+
+       continue_probe = False
+       for port in ports:
+               results = port.split('/')
+               ps[results[0]] = results[1]
+               if results[1] == "open":
+                       continue_probe = True
+       return (ps, continue_probe)
+
+
 def nodegroup_display(node, fbdata, conf=None):
        node['current'] = get_current_state(fbdata)