fixing things!

git-svn-id: http://www.observium.org/svn/observer/trunk@182 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-22 13:57:16 +00:00
parent 5f150804a0
commit 27060c2da5
3 changed files with 9 additions and 27 deletions
+7 -17
View File
@@ -7,19 +7,16 @@ $config['db_pass'] = "observer_pass";
$config['db_name'] = "observer_demo"; $config['db_name'] = "observer_demo";
### Installation Location ### Installation Location
$installdir = "/home/adama/sites/demo.project-observer.org/"; $config['installdir'] = "/home/adama/sites/demo.project-observer.org/";
$htmldir = $installdir . "html"; $config['htmldir'] = $config['installdir'] . "html";
$config['rrd_dir'] = $installdir . "rrd"; $config['rrd_dir'] = $config['installdir'] . "rrd";
$rrd_dir = $config['rrd_dir']; $rrd_dir = $config['rrd_dir'];
### Default community ### Default community
$config['community'] = "observer"; $config['community'] = "observer";
$community = $config['community']; $community = $config['community'];
$base_url = "http://demo.project-observer.org"; $config['base_url'] = "http://demo.project-observer.org";
### File containing syslog
$syslogfile = "";
### Location of executables ### Location of executables
@@ -58,7 +55,8 @@ $config['mydomain'] = "vostron.net";
$config['page_title'] = "Observer Demo"; $config['page_title'] = "Observer Demo";
$config['title_image'] = "images/observer-header.png"; $config['title_image'] = "images/observer-header.png";
$config['stylesheet'] = "css/styles.css"; $config['stylesheet'] = "css/styles.css";
$mono_font = "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf"; $config['mono_font'] = "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf";
$mono_font = $config['mono_font'];
$config['favicon'] = "favicon.ico"; $config['favicon'] = "favicon.ico";
$config['email_default'] = "adama@memetic.org"; $config['email_default'] = "adama@memetic.org";
@@ -82,16 +80,9 @@ $config['bif'] = array("null", "virtual-", "unrouted", "eobc", "mpls", "sl0", "l
"async", "plip", "-physical", "-signalling", "control plane", "async", "plip", "-physical", "-signalling", "control plane",
"bri", "-bearer", "ng", "bluetooth", "isatap", "ras", "qos", "miniport"); "bri", "-bearer", "ng", "bluetooth", "isatap", "ras", "qos", "miniport");
$bif = $config['bif']
### Mountpoints to ignore ### Mountpoints to ignore
$config['ignore_mount'] = array("/kern", "/mnt/cdrom", "/dev", "/dev/pts"); $config['ignore_mount'] = array("/kern", "/mnt/cdrom", "/dev", "/dev/pts");
$ignore_mount = $config['ignore_mount']
### Valis OSes
$valid_os = array("IOS", "Linux", "OpenBSD", "FreeBSD", "NetBSD", "ProCurve", "m0n0wall", "pfSense", "Snom", "Voswall", "DragonFly");
### entPhysicalVendorType rewrites ### entPhysicalVendorType rewrites
@@ -115,7 +106,6 @@ $entPhysicalVendorTypes = array (
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC', 'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
'cevPort10GigBaseLR' => '10GigBaseLR'); 'cevPort10GigBaseLR' => '10GigBaseLR');
### Style Options ### Style Options
$list_colour_a = "#ffffff"; $list_colour_a = "#ffffff";
@@ -128,7 +118,7 @@ $warn_colour_b = "#ffcccc";
# No changes below this line # # No changes below this line #
############################## ##############################
$observer_version = "0.3.1"; $config['version'] = "0.3.1";
### Connect to database ### Connect to database
if (!@mysql_connect($config['db_host'], $config['db_user'], $config['db_pass'])) { if (!@mysql_connect($config['db_host'], $config['db_user'], $config['db_pass'])) {
+1 -9
View File
@@ -549,15 +549,7 @@ function fixIOSHardware($hardware){
function createHost ($host, $community, $snmpver){ function createHost ($host, $community, $snmpver){
$host = trim(strtolower($host)); $host = trim(strtolower($host));
$host_os = getHostOS($host, $community, $snmpver); $host_os = getHostOS($host, $community, $snmpver);
global $valid_os; if($host_os) {
#$nullhost = 1;
#echo("$host -> $host_os<br />");
#foreach($valid_os as $os) {
# if ($os == $host_os) {
$nullhost = '0';
# }
#}
if($nullhost == '0' && $host_os) {
$sql = mysql_query("INSERT INTO `devices` (`hostname`, `community`, `os`, `status`) VALUES ('$host', '$community', '$host_os', '1')"); $sql = mysql_query("INSERT INTO `devices` (`hostname`, `community`, `os`, `status`) VALUES ('$host', '$community', '$host_os', '1')");
return("Created host : $host ($host_os)"); return("Created host : $host ($host_os)");
} else { } else {
+1 -1
View File
@@ -21,7 +21,7 @@ function graph_netscreen_sessions ($rrd, $graph, $from, $to, $width, $height, $t
} }
function graph_netscreen_cpu ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) { function graph_netscreen_cpu ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
global $config, $rrdtool, $installdir, $mono_font, $rrd_dir; global $config;
$database = $config['rrd_dir'] . "/" . $rrd; $database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph"; $imgfile = "graphs/" . "$graph";
$period = $to - $from; $period = $to - $from;