fixed config and sql schema

git-svn-id: http://www.observium.org/svn/observer/trunk@122 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-11-30 14:48:14 +00:00
parent 77169ec22b
commit 29115277c7
2 changed files with 146 additions and 78 deletions

View File

@@ -1,53 +1,78 @@
<?php
### Database config
$db_host = "localhost";
$db_user = "observer";
$db_pass = "";
$db_name = "observer";
$config['db_host'] = "localhost";
$config['db_user'] = "root";
$config['db_pass'] = "katak";
$config['db_name'] = "observer-demo";
### Installation Locations
$installdir = "/var/sites/observer/";
$rrd_dir = $installdir . "rrd/";
### Installation Location
$installdir = "/var/sites/observer/";
$htmldir = $installdir . "html";
$rrd_dir = $installdir . "rrd";
### Default community
$community = "public";
$community = "";
$community = $config['community'];
### File containing syslog
$syslogfile = "";
### Location of executables
$rrdtool = "/usr/bin/rrdtool";
$fping = "/usr/sbin/fping";
$ipcalc = "/usr/bin/ipcalc";
$snmpwalk = "/usr/bin/snmpwalk";
$snmpget = "/usr/bin/snmpget";
$config['rrdtool'] = "/usr/bin/rrdtool";
$rrdtool = $config['rrdtool'];
$config['fping'] = "/usr/sbin/fping";
$fping = $config['fping'];
$config['ipcalc'] = "/usr/bin/ipcalc";
$ipcalc = $config['ipcalc'];
$config['snmpwalk'] = "/usr/bin/snmpwalk";
$snmpwalk = $config['snmpwalk'];
$config['snmpget'] = "/usr/bin/snmpget";
$snmpget = $config['snmpget'];
### RRDGraph Settings
# Set the general colours and other settings for rrdtool graphs
$config['rrdgraph_defaults'] = array("-c", "BACK#FFFFFF", "-c", "SHADEA#E5E5E5", "-c", "SHADEB#E5E5E5",
"-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
"-c", "MGRID#FFAAAA", "-c", "FRAME#5e5e5e", "-c", "ARROW#5e5e5e",
"-R", "normal");
$config['overlib_defaults'] = ",FGCOLOR,'#e5e5e5', BGCOLOR, '#e5e5e5'";
### List of networks to allow scanning-based discovery
$nets = array ("172.22.0.0/16", "10.0.0.0/8");
$nets = array ("89.21.224.0/19", "10.0.0.0/8", "172.22.0.0/16", "213.253.1.0/24");
### Customisation Options
$mydomain = "project-observer.net";
$page_title = "Project Observer Network Monitoring";
$title_image = "/images/logo.gif";
### Your company domain name
$config['mydomain'] = "project-observer.org";
$mydomain = $config['mydomain'];
$page_title = "Project Observer";
$title_image = "/images/observer-header.png";
$stylesheet = "/css/styles.css";
$mono_font = "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf";
$favicon = "/favicon.ico";
$notify_email = "admin@vostron.com";
### Which special sections should we show?
$show_if_customers = 0;
### Which interface sections should we show?
$show_if_customers = 1;
$show_if_transit = 0;
$show_if_peering = 0;
$show_if_core = 0;
$show_if_l2tp =0;
$show_locations = 1;
$enable_syslog = 0;
$enable_syslog = 1;
### Interface name strings to ignore
$bif = array("null", "virtual-", "unrouted", "eobc", "mpls", "sl0", "lp0", "faith0",
"-atm layer", "-atm subif", "-shdsl", "-adsl",
"-atm layer", "-atm subif", "-shdsl", "-adsl", "-aal5", "-atm",
"async", "plip", "-physical", "-signalling", "control plane",
"bri", "-bearer", "ng", "bluetooth", "isatap", "ras", "qos", "miniport");
@@ -58,6 +83,29 @@ $ignore_mount = array("/kern", "/mnt/cdrom", "/dev", "/dev/pts");
### Valis OSes
$valid_os = array("IOS", "Linux", "OpenBSD", "FreeBSD", "NetBSD", "ProCurve", "m0n0wall", "pfSense", "Snom", "Voswall", "DragonFly");
### entPhysicalVendorType rewrites
$entPhysicalVendorTypes = array (
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
'cevChassis7140Dualfe' => 'C7140-2FE',
'cevChassis7204' => "C7204",
'cevChassis7204Vxr' => 'C7204VXR',
'cevChassis7206' => 'C7206',
'cevChassis7206Vxr' => 'C7206VXR',
'cevCpu7200Npe200' => 'NPE-200',
'cevCpu7200Npe225' => 'NPE-225',
'cevCpu7200Npe300' => 'NPE-300',
'cevCpu7200Npe400' => 'NPE-400',
'cevCpu7200Npeg1' => 'NPE-G1',
'cevCpu7200Npeg2' => 'NPE-G2',
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
'cevPa2feTxI82543' => 'PA-2FE-TX',
'cevPa8e' => 'PA-8E',
'cevPaA8tX21' => 'PA-8T-X21',
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
'cevPort10GigBaseLR' => '10GigBaseLR');
### Style Options
$list_colour_a = "#ffffff";
@@ -66,19 +114,20 @@ $list_colour_b = "#eeeeee";
$warn_colour_a = "#ffeeee";
$warn_colour_b = "#ffcccc";
##############################
# No changes below this line #
##############################
$observer_version = "0.2.5";
$observer_version = "0.3.1";
### Connect to database
if (!@mysql_connect($db_host, $db_user, $db_pass)) {
if (!@mysql_connect($config['db_host'], $config['db_user'], $config['db_pass'])) {
echo "<h2>MySQL Error</h2>";
die;
}
mysql_select_db($db_name);
mysql_select_db($config['db_name']);
# Set some times needed by loads of scripts (it's dynamic, so we do it here!)
$now = time();
$day = time() - (24 * 60 * 60);

View File

@@ -1,3 +1,15 @@
-- phpMyAdmin SQL Dump
-- version 2.8.1-Debian-1~dapper1
-- http://www.phpmyadmin.net
--
-- Host: fennel.vostron.net
-- Generation Time: Nov 30, 2007 at 02:47 PM
-- Server version: 5.0.22
-- PHP Version: 5.1.2
--
-- Database: `vostron_network`
--
-- --------------------------------------------------------
--
@@ -9,7 +21,7 @@ CREATE TABLE `adjacencies` (
`network_id` int(11) NOT NULL default '0',
`interface_id` int(11) NOT NULL default '0',
PRIMARY KEY (`adj_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=316 ;
-- --------------------------------------------------------
@@ -25,7 +37,7 @@ CREATE TABLE `alerts` (
`time_logged` timestamp NOT NULL default CURRENT_TIMESTAMP,
`alerted` smallint(6) NOT NULL default '0',
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4765 ;
-- --------------------------------------------------------
@@ -41,7 +53,7 @@ CREATE TABLE `customers` (
`level` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`customer_id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;
-- --------------------------------------------------------
@@ -52,10 +64,10 @@ CREATE TABLE `customers` (
CREATE TABLE `devices` (
`device_id` int(11) NOT NULL auto_increment,
`hostname` text NOT NULL,
`ip` varchar(16) NOT NULL default '',
`community` varchar(32) NOT NULL default 'v05tr0n82',
`snmpver` varchar(4) NOT NULL default 'v2c',
`sysDescr` text,
`sysContact` text NOT NULL,
`monowall` tinyint(4) NOT NULL default '0',
`version` text NOT NULL,
`hardware` text NOT NULL,
@@ -64,14 +76,16 @@ CREATE TABLE `devices` (
`os` varchar(8) NOT NULL default '',
`status` tinyint(4) NOT NULL default '0',
`ignore` tinyint(4) NOT NULL default '0',
`disabled` tinyint(1) NOT NULL default '0',
`lastchange` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`purpose` text NOT NULL,
`apache` tinyint(4) NOT NULL default '0',
`courier` tinyint(4) NOT NULL default '0',
`postfix` tinyint(4) NOT NULL default '0',
`type` varchar(8) NOT NULL default 'other',
PRIMARY KEY (`device_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
PRIMARY KEY (`device_id`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=92 ;
-- --------------------------------------------------------
@@ -83,9 +97,10 @@ CREATE TABLE `devices_attribs` (
`attrib_id` int(11) NOT NULL auto_increment,
`device_id` int(11) NOT NULL,
`attrib_type` varchar(32) NOT NULL,
`attrib_value` varchar(256) NOT NULL,
PRIMARY KEY (`attrib_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
`attrib_value` int(11) NOT NULL,
PRIMARY KEY (`attrib_id`),
FULLTEXT KEY `attrib_type` (`attrib_type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=78 ;
-- --------------------------------------------------------
@@ -95,11 +110,37 @@ CREATE TABLE `devices_attribs` (
CREATE TABLE `devices_perms` (
`user_id` int(11) NOT NULL,
`device_id` int(11) NOT NULL
`device_id` int(11) NOT NULL,
`access_level` int(4) NOT NULL default '0',
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `entPhysical`
--
CREATE TABLE `entPhysical` (
`entPhysical_id` int(11) NOT NULL auto_increment,
`device_id` int(11) NOT NULL,
`entPhysicalIndex` int(11) NOT NULL,
`entPhysicalDescr` text NOT NULL,
`entPhysicalClass` text NOT NULL,
`entPhysicalName` text NOT NULL,
`entPhysicalModelName` text NOT NULL,
`entPhysicalVendorType` text,
`entPhysicalSerialNum` text NOT NULL,
`entPhysicalContainedIn` int(11) NOT NULL,
`entPhysicalParentRelPos` int(11) NOT NULL,
`entPhysicalMfgName` text NOT NULL,
`ifIndex` int(11) default NULL,
PRIMARY KEY (`entPhysical_id`),
KEY `device_id` (`device_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=931 ;
-- --------------------------------------------------------
--
-- Table structure for table `eventlog`
--
@@ -116,22 +157,6 @@ CREATE TABLE `eventlog` (
-- --------------------------------------------------------
--
-- Table structure for table `interface_measurements`
--
CREATE TABLE `interface_measurements` (
`interface_id` int(11) NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`period` int(11) NOT NULL,
`delta_in` int(11) NOT NULL,
`delta_out` int(11) NOT NULL,
`rate_in` int(11) NOT NULL,
`rate_out` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `interfaces`
--
@@ -151,7 +176,7 @@ CREATE TABLE `interfaces` (
`ifPhysAddress` text,
`ifHardType` varchar(64) default NULL,
`ifLastChange` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`ifVlan` int(11) default NULL,
`ifVlan` varchar(8) NOT NULL default '',
`ifTrunk` varchar(8) default '',
`in_rate` int(11) NOT NULL,
`out_rate` int(11) NOT NULL,
@@ -165,7 +190,7 @@ CREATE TABLE `interfaces` (
KEY `host` (`device_id`),
KEY `snmpid` (`ifIndex`),
KEY `if_2` (`ifDescr`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4784 ;
-- --------------------------------------------------------
@@ -181,7 +206,7 @@ CREATE TABLE `ipaddr` (
`interface_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `addr` (`addr`,`cidr`,`interface_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2578 ;
-- --------------------------------------------------------
@@ -196,7 +221,7 @@ CREATE TABLE `links` (
`active` tinyint(4) NOT NULL default '1',
`cdp` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=303 ;
-- --------------------------------------------------------
@@ -216,12 +241,9 @@ CREATE TABLE `logs` (
`seq` bigint(20) unsigned NOT NULL auto_increment,
PRIMARY KEY (`seq`),
KEY `host` (`host`),
KEY `program` (`program`),
KEY `datetime` (`datetime`),
KEY `priority` (`priority`),
KEY `facility` (`facility`),
KEY `seq` (`seq`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=12203343 ;
-- --------------------------------------------------------
@@ -233,9 +255,8 @@ CREATE TABLE `networks` (
`id` int(11) NOT NULL auto_increment,
`cidr` varchar(32) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `cidr_2` (`cidr`),
FULLTEXT KEY `cidr` (`cidr`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
UNIQUE KEY `cidr` (`cidr`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=542 ;
-- --------------------------------------------------------
@@ -257,7 +278,7 @@ CREATE TABLE `services` (
`service_message` text NOT NULL,
PRIMARY KEY (`service_id`),
KEY `service_host` (`service_host`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=61 ;
-- --------------------------------------------------------
@@ -275,7 +296,7 @@ CREATE TABLE `storage` (
`hrStorageUsed` int(11) NOT NULL,
`storage_perc` text NOT NULL,
PRIMARY KEY (`storage_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=88 ;
-- --------------------------------------------------------
@@ -295,12 +316,8 @@ CREATE TABLE `syslog` (
`seq` bigint(20) unsigned NOT NULL auto_increment,
PRIMARY KEY (`seq`),
KEY `host` (`host`),
KEY `program` (`program`),
KEY `datetime` (`datetime`),
KEY `priority` (`priority`),
KEY `facility` (`facility`),
KEY `seq` (`seq`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
KEY `datetime` (`datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9375565 ;
-- --------------------------------------------------------
@@ -315,9 +332,10 @@ CREATE TABLE `temperature` (
`temp_descr` varchar(32) NOT NULL default '',
`temp_tenths` int(1) NOT NULL default '0',
`temp_current` tinyint(4) NOT NULL default '0',
`temp_limit` tinyint(4) NOT NULL default '70',
PRIMARY KEY (`temp_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
`temp_limit` tinyint(4) NOT NULL default '60',
PRIMARY KEY (`temp_id`),
KEY `temp_host` (`temp_host`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2789 ;
-- --------------------------------------------------------
@@ -329,11 +347,12 @@ CREATE TABLE `users` (
`user_id` int(11) NOT NULL auto_increment,
`username` char(30) NOT NULL,
`password` char(32) NOT NULL,
`realname` text NOT NULL,
`descr` char(30) NOT NULL,
`level` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`user_id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
-- --------------------------------------------------------
@@ -349,5 +368,5 @@ CREATE TABLE `vlans` (
`vlan_descr` text,
PRIMARY KEY (`vlan_id`),
KEY `device_id` (`device_id`,`vlan_vlan`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1016 ;