log all bash-command line commands and upload them centrally
[monitor.git] / histlog / upload.cron.php
diff --git a/histlog/upload.cron.php b/histlog/upload.cron.php
new file mode 100644 (file)
index 0000000..989b795
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+if (isset($_REQUEST['node_id'])) {
+    # setup the same random times for each distinct node_id by seeding rand()
+    $node_id = intval($_REQUEST['node_id']);
+    srand($node_id);
+}
+$m = rand(0,59);
+$h = rand(0,23);
+echo "# random time on first day of week upload bash logs to monitor\n";
+echo "$m $h * * 0,3,5 root /usr/bin/collect_snoopylog.sh\n";
+?>