diff --git a/discovery.php b/discovery.php
index e5b012bc98..9558f5dd3c 100755
--- a/discovery.php
+++ b/discovery.php
@@ -20,6 +20,12 @@ if($argv[1] == "--device" && $argv[2]) {
$where = "AND MOD(device_id,2) = 0";
} elseif ($argv[1] == "--all") {
$where = "";
+} elseif ($argv[1] == "--forced") {
+ $sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_type = 'discover' AND A.device_id = D.device_id AND D.ignore = '0' AND D.disabled = '0'");
+ while($device = mysql_fetch_array($sql)){
+ shell_exec("./discover --device " . $device['device_id']);
+ }
+ exit;
} else {
echo("--device Add Device
");
+echo("Add Device
");
if($_POST['hostname'] && $_POST['community']) {
if($_SESSION['userlevel'] > '5') {
$hostname = mres($_POST['hostname']);
$community = mres($_POST['community']);
$snmpver = mres($_POST['snmpver']);
+ if($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
echo("");
- $result = addHost($hostname, $community, $snmpver);
- echo("$result");
+ echo("Adding host $hostname community $community port $port
Error: You don't have the necessary privileges to add hosts.
"); @@ -30,7 +30,7 @@ echo("Error: A hostname is required.
"); ?> -