1234567891011121314151617181920212223242526272829303132333435 |
- #!/usr/bin/env bash
- cat << 'LOGO'
- ###############################################################
- PrometheusAlert重启脚本
- ###############################################################
- LOGO
- base_dir=$(
- cd "$(dirname "$0")"
- pwd
- )
- cd $base_dir
- # extra function
- ## func of log
- function log_warn() {
- local date=$(date "+%Y-%m-%d-%H:%M:%S")
- local para=$1
- echo "[WARN] PrometheusAlert $date $1"
- }
- function log_info() {
- local date=$(date "+%Y-%m-%d-%H:%M:%S")
- local para=$1
- echo "[INFO] PrometheusAlert $date $1"
- }
- function log_err() {
- local date=$(date "+%Y-%m-%d-%H:%M:%S")
- local para=$1
- echo -e "[ERROR] PrometheusAlert $date $1"
- }
- ./stop.sh no_logo "$@" && ./run.sh no_logo
- log_info "PrometheusAlert服务重启结束"
|