+# SETUP act_all database if it's not there.
+if [ ! -f ${MONITOR_SCRIPT_ROOT}/actallsetup.flag ]; then
+ if ! python -c 'import database; database.dbLoad("act_all")' 2>/dev/null ; then
+ touch ${MONITOR_SCRIPT_ROOT}/actallsetup.flag
+ fi
+fi
+
+
+set +e
+AGENT=`ps ax | grep ssh-agent | grep -v grep`
+set -e
+if [ -z "$AGENT" ] ; then
+ echo "starting ssh agent"
+ # if no agent is running, set it up.
+ ssh-agent > ${MONITOR_SCRIPT_ROOT}/agent.sh
+ source ${MONITOR_SCRIPT_ROOT}/agent.sh
+ ssh-add /etc/planetlab/debug_ssh_key.rsa
+ ssh-add /etc/planetlab/root_ssh_key.rsa
+fi
+#TODO: should add a call to ssh-add -l to check if the keys are loaded or not.
+source ${MONITOR_SCRIPT_ROOT}/agent.sh
+
+