-# NOTE: add the default xml stuff if it's not already in the default xml config.
-if ! grep '<category id="plc_monitor">' /etc/planetlab/default_config.xml ; then
- sed -i 's|<category id="plc_net">| <category id="plc_monitor">\n <name>Monitor Service Configuration</name>\n <description>Monitor</description>\n <variablelist>\n <variable id="enabled" type="boolean">\n <name>Enabled</name>\n <value>true</value>\n <description>Enable on this machine.</description>\n </variable>\n <variable id="email">\n <value></value>\n </variable>\n <variable id="dbpassword">\n <value></value>\n </variable>\n <variable id="host" type="hostname">\n <name>Hostname</name>\n <value>pl-virtual-06.cs.princeton.edu</value>\n <description>The fully qualified hostname.</description>\n </variable>\n <variable id="ip" type="ip">\n <name>IP Address</name>\n <value/>\n <description>The IP address of the monitor server.</description>\n </variable>\n </variablelist>\n </category>\n <category id="plc_net">|' /etc/planetlab/default_config.xml
+
+# NOTE: enable monitor by default, since we're installing it.
+if ! plc-config --category plc_monitor --variable enabled ; then
+ plc-config --category plc_monitor --variable enabled --value true \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+fi
+if ! plc-config --category plc_monitor --variable from_email ; then
+ plc-config --category plc_monitor --variable from_email --value monitor@localhost.localdomain \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+fi
+if ! plc-config --category plc_monitor --variable cc_email ; then
+ plc-config --category plc_monitor --variable cc_email --value monitor@localhost.localdomain \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+fi
+if ! plc-config --category plc_monitor --variable rt_queue ; then
+ plc-config --category plc_monitor --variable rt_queue --value support \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml