bad klaver :>

git-svn-id: http://www.observium.org/svn/observer/trunk@1277 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-06-28 12:49:26 +00:00
parent d4be0d58fb
commit 605f67b935
3 changed files with 16 additions and 11 deletions

View File

@@ -9,17 +9,6 @@
$known_services = array(22 => "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");

View File

@@ -17,6 +17,7 @@ include_once($config['install_dir'] . "/includes/cisco-entities.php");
include_once($config['install_dir'] . "/includes/syslog.php");
include_once($config['install_dir'] . "/includes/rewrites.php");
include_once($config['install_dir'] . "/includes/snmp.inc.php");
include_once($config['install_dir'] . "/includes/services.inc.php");
## CollectD

15
includes/services.inc.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
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);
}
?>