ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 06 c2 00 00 03 b2 08 06 00 00 00 c9 9e c0 | .PNG........IHDR................ |
0020 | 2e 00 00 20 00 49 44 41 54 78 01 ec dd 07 7c 15 d7 99 f0 ff 9f 74 af ee bd ea bd 77 54 10 ea 85 | .....IDATx....|......t.....wT... |
0040 | 26 09 d1 31 60 53 45 b1 8d 1d c7 71 92 8d f9 67 9d 6c 76 93 6c de 4d 36 e5 4d d9 c4 d9 94 77 37 | &..1`SE....q...g.lv.l.M6.M....w7 |
0060 | 9b 38 b1 53 8c d7 15 0c 8e c1 98 6e 8c 10 4d 12 20 21 9a 00 21 21 a1 de af fa 6d ff cf 8c 0a 12 | .8.S.......n..M..!..!!....m..... |
0080 | 06 24 30 b6 c1 7e c6 1f 71 a7 9c 39 e7 cc f7 ce c8 9a 79 e6 9c 63 07 d8 b8 c9 b4 66 cd 9a 9b 6c | .$0..~..q..9......y..c.....f...l |
00a0 | 91 d5 22 20 02 22 20 02 22 20 02 22 20 02 22 f0 d1 0b 6c dc b8 91 b6 b6 b6 8f be 20 29 41 04 44 | .."..".."..".."...l.........)A.D |
00c0 | 40 04 44 e0 b6 05 3c 3c 3c 90 e7 06 b7 cd 26 3b 88 80 08 88 80 08 88 80 08 88 80 08 dc 45 01 e5 | @.D...<<<.....&;.............E.. |
00e0 | b9 c1 58 93 fd 58 09 64 bb 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 | ..X..X.d........................ |
0100 | 80 08 88 80 08 88 80 08 88 80 08 88 80 08 dc 8f 02 12 08 bb 1f bf 35 a9 b3 08 88 80 08 88 80 08 | ......................5......... |
0120 | 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 80 08 88 c0 98 02 da | ................................ |
0140 | 31 53 48 02 11 10 01 11 10 01 11 10 01 11 10 01 11 f8 04 05 94 ae b7 64 12 01 11 10 01 11 10 01 | 1SH....................d........ |
0160 | 11 10 01 11 10 01 11 10 01 11 10 01 11 10 81 3b 11 f8 d0 81 30 83 01 62 63 5d 81 48 a0 9e ea ea | ...............;....0..bc].H.... |
0180 | 7a 5a 5a ee a4 2a 1f cd 3e 76 93 26 31 d1 76 96 73 e7 3e 9a fc ef bb 5c 0d 06 5c 62 03 f1 68 b9 | zZZ..*..>v.&1.v.s.>....\..\b..h. |
01a0 | 4c 75 f5 7d 57 7b a9 b0 08 88 80 08 88 80 08 88 c0 67 4c 40 c6 9e f9 8c 7d e1 72 b8 22 20 02 22 | Lu.}W{...........gL@....}.r.".." |
01c0 | 20 02 22 20 02 22 20 02 22 20 02 22 20 02 22 70 97 05 3e 54 20 2c 33 73 0a 59 59 ce 04 06 4e 05 | .."..".."..".."p..>T.,3s.YY...N. |
01e0 | fc 80 36 9a 9b 4f 52 54 d4 c8 c1 83 a7 e8 ee ee be cb d5 bd fd ec d2 a2 57 b3 d8 fa 63 7e 7a 0e | ..6..ORT................W...c~z. |
0200 | bc bc bc c8 89 71 a5 ea 4a 25 c7 6b 6f 3f af 9b ed 61 67 67 c7 8c a9 29 f8 77 9e 64 d3 e9 9b a5 | .....q..J%.ko?...agg...).w.d.... |
0220 | ba 37 d6 3b ea dc 99 3b 71 01 8e 15 7f e2 75 09 84 dd 1b 5f 8a d4 42 04 44 40 04 44 40 04 44 40 | .7.;...;q.....u...._..B.D@.D@.D@ |
0240 | 04 44 40 04 44 40 04 44 40 04 44 40 04 44 40 04 44 40 04 44 40 04 44 e0 23 11 b8 e3 40 d8 b4 69 | .D@.D@.D@.D@.D@.D@.D@.D.#...@..i |
0260 | d3 58 b7 ee 31 fc fd f5 80 a7 5a b9 8a 0a 2b ed ed 0d cc 9b e7 8a a3 63 16 db b7 bf 8f c9 64 1a | .X..1.....Z...+........c......d. |
0280 | b3 e2 6e 6e 21 2c 4c 5f 8e b1 7a 27 3b 2e 5e 1c 33 fd ed 24 08 46 f9 6f 60 72 72 72 c2 3d cc 93 | ..nn!,L_..z';.^.3..$.F.o`rrr.=.. |
02a0 | ca b6 4a b8 c3 40 98 bf 7f 0a 93 26 f9 50 56 b6#!/bin/bash
# ============LICENSE_START=======================================================
# ONAP
# ================================================================================
# Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed 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.
# ============LICENSE_END=========================================================
source ${POLICY_HOME}/etc/profile.d/env.sh
function usage() {
echo -n "syntax: $(basename $0) "
echo "[--debug]"
}
function log() {
echo "$(date +"%Y-%m-%d_%H-%M-%S") $1" >> ${POLICY_HOME}/logs/monitor.log
}
function monitor() {
if [[ $DEBUG == y ]]; then
echo "-- ${FUNCNAME[0]} --"
set -x
fi
CONTROLLER=$1
STATUS=$2
if [[ -z ${CONTROLLER} ]]; then
log "WARNING: invalid invocation: no component provided"
return
fi
if [[ -z ${STATUS} ]]; then
log "WARNING: invalid invocation: no on/off/uninstalled switch provided for ${CONTROLLER}"
return
fi
if [[ "${STATUS}" == "off" ]]; then
off ${CONTROLLER}
else
if [[ "${STATUS}" == "on" ]]; then
on ${CONTROLLER}
fi
fi
}
function on() {
if [[ $DEBUG == y ]]; then
echo "-- ${FUNCNAME[0]} --"
set -x
fi
CONTROLLER=$1
${POLICY_HOME}/bin/${CONTROLLER} status
if [[ $? != 0 ]]; then
log "starting ${CONTROLLER}"
# need to make sure we don't pass the lock file descriptor
${POLICY_HOME}/bin/${CONTROLLER} umstart {cfg}>&-
else
log "OK: ${CONTROLLER} (UP)"
fi
}
function off() {
if [[ $DEBUG == y ]]; then
echo "-- ${FUNCNAME[0]} --"
set -x
fi
CONTROLLER=$1
${POLICY_HOME}/bin/${CONTROLLER} status
if [[ $? != 0 ]]; then
log "OK: ${CONTROLLER} (DOWN)"
else
log "stopping ${CONTROLLER}"
${POLICY_HOME}/bin/${CONTROLLER} umstop
fi
}
function process_config() {
if [[ $DEBUG == y ]]; then
echo "-- ${FUNCNAME[0]} --"
set -x
fi
CONF_FILE=${POLICY_HOME}/etc/monitor/monitor.cfg
while read line || [ -n "${line}" ]; do
if [[ -n ${line} ]] && [[ ${line} != *#* ]]; then
controller=$(echo "${line}" | awk -F = '{print $1;}')
status=$(echo "${line}" | awk -F = '{print $2;}')
if [[ -n ${controller} ]] && [[ -n ${status} ]]; then
monitor ${controller} ${status}
fi
fi
done < "${CONF_FILE}"
return 0
}
log "Enter monitor"
DEBUG=n
until [[ -z "$1" ]]; do
case $1 in
-d|--debug|debug) DEBUG=y
set -x
;;
*) usage
exit 1
;;
esac
shift
done
if pidof -o %PPID -x $(basename $0) > /dev/null 2>&1; then
log "WARNING: $(basename $0) from the previous iteration still running. Exiting."
exit 1
fi
. ${POLICY_HOME}/etc/profile.d/env.sh
if flock ${cfg} ; then
process_config
fi {cfg}>>${POLICY_HOME}/etc/monitor/monitor.cfg.lock
|