#!/usr/bin/php Poll single device\n"); echo("--os Poll all devices of a given OS\n"); echo("--all Poll all devices\n\n"); echo("No polling type specified!\n"); exit; } if ($argv[2] == "--type" && $argv[3]) { $type = $argv[3]; } elseif ($argv[3] == "--type" && $argv[4]) { $type = $argv[4]; } else { echo("Require valid discovery type.\n"); exit; } $devices_polled = 0; echo("includes/discovery/".$type.".php \n"); #$debug = 1; $device_query = mysql_query("SELECT * FROM `devices` WHERE status = '1' $where ORDER BY device_id ASC"); while ($device = mysql_fetch_array($device_query)) { echo($device['hostname'] . "(".$device['sysName']."|".$device['device_id'].")\n"); if($config['os'][$device['os']]['group']) {$device['os_group'] = $config['os'][$device['os']]['group']; echo "(".$device['os_group'].")";} include("includes/discovery/".$type); echo("\n"); $devices_polled++; } $end = utime(); $run = $end - $start; $proctime = substr($run, 0, 5); echo("$devices_polled devices polled in $proctime secs\n $mysql SQL"); ?>