4 die("Usage: $argv[0] host1 host2 host3...\n");
7 if (!mysql_connect('localhost', 'monitor', 'monitor'))
8 die("Failed to connect to mysql: " . mysql_error());
9 mysql_select_db('monitor_reports');
11 function dt_verify($host) {
13 $query = "SELECT * FROM report_data " .
14 "WHERE host_name = '$host' AND " .
15 "(event_type = 1103 OR event_type = 1104) ORDER BY id";
17 $result = mysql_query($query);
20 die("mysql_query() failed: " . mysql_error());
22 while ($row = mysql_fetch_array($result)) {
23 switch ($row['event_type']) {
25 $start = $row['timestamp'];
26 echo " START: ($start) " . date("Y-m-d H:i:s", $start) . "\n";
29 $stop = $row['timestamp'];
30 $duration = $stop - $start;
31 echo " STOP: ($stop) " . date("Y-m-d H:i:s", $stop) . " duration=$duration\n";
39 for ($i = 1; $i < $argc; $i++
) {