diff --git a/discovery.php b/discovery.php index 2c5e01740..411960042 100755 --- a/discovery.php +++ b/discovery.php @@ -129,6 +129,7 @@ while ($device = mysql_fetch_array($device_query)) include("includes/discovery/toner.inc.php"); include("includes/discovery/ups.inc.php"); include("includes/discovery/ucd-diskio.inc.php"); + include("includes/discovery/services.inc.php"); if ($device['type'] == "unknown") { diff --git a/html/pages/device/graphs/os-redback.inc.php b/html/pages/device/graphs/os-redback.inc.php new file mode 100644 index 000000000..683ec6642 --- /dev/null +++ b/html/pages/device/graphs/os-redback.inc.php @@ -0,0 +1,10 @@ + diff --git a/includes/discovery/services.inc.php b/includes/discovery/services.inc.php new file mode 100644 index 000000000..159f40846 --- /dev/null +++ b/includes/discovery/services.inc.php @@ -0,0 +1,42 @@ + "ssh", 25 => "smtp", 53 => "dns", 80 => "http", 110 => "pop", 143 => "imap"); + + function add_service($service) { + global $id; + global $hostname; + echo "$service "; + $sql = "INSERT INTO `services` (`device_id`,`service_ip`,`service_type`,`service_desc`,`service_param`,`service_ignore`) + VALUES ('" . mres($id). "','" . mres($hostname) . "','" . mres($service) . "', + '" . mres("auto discovered: $service") . "','" . mres("") . "','0')"; + + $query = mysql_query($sql); + } + + ## Services + if($device['type'] == "server") { + $oids = shell_exec($config['snmpwalk'] . " -".$device['snmpver']." -CI -Osqn -c ".$community." ".$hostname.":".$port." .1.3.6.1.2.1.6.13.1.1.0.0.0.0"); + $oids = trim($oids); + foreach(explode("\n", $oids) as $data) { + $data = trim($data); + if($data) { + list($oid, $tcpstatus) = explode(" ", $data); + if (trim($tcpstatus)=="listen") { + $split_oid = explode('.',$oid); + $tcp_port = $split_oid[count($split_oid)-6]; + if($known_services[$tcp_port]) { add_service($known_services[$tcp_port]); }; + } + } + } + } ## End Services + +echo("\n"); + +?> diff --git a/includes/osdiscovery/discover-redback.php b/includes/osdiscovery/discover-redback.php new file mode 100644 index 000000000..6c86b4489 --- /dev/null +++ b/includes/osdiscovery/discover-redback.php @@ -0,0 +1,7 @@ + diff --git a/includes/polling/device-redback.inc.php b/includes/polling/device-redback.inc.php new file mode 100644 index 000000000..c95272fff --- /dev/null +++ b/includes/polling/device-redback.inc.php @@ -0,0 +1,6 @@ +