--- /dev/null
+#!/bin/bash
+
+cd /usr/share/monitor
+source agent.sh &> /dev/null
+
+rsync -qv -az -e ssh root@chloe.cs.princeton.edu:/vservers/www-current/var/log/httpd/*-* /var/lib/monitor/httpd-log
+rsync -qv -az -e ssh root@chloe.cs.princeton.edu:/vservers/www-current/var/log/httpd/*error* /var/lib/monitor/httpd-log
+
+rsync -qv -az -e ssh root@chloe.cs.princeton.edu:/vservers/www-current/var/log/*-filesystem* /var/lib/monitor/filesystem
+rsync -qv -az -e ssh root@chloe.cs.princeton.edu:/vservers/www-current/var/log/*-checkrpm* /var/lib/monitor/checkrpm
+
+rsync -qv -az -e ssh root@amber.cs.princeton.edu:/vservers/db-current/var/log/*-filesystem* /var/lib/monitor/filesystem
+rsync -qv -az -e ssh root@amber.cs.princeton.edu:/vservers/db-current/var/log/*-checkrpm* /var/lib/monitor/checkrpm
+
+rsync -qv -az -e ssh root@janine.cs.princeton.edu:/vservers/boot-current/var/log/*-filesystem* /var/lib/monitor/filesystem
+rsync -qv -az -e ssh root@janine.cs.princeton.edu:/vservers/boot-current/var/log/*-checkrpm* /var/lib/monitor/checkrpm
--- /dev/null
+#!/usr/bin/python
+
+from monitor.wrapper import plc
+import os
+
+api = plc.api
+
+HOSTS_FILE="/etc/hosts"
+
+def is_in_file(filename, pattern):
+ f = os.popen("grep %s %s" % ( pattern, filename))
+ content = f.read()
+ if len(content) > 0:
+ return True
+ else:
+ return False
+def add_to_file(filename, data):
+ os.system("echo '%s' >> %s" % (data, filename))
+ print "echo '%s' >> %s" % (data, filename)
+
+sites = api.GetSites({'login_base' : 'mlab*'}, ['node_ids'])
+for s in sites:
+ nodes = api.GetNodes(s['node_ids'], ['hostname', 'interface_ids'])
+ for node in nodes:
+ try:
+ i = api.GetInterfaces({ 'interface_id' : node['interface_ids'], 'is_primary' : True})
+ print len(i), i
+ print "%s %s" % (i[0]['ip'], node['hostname'])
+ #if not is_in_file(HOSTS_FILE, node['hostname']):
+ # add_to_file(HOSTS_FILE, "%s %s" % (i[0]['ip'], node['hostname']))
+ except:
+ pass