Log restart messages using new JSON framework

Fixes ripe-atlas-software-probe#15
This commit is contained in:
Michel Stam
2022-07-28 15:08:00 +02:00
committed by Guy Meyer
parent 71a4ff0e68
commit 974cf92500
2 changed files with 11 additions and 5 deletions
+9 -3
View File
@@ -20,6 +20,12 @@ fi
. $BIN_DIR/common.sh
source $ATLAS_BASE/bin/support.lib.sh
source $ATLAS_BASE/bin/class.lib.sh
source $ATLAS_BASE/bin/array.lib.sh
source $ATLAS_BASE/bin/json.lib.sh
source $ATLAS_BASE/bin/atlas_log.lib.sh
# config variables
if [ $(config_lookup RXTXRPT no) = yes ]
then
@@ -317,7 +323,7 @@ do
else
echo restarting perd
start_perd
echo "RESULT 9801 perd died (restarted)" >> $DATA_NEW_DIR/simpleping
atlas_log 9811 'perd' 'perd died (restarted)'
fi
# Check if eperd is still running
if check_pid $(cat $RUN_DIR/perd-7.pid.vol)
@@ -326,7 +332,7 @@ do
else
echo restarting eperd
start_eperd
echo "RESULT 9807 eperd died (restarted)" >> $DATA_NEW_DIR/simpleping
atlas_log 9817 'eperd' 'eperd died (restarted)'
fi
# Check if eooqd is still running
if check_pid $(cat $RUN_DIR/eooqd.pid.vol)
@@ -335,7 +341,7 @@ do
else
echo restarting eooqd
start_eooqd
echo "RESULT 9809 eooqd died (restarted)" >> $DATA_NEW_DIR/simpleping
atlas_log 9819 'eooqd' 'eooqd died (restarted)'
fi
sync
+2 -2
View File
@@ -77,7 +77,7 @@ _atlas_log_failed_command()
fi
${encoder} set 'fw' integer "${_atlas_log_application_version}"
${encoder} set 'cmd' string "${cmd}"
${encoder} set 'cmd' string "${cmd//\"/\\\"}"
return 0
}
@@ -144,7 +144,7 @@ atlas_log_compose()
new json encoder
${encoder} set 'id' integer "${id}"
${encoder} set 'id' string "${id}"
${encoder} set 'time' integer $(epoch)
${handler} ${encoder} "${@}"