From 27060c2da59e297d53f9bab0bf1625020423c9d0 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 22 Mar 2008 13:57:16 +0000 Subject: [PATCH] fixing things! git-svn-id: http://www.observium.org/svn/observer/trunk@182 61d68cd4-352d-0410-923a-c4978735b2b8 --- config.php.default | 24 +++++++----------------- includes/functions.php | 10 +--------- includes/graphing/screenos.php | 2 +- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/config.php.default b/config.php.default index 7229c7c3c..1a73edf1c 100755 --- a/config.php.default +++ b/config.php.default @@ -7,19 +7,16 @@ $config['db_pass'] = "observer_pass"; $config['db_name'] = "observer_demo"; ### Installation Location -$installdir = "/home/adama/sites/demo.project-observer.org/"; -$htmldir = $installdir . "html"; -$config['rrd_dir'] = $installdir . "rrd"; +$config['installdir'] = "/home/adama/sites/demo.project-observer.org/"; +$config['htmldir'] = $config['installdir'] . "html"; +$config['rrd_dir'] = $config['installdir'] . "rrd"; $rrd_dir = $config['rrd_dir']; ### Default community $config['community'] = "observer"; $community = $config['community']; -$base_url = "http://demo.project-observer.org"; - -### File containing syslog -$syslogfile = ""; +$config['base_url'] = "http://demo.project-observer.org"; ### Location of executables @@ -58,7 +55,8 @@ $config['mydomain'] = "vostron.net"; $config['page_title'] = "Observer Demo"; $config['title_image'] = "images/observer-header.png"; $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['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", "bri", "-bearer", "ng", "bluetooth", "isatap", "ras", "qos", "miniport"); -$bif = $config['bif'] - ### Mountpoints to ignore $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 @@ -115,7 +106,6 @@ $entPhysicalVendorTypes = array ( 'cevMGBIC1000BaseLX' => '1000BaseLX GBIC', 'cevPort10GigBaseLR' => '10GigBaseLR'); - ### Style Options $list_colour_a = "#ffffff"; @@ -128,7 +118,7 @@ $warn_colour_b = "#ffcccc"; # No changes below this line # ############################## -$observer_version = "0.3.1"; +$config['version'] = "0.3.1"; ### Connect to database if (!@mysql_connect($config['db_host'], $config['db_user'], $config['db_pass'])) { diff --git a/includes/functions.php b/includes/functions.php index 521aa5623..d1367aa55 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -549,15 +549,7 @@ function fixIOSHardware($hardware){ function createHost ($host, $community, $snmpver){ $host = trim(strtolower($host)); $host_os = getHostOS($host, $community, $snmpver); - global $valid_os; - #$nullhost = 1; - #echo("$host -> $host_os
"); - #foreach($valid_os as $os) { - # if ($os == $host_os) { - $nullhost = '0'; - # } - #} - if($nullhost == '0' && $host_os) { + if($host_os) { $sql = mysql_query("INSERT INTO `devices` (`hostname`, `community`, `os`, `status`) VALUES ('$host', '$community', '$host_os', '1')"); return("Created host : $host ($host_os)"); } else { diff --git a/includes/graphing/screenos.php b/includes/graphing/screenos.php index 318739126..080c2501c 100644 --- a/includes/graphing/screenos.php +++ b/includes/graphing/screenos.php @@ -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) { - global $config, $rrdtool, $installdir, $mono_font, $rrd_dir; + global $config; $database = $config['rrd_dir'] . "/" . $rrd; $imgfile = "graphs/" . "$graph"; $period = $to - $from;