anuragaw 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_r358922246
########## File path: systemvm/debian/opt/cloud/bin/getRouterMonitorResults.sh ########## @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# 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. + +# getRouterMonitorResults.sh --- Send the monitor results to Management Server + +if [ "$1" == "true" ] +then + python /root/monitorServices.py > /dev/null +fi + +if [ -f /root/failing_health_checks ] +then + printf "FAILING CHECKS:\n" + echo `cat /root/failing_health_checks` +fi + +printf "MONITOR RESULTS:\n" +echo "{\"basic\":" +if [ -f /root/basic_monitor_results.json ] +then + echo `cat /root/basic_monitor_results.json` +else + echo "{}" +fi +echo ",\"advance\":" +if [ -f /root/advance_monitor_results.json ] +then + echo `cat /root/advance_monitor_results.json` +else + echo "{}" +fi Review comment: Yes, that's correct. The Health checks are scheduled on the VR and is self contained. Health checks are executed at admin defined intervals and kept in files within the VR. This script fetches the results of the last run. The checks can be run on demand with fresh checks by getRouterHealthCheckResults and performFreshRun=true. Which first updates the health check config, then runs the checks, and finally prints the most recent results. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services