#!/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; } $devices_polled = 0; $device_query = mysql_query("SELECT * FROM `devices` WHERE status = '1' $where ORDER BY device_id DESC"); while ($device = mysql_fetch_array($device_query)) { echo($device['hostname'] ."\n"); ## Discover Interfaces include("includes/discovery/interfaces.php"); ## Discover IPv4 Addresses include("includes/discovery/ipaddresses.php"); ## Discovery IPv6 Addresses include("includes/discovery/ipv6-addresses.php"); ## Discover Temperatures include("includes/discovery/temperatures.php"); if($device['os'] == "Linux" || $device['os'] == "FreeBSD") { include("includes/discovery/storage.php"); } if($device['os'] == "Netscreen") { } if($device['os'] == "IOS" || $device['os'] == "IOS XE") { include("includes/discovery/cisco-vlans.php"); include("includes/discovery/cisco-physical.php"); include("includes/discovery/bgp-peers.php"); include("includes/discovery/cisco-pw.php"); include("includes/discovery/cisco-vrf.php"); } echo("\n"); $devices_polled++; } $end = utime(); $run = $end - $start; $proctime = substr($run, 0, 5); echo("$devices_polled devices polled in $proctime secs\n"); ?>