8 # NOTE: we should only need to do this once. Every restart will inherit the
9 # last retention file after restarting.
11 function block_until_hour ()
14 last_hour=$(( $d - $d % (60 * 60 ) ))
15 next_hour=$(( $last_hour + 60*60 ))
16 while [ $next_hour -gt `date +%s` ] ; do
22 cp /usr/share/monitor/nagios/retention.dat /var/log/nagios/retention.dat
24 echo "Restoring complete retention.dat"
25 echo "START time nodes start"
27 cp /var/log/nagios/retention.dat /tmp/retention.dat
28 /usr/share/monitor/nagios/filter_nagios_retention.py 7 1280 /tmp/retention.dat > /var/log/nagios/retention.dat
32 echo "Generating plcnodes with $T min intervals & $N nodes"
33 ./plc_test_hosts.py $T $N > /etc/nagios/objects/plcnodes.cfg
34 echo "Sleeping before starting nagios"
37 echo "START $T $N" $D $(( $D + 60*60 )) >> stimes.txt
46 cp /etc/nagios/objects/plc.cfg /etc/nagios/objects/plcnodes.cfg