andrijapanicsb commented on a change in pull request #3575: [WIP DO NOT MERGE] Health check feature for virtual router URL: https://github.com/apache/cloudstack/pull/3575#discussion_r367130118
########## File path: systemvm/debian/root/health_checks/gateways_check.py ########## @@ -0,0 +1,57 @@ +#!/usr/bin/python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from os import sys, path +from subprocess import * +from utility import getHealthChecksData + + +def main(): + gws = getHealthChecksData("gateways") + if gws is None and len(gws) == 0: + print "No gateways data available, skipping" + exit(0) + + unreachableGateWays = [] + gwsList = gws[0]["gatewaysIps"].strip().split(' ') + for gw in gwsList: + if len(gw) == 0: + continue + reachableGw = False + for i in range(5): + pingCmd = "ping " + gw + " -c 5 -w 10" Review comment: seems that this "-w 10" or "-W x" doesn't work - pinging unreachable gateway with "-w 10" or "-w 5" takes 20-23sec both cases. Even a single ping packet (-c 1) takes 20sec Thus the check takes an awful long time. i.e. root@r-6-VM:~# time ping 1.1.1.1 -c 1 -w 2 PING 1.1.1.1 (1.1.1.1): 56 data bytes 92 bytes from 1.1.1.2: Destination Host Unreachable --- 1.1.1.1 ping statistics --- 1 packets transmitted, 0 packets received, 100% packet loss real 0m20.498s user 0m0.000s sys 0m0.000s ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
