moved nodequery common code to monitor/query.py
[monitor.git] / monitor / scanapi.py
index 22e3e74..119f7fd 100644 (file)
@@ -239,6 +239,7 @@ class ScanNodeInternal(ScanInterface):
                                        echo '  "bootcd_version":"'`cat /mnt/cdrom/bootme/ID`'",'
                                        echo '  "nm_status":"'`ps ax | grep nm.py | grep -v grep`'",'
                                        echo '  "dns_status":"'`host boot.planet-lab.org 2>&1`'",'
+                                       echo '  "iptables_status":"'`iptables -t mangle -nL | awk '$1~/^[A-Z]+$/ {modules[$1]=1;}END{for (k in modules) {if (k) printf "%s ",k;}}'`'",'
                                        echo '  "princeton_comon_dir":"'`ls -d /vservers/princeton_comon`'",'
                                        echo '  "uptime":"'`cat /proc/uptime`'",'
 
@@ -277,7 +278,7 @@ EOF                 """)
 
                        continue_slice_check = True
                        oval = values['princeton_comon_dir']
-                       if "princeton_comon_dir" in oval:
+                       if "princeton_comon" in oval:
                                values['princeton_comon_dir'] = True
                        else:
                                values['princeton_comon_dir'] = False
@@ -384,6 +385,11 @@ EOF                        """)
                                values['observed_status'] = 'DOWN'
                                values['firewall'] = True
 
+                       #if   values['port_status']['22']  == "open" and \
+                       #        values['port_status']['80']  == "closed" and \
+                       #        values['port_status']['806'] == "open" :
+                       #       email_exception("%s port 80 blocked" % nodename, "possible VSERVER ref blocked")
+
                #if not values['external_dns_status']:
                #       email_exception("%s DNS down" % nodename)