diff --git a/mysql-schema.sql b/mysql-schema.sql index 6e2460146..52cbde21d 100644 --- a/mysql-schema.sql +++ b/mysql-schema.sql @@ -1,3 +1,14 @@ +-- phpMyAdmin SQL Dump +-- version 2.11.8.1deb1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: May 11, 2009 at 03:07 PM +-- Server version: 5.0.67 +-- PHP Version: 5.2.6-2ubuntu4.2 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + -- -- Database: `observer` -- @@ -8,7 +19,7 @@ -- Table structure for table `alerts` -- -CREATE TABLE IF NOT EXISTS `alerts` ( +CREATE TABLE `alerts` ( `id` int(11) NOT NULL auto_increment, `importance` int(11) NOT NULL default '0', `device_id` int(11) NOT NULL, @@ -24,7 +35,7 @@ CREATE TABLE IF NOT EXISTS `alerts` ( -- Table structure for table `authlog` -- -CREATE TABLE IF NOT EXISTS `authlog` ( +CREATE TABLE `authlog` ( `id` int(11) NOT NULL auto_increment, `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP, `user` text NOT NULL, @@ -39,7 +50,7 @@ CREATE TABLE IF NOT EXISTS `authlog` ( -- Table structure for table `bgpPeers` -- -CREATE TABLE IF NOT EXISTS `bgpPeers` ( +CREATE TABLE `bgpPeers` ( `bgpPeer_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `astext` varchar(64) NOT NULL, @@ -65,13 +76,13 @@ CREATE TABLE IF NOT EXISTS `bgpPeers` ( -- Table structure for table `bgpPeers_cbgp` -- -CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( +CREATE TABLE `bgpPeers_cbgp` ( `device_id` int(11) NOT NULL, `bgpPeerIdentifier` varchar(64) NOT NULL, `afi` varchar(8) NOT NULL, `safi` varchar(8) NOT NULL, KEY `device_id` (`device_id`,`bgpPeerIdentifier`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -79,7 +90,7 @@ CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( -- Table structure for table `bills` -- -CREATE TABLE IF NOT EXISTS `bills` ( +CREATE TABLE `bills` ( `bill_id` int(11) NOT NULL auto_increment, `bill_name` text NOT NULL, `bill_type` text NOT NULL, @@ -95,7 +106,7 @@ CREATE TABLE IF NOT EXISTS `bills` ( -- Table structure for table `bill_data` -- -CREATE TABLE IF NOT EXISTS `bill_data` ( +CREATE TABLE `bill_data` ( `bill_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `period` int(11) NOT NULL, @@ -111,7 +122,7 @@ CREATE TABLE IF NOT EXISTS `bill_data` ( -- Table structure for table `bill_perms` -- -CREATE TABLE IF NOT EXISTS `bill_perms` ( +CREATE TABLE `bill_perms` ( `user_id` int(11) NOT NULL, `bill_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; @@ -122,7 +133,7 @@ CREATE TABLE IF NOT EXISTS `bill_perms` ( -- Table structure for table `bill_ports` -- -CREATE TABLE IF NOT EXISTS `bill_ports` ( +CREATE TABLE `bill_ports` ( `bill_id` int(11) NOT NULL, `port_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; @@ -133,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `bill_ports` ( -- Table structure for table `cempMemPool` -- -CREATE TABLE IF NOT EXISTS `cempMemPool` ( +CREATE TABLE `cempMemPool` ( `cempMemPool_id` int(11) NOT NULL auto_increment, `Index` varchar(8) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, @@ -147,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `cempMemPool` ( `cempMemPoolLowestFree` int(11) NOT NULL, PRIMARY KEY (`cempMemPool_id`), KEY `device_id` (`device_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -155,7 +166,7 @@ CREATE TABLE IF NOT EXISTS `cempMemPool` ( -- Table structure for table `cpmCPU` -- -CREATE TABLE IF NOT EXISTS `cpmCPU` ( +CREATE TABLE `cpmCPU` ( `cpmCPU_id` int(11) NOT NULL auto_increment, `entPhysicalIndex` int(11) NOT NULL, `device_id` int(11) NOT NULL, @@ -164,7 +175,7 @@ CREATE TABLE IF NOT EXISTS `cpmCPU` ( `entPhysicalDescr` varchar(64) NOT NULL, PRIMARY KEY (`cpmCPU_id`), KEY `cpuCPU_id` (`cpmCPU_id`,`device_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -172,7 +183,7 @@ CREATE TABLE IF NOT EXISTS `cpmCPU` ( -- Table structure for table `customers` -- -CREATE TABLE IF NOT EXISTS `customers` ( +CREATE TABLE `customers` ( `customer_id` int(11) NOT NULL auto_increment, `username` char(64) NOT NULL, `password` char(32) NOT NULL, @@ -188,7 +199,7 @@ CREATE TABLE IF NOT EXISTS `customers` ( -- Table structure for table `devices` -- -CREATE TABLE IF NOT EXISTS `devices` ( +CREATE TABLE `devices` ( `device_id` int(11) NOT NULL auto_increment, `hostname` varchar(128) NOT NULL, `sysName` varchar(128) default NULL, @@ -223,7 +234,7 @@ CREATE TABLE IF NOT EXISTS `devices` ( -- Table structure for table `devices_attribs` -- -CREATE TABLE IF NOT EXISTS `devices_attribs` ( +CREATE TABLE `devices_attribs` ( `attrib_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `attrib_type` varchar(32) NOT NULL, @@ -238,7 +249,7 @@ CREATE TABLE IF NOT EXISTS `devices_attribs` ( -- Table structure for table `devices_perms` -- -CREATE TABLE IF NOT EXISTS `devices_perms` ( +CREATE TABLE `devices_perms` ( `user_id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `access_level` int(4) NOT NULL default '0', @@ -251,7 +262,7 @@ CREATE TABLE IF NOT EXISTS `devices_perms` ( -- Table structure for table `entPhysical` -- -CREATE TABLE IF NOT EXISTS `entPhysical` ( +CREATE TABLE `entPhysical` ( `entPhysical_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, @@ -264,6 +275,13 @@ CREATE TABLE IF NOT EXISTS `entPhysical` ( `entPhysicalContainedIn` int(11) NOT NULL, `entPhysicalParentRelPos` int(11) NOT NULL, `entPhysicalMfgName` text NOT NULL, + `entAliasMappingIdentifier` varchar(32) default NULL, + `entSensorType` varchar(16) default NULL, + `entSensorScale` varchar(16) default NULL, + `entSensorPrecision` int(11) default NULL, + `entSensorValue` int(11) default NULL, + `entSensorStatus` varchar(8) default NULL, + `entSensorMeasuredEntity` int(11) default NULL, `ifIndex` int(11) default NULL, PRIMARY KEY (`entPhysical_id`), KEY `device_id` (`device_id`) @@ -275,7 +293,7 @@ CREATE TABLE IF NOT EXISTS `entPhysical` ( -- Table structure for table `eventlog` -- -CREATE TABLE IF NOT EXISTS `eventlog` ( +CREATE TABLE `eventlog` ( `id` int(11) NOT NULL default '0', `host` int(11) NOT NULL default '0', `interface` int(11) default NULL, @@ -291,7 +309,7 @@ CREATE TABLE IF NOT EXISTS `eventlog` ( -- Table structure for table `interfaces` -- -CREATE TABLE IF NOT EXISTS `interfaces` ( +CREATE TABLE `interfaces` ( `interface_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `ifDescr` varchar(128) NOT NULL, @@ -330,7 +348,7 @@ CREATE TABLE IF NOT EXISTS `interfaces` ( -- Table structure for table `interfaces_perms` -- -CREATE TABLE IF NOT EXISTS `interfaces_perms` ( +CREATE TABLE `interfaces_perms` ( `user_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `access_level` int(11) NOT NULL @@ -342,14 +360,26 @@ CREATE TABLE IF NOT EXISTS `interfaces_perms` ( -- Table structure for table `ipv4_addresses` -- -CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( +CREATE TABLE `ipv4_addresses` ( `ipv4_address_id` int(11) NOT NULL auto_increment, `ipv4_address` varchar(32) NOT NULL, `ipv4_prefixlen` int(11) NOT NULL, `ipv4_network_id` varchar(32) NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv4_address_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ipv4_mac` +-- + +CREATE TABLE `ipv4_mac` ( + `interface_id` int(11) NOT NULL, + `mac_address` varchar(32) NOT NULL, + `ipv4_address` varchar(32) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -357,11 +387,11 @@ CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( -- Table structure for table `ipv4_networks` -- -CREATE TABLE IF NOT EXISTS `ipv4_networks` ( +CREATE TABLE `ipv4_networks` ( `ipv4_network_id` int(11) NOT NULL auto_increment, `ipv4_network` varchar(64) NOT NULL, PRIMARY KEY (`ipv4_network_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -369,7 +399,7 @@ CREATE TABLE IF NOT EXISTS `ipv4_networks` ( -- Table structure for table `ipv6_addresses` -- -CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( +CREATE TABLE `ipv6_addresses` ( `ipv6_address_id` int(11) NOT NULL auto_increment, `ipv6_address` varchar(128) NOT NULL, `ipv6_compressed` varchar(128) NOT NULL, @@ -378,7 +408,7 @@ CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( `ipv6_network_id` varchar(128) NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv6_address_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -386,11 +416,11 @@ CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( -- Table structure for table `ipv6_networks` -- -CREATE TABLE IF NOT EXISTS `ipv6_networks` ( +CREATE TABLE `ipv6_networks` ( `ipv6_network_id` int(11) NOT NULL auto_increment, `ipv6_network` varchar(64) NOT NULL, PRIMARY KEY (`ipv6_network_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -398,7 +428,7 @@ CREATE TABLE IF NOT EXISTS `ipv6_networks` ( -- Table structure for table `links` -- -CREATE TABLE IF NOT EXISTS `links` ( +CREATE TABLE `links` ( `id` int(11) NOT NULL auto_increment, `src_if` int(11) default NULL, `dst_if` int(11) default NULL, @@ -415,17 +445,14 @@ CREATE TABLE IF NOT EXISTS `links` ( -- Table structure for table `mac_accounting` -- -CREATE TABLE IF NOT EXISTS `mac_accounting` ( +CREATE TABLE `mac_accounting` ( `ma_id` int(11) NOT NULL auto_increment, `interface_id` int(11) NOT NULL, - `peer_ip` varchar(32) NOT NULL, - `peer_desc` varchar(64) NOT NULL, - `peer_asn` int(11) NOT NULL, - `peer_mac` varchar(32) NOT NULL, - `in_oid` varchar(128) NOT NULL, - `out_oid` varchar(128) NOT NULL, + `mac` varchar(32) NOT NULL, `bps_out` int(11) NOT NULL, `bps_in` int(11) NOT NULL, + `pps_in` int(11) NOT NULL, + `pps_out` int(11) NOT NULL, PRIMARY KEY (`ma_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; @@ -435,7 +462,7 @@ CREATE TABLE IF NOT EXISTS `mac_accounting` ( -- Table structure for table `port_in_measurements` -- -CREATE TABLE IF NOT EXISTS `port_in_measurements` ( +CREATE TABLE `port_in_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, @@ -449,7 +476,7 @@ CREATE TABLE IF NOT EXISTS `port_in_measurements` ( -- Table structure for table `port_out_measurements` -- -CREATE TABLE IF NOT EXISTS `port_out_measurements` ( +CREATE TABLE `port_out_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, @@ -463,7 +490,7 @@ CREATE TABLE IF NOT EXISTS `port_out_measurements` ( -- Table structure for table `pseudowires` -- -CREATE TABLE IF NOT EXISTS `pseudowires` ( +CREATE TABLE `pseudowires` ( `pseudowire_id` int(11) NOT NULL auto_increment, `interface_id` int(11) NOT NULL, `peer_device_id` int(11) NOT NULL, @@ -479,7 +506,7 @@ CREATE TABLE IF NOT EXISTS `pseudowires` ( -- Table structure for table `services` -- -CREATE TABLE IF NOT EXISTS `services` ( +CREATE TABLE `services` ( `service_id` int(11) NOT NULL auto_increment, `service_host` int(11) NOT NULL, `service_ip` text NOT NULL, @@ -502,7 +529,7 @@ CREATE TABLE IF NOT EXISTS `services` ( -- Table structure for table `storage` -- -CREATE TABLE IF NOT EXISTS `storage` ( +CREATE TABLE `storage` ( `storage_id` int(11) NOT NULL auto_increment, `host_id` int(11) NOT NULL, `hrStorageIndex` int(11) NOT NULL, @@ -512,7 +539,7 @@ CREATE TABLE IF NOT EXISTS `storage` ( `hrStorageUsed` int(11) NOT NULL, `storage_perc` text NOT NULL, PRIMARY KEY (`storage_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -520,7 +547,7 @@ CREATE TABLE IF NOT EXISTS `storage` ( -- Table structure for table `syslog` -- -CREATE TABLE IF NOT EXISTS `syslog` ( +CREATE TABLE `syslog` ( `host` varchar(64) NOT NULL, `device_id` int(11) default NULL, `facility` varchar(10) default NULL, @@ -544,7 +571,7 @@ CREATE TABLE IF NOT EXISTS `syslog` ( -- Table structure for table `temperature` -- -CREATE TABLE IF NOT EXISTS `temperature` ( +CREATE TABLE `temperature` ( `temp_id` int(11) NOT NULL auto_increment, `temp_host` int(11) NOT NULL default '0', `temp_oid` varchar(64) NOT NULL, @@ -562,7 +589,7 @@ CREATE TABLE IF NOT EXISTS `temperature` ( -- Table structure for table `users` -- -CREATE TABLE IF NOT EXISTS `users` ( +CREATE TABLE `users` ( `user_id` int(11) NOT NULL auto_increment, `username` char(30) NOT NULL, `password` char(32) NOT NULL, @@ -580,14 +607,14 @@ CREATE TABLE IF NOT EXISTS `users` ( -- Table structure for table `users_prefs` -- -CREATE TABLE IF NOT EXISTS `users_prefs` ( +CREATE TABLE `users_prefs` ( `user_id` int(16) NOT NULL, `pref` varchar(32) NOT NULL, `value` varchar(128) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id.pref` (`user_id`,`pref`), KEY `pref` (`pref`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -595,7 +622,7 @@ CREATE TABLE IF NOT EXISTS `users_prefs` ( -- Table structure for table `vlans` -- -CREATE TABLE IF NOT EXISTS `vlans` ( +CREATE TABLE `vlans` ( `vlan_id` int(11) NOT NULL auto_increment, `device_id` int(11) default NULL, `vlan_vlan` int(11) default NULL, @@ -611,7 +638,7 @@ CREATE TABLE IF NOT EXISTS `vlans` ( -- Table structure for table `vrfs` -- -CREATE TABLE IF NOT EXISTS `vrfs` ( +CREATE TABLE `vrfs` ( `vrf_id` int(11) NOT NULL auto_increment, `vrf_oid` varchar(256) NOT NULL, `vrf_name` varchar(32) NOT NULL,