X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fcollect%2Fclient%2Fbootstrap.sh;fp=web%2Fcollect%2Fclient%2Fbootstrap.sh;h=d62be33bc22af14f978c6f08d9ee559debc461da;hp=50af68ea5a8099044315324dc3b96eeae3981f28;hb=bccc4741c3264bc2d8c47c7ab06eb691fb3a8582;hpb=9bb5213371c2a3075adaed95d0e1e6ef5a58e7d6 diff --git a/web/collect/client/bootstrap.sh b/web/collect/client/bootstrap.sh index 50af68e..d62be33 100644 --- a/web/collect/client/bootstrap.sh +++ b/web/collect/client/bootstrap.sh @@ -4,7 +4,10 @@ if [[ -f /etc/planetlab/node_id ]] ; then V=`cat /etc/planetlab/node_id` else - V=$RANDOM + if [[ ! -f ./node_id ]] ; then + echo $RANDOM > ./node_id + fi + V=`cat node_id` fi if [[ -f /etc/planetlab/plc_config ]] ; then @@ -15,17 +18,19 @@ fi min=$(( $V % 60 )) min2=$(( ($min + 10) % 60 )) +min3=$(( ($min + 20) % 60 )) # Run every three hours using a fixed point in time. cat < collect_and_upload.cron PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/home/${PLC_SLICE_PREFIX}_myops/ $min */1 * * * /home/${PLC_SLICE_PREFIX}_myops/collect.sh $min2 */1 * * * /home/${PLC_SLICE_PREFIX}_myops/upload.sh +$min3 */1 * * * /home/${PLC_SLICE_PREFIX}_myops/update.sh EOF yum install -y lshw chmod 755 /home/${PLC_SLICE_PREFIX}_myops/collect.sh chmod 755 /home/${PLC_SLICE_PREFIX}_myops/upload.sh +chmod 755 /home/${PLC_SLICE_PREFIX}_myops/update.sh crontab -u root collect_and_upload.cron -