Changeset 1077
- Timestamp:
- 11/03/06 12:40:18 (7 years ago)
- File:
-
- 1 edited
-
ccsd/private/modules/ccs_monitor_rurallink.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ccsd/private/modules/ccs_monitor_rurallink.py
r1074 r1077 80 80 # How often (seconds) to phone home 81 81 PHONE_HOME_INTERVAL = 60 * 30 82 83 # How often to check that our upstream connection is working 84 UPSTREAM_CHECK_INTERVAL = 60 82 85 83 86 # Default XMLRPC server to phone home to … … 2968 2971 except: 2969 2972 log_error("Exception while trying to phone home!", sys.exc_info()) 2973 2974 @registerRecurring(UPSTREAM_CHECK_INTERVAL) 2975 def checkUpstream(): 2976 global int_ifname, backhaul_ifname, ext_ifname, backhaul_vbase 2977 global rl_isptype 2978 2979 if not isMasterNode(): 2980 # Check that the backhaul is up 2981 ifaces = {} 2982 for i in getInterfaces(True): ifaces[i["name"]] = i 2983 if backhaul_ifname not in ifaces.keys(): 2984 if checkClientInterfaces(): 2985 needsUp = True 2986 else: 2987 if not ifaces[backhaul_ifname]["up"]: 2988 needsUp = True 2989 if needsUp: 2990 log_info("Attempting to bring backhaul interface up") 2991 log_command("/sbin/ifdown %s 2>&1" % backhaul_ifname) 2992 log_command("/sbin/ifup %s 2>&1" % backhaul_ifname) 2993 return 2994 2995 # Check the various internet connection options are connected 2996 gwstatus, gwtext, ispstatus, isptext, ispaction = getISPStatus() 2997 if ispstatus != "ok" or gwstatus == "critical": 2998 # Attempt to reconnect the ISP 2999 log_info("Attempting to reconnect to the ISP") 3000 ISPDisconnect() 3001 ISPConnect() 2970 3002 2971 3003 ##############################################################################
Note: See TracChangeset
for help on using the changeset viewer.
