Added monitor_rapi.sh to /home/rhizomatica/bin/
This commit is contained in:
parent
efeb99cb52
commit
c939e6a841
1 changed files with 16 additions and 0 deletions
16
modules/rhizomatica_base_system/files/bin/monitor_rapi.sh
Executable file
16
modules/rhizomatica_base_system/files/bin/monitor_rapi.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOGFILE="/var/log/monitor_rapi.log"
|
||||
|
||||
function logc() {
|
||||
txt=$1
|
||||
echo "[`date '+%d-%m-%Y %H:%M:%S'`] $txt" >> $LOGFILE
|
||||
}
|
||||
|
||||
curl --connect-timeout 180 --max-time 180 -X GET http://localhost:8085/configuration/site 2>/dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
logc "RAPI is not responding kill the process"
|
||||
PID=`ps axf | grep rapi | grep python | awk '{print $1}'`
|
||||
kill -9 $PID
|
||||
logc "RAPI restarted"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue