From d44d7755f261c4dc0cf3b47429d735d73b0f5baf Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 5 May 2011 10:37:00 +0000 Subject: [PATCH] RELEASE 0.11.5 DATABASE SCHEMA git-svn-id: http://www.observium.org/svn/observer/trunk@2245 61d68cd4-352d-0410-923a-c4978735b2b8 --- database-schema.sql | 583 ++++++++++++++++++++++++++++++-------------- 1 file changed, 394 insertions(+), 189 deletions(-) diff --git a/database-schema.sql b/database-schema.sql index 1875fa41f..3ac82cb62 100644 --- a/database-schema.sql +++ b/database-schema.sql @@ -1,24 +1,8 @@ --- phpMyAdmin SQL Dump --- version 3.3.2deb1 --- http://www.phpmyadmin.net --- --- Host: localhost --- Generation Time: Jul 18, 2010 at 05:02 PM --- Server version: 5.1.41 --- PHP Version: 5.3.2-1ubuntu4.2 - -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - --- --- Database: `observer_dev` --- - --- -------------------------------------------------------- - -- -- Table structure for table `alerts` -- +DROP TABLE IF EXISTS `alerts`; CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `importance` int(11) NOT NULL DEFAULT '0', @@ -27,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `alerts` ( `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `alerted` smallint(6) NOT NULL DEFAULT '0', KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -35,12 +19,13 @@ CREATE TABLE IF NOT EXISTS `alerts` ( -- Table structure for table `applications` -- +DROP TABLE IF EXISTS `applications`; CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -48,6 +33,7 @@ CREATE TABLE IF NOT EXISTS `applications` ( -- Table structure for table `authlog` -- +DROP TABLE IF EXISTS `authlog`; CREATE TABLE IF NOT EXISTS `authlog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -55,7 +41,7 @@ CREATE TABLE IF NOT EXISTS `authlog` ( `address` text NOT NULL, `result` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -63,6 +49,7 @@ CREATE TABLE IF NOT EXISTS `authlog` ( -- Table structure for table `bgpPeers` -- +DROP TABLE IF EXISTS `bgpPeers`; CREATE TABLE IF NOT EXISTS `bgpPeers` ( `bgpPeer_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, @@ -81,7 +68,7 @@ CREATE TABLE IF NOT EXISTS `bgpPeers` ( `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, PRIMARY KEY (`bgpPeer_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -89,13 +76,14 @@ CREATE TABLE IF NOT EXISTS `bgpPeers` ( -- Table structure for table `bgpPeers_cbgp` -- +DROP TABLE IF EXISTS `bgpPeers_cbgp`; CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( `device_id` int(11) NOT NULL, `bgpPeerIdentifier` varchar(64) NOT NULL, `afi` varchar(16) NOT NULL, `safi` varchar(16) NOT NULL, KEY `device_id` (`device_id`,`bgpPeerIdentifier`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -103,6 +91,7 @@ CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( -- Table structure for table `bills` -- +DROP TABLE IF EXISTS `bills`; CREATE TABLE IF NOT EXISTS `bills` ( `bill_id` int(11) NOT NULL AUTO_INCREMENT, `bill_name` text NOT NULL, @@ -113,8 +102,9 @@ CREATE TABLE IF NOT EXISTS `bills` ( `bill_custid` varchar(64) NOT NULL, `bill_ref` varchar(64) NOT NULL, `bill_notes` varchar(256) NOT NULL, + `bill_autoadded` tinyint(1) NOT NULL, UNIQUE KEY `bill_id` (`bill_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -122,6 +112,7 @@ CREATE TABLE IF NOT EXISTS `bills` ( -- Table structure for table `bill_data` -- +DROP TABLE IF EXISTS `bill_data`; CREATE TABLE IF NOT EXISTS `bill_data` ( `bill_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, @@ -130,7 +121,7 @@ CREATE TABLE IF NOT EXISTS `bill_data` ( `in_delta` bigint(11) NOT NULL, `out_delta` bigint(11) NOT NULL, KEY `bill_id` (`bill_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -138,10 +129,11 @@ CREATE TABLE IF NOT EXISTS `bill_data` ( -- Table structure for table `bill_perms` -- +DROP TABLE IF EXISTS `bill_perms`; CREATE TABLE IF NOT EXISTS `bill_perms` ( `user_id` int(11) NOT NULL, `bill_id` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -149,10 +141,38 @@ CREATE TABLE IF NOT EXISTS `bill_perms` ( -- Table structure for table `bill_ports` -- +DROP TABLE IF EXISTS `bill_ports`; CREATE TABLE IF NOT EXISTS `bill_ports` ( `bill_id` int(11) NOT NULL, - `port_id` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + `port_id` int(11) NOT NULL, + `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cef_switching` +-- + +DROP TABLE IF EXISTS `cef_switching`; +CREATE TABLE IF NOT EXISTS `cef_switching` ( + `cef_switching_id` int(11) NOT NULL AUTO_INCREMENT, + `device_id` int(11) NOT NULL, + `entPhysicalIndex` int(11) NOT NULL, + `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, + `cef_index` int(11) NOT NULL, + `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `drop` int(11) NOT NULL, + `punt` int(11) NOT NULL, + `punt2host` int(11) NOT NULL, + `drop_prev` int(11) NOT NULL, + `punt_prev` int(11) NOT NULL, + `punt2host_prev` int(11) NOT NULL, + `updated` int(11) NOT NULL, + `updated_prev` int(11) NOT NULL, + PRIMARY KEY (`cef_switching_id`), + UNIQUE KEY `device_id` (`device_id`,`entPhysicalIndex`,`afi`,`cef_index`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -160,6 +180,7 @@ CREATE TABLE IF NOT EXISTS `bill_ports` ( -- Table structure for table `customers` -- +DROP TABLE IF EXISTS `customers`; CREATE TABLE IF NOT EXISTS `customers` ( `customer_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(64) NOT NULL, @@ -168,7 +189,7 @@ CREATE TABLE IF NOT EXISTS `customers` ( `level` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`customer_id`), UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -176,10 +197,11 @@ CREATE TABLE IF NOT EXISTS `customers` ( -- Table structure for table `dbSchema` -- +DROP TABLE IF EXISTS `dbSchema`; CREATE TABLE IF NOT EXISTS `dbSchema` ( `revision` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`revision`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -187,13 +209,17 @@ CREATE TABLE IF NOT EXISTS `dbSchema` ( -- Table structure for table `devices` -- +DROP TABLE IF EXISTS `devices`; CREATE TABLE IF NOT EXISTS `devices` ( `device_id` int(11) NOT NULL AUTO_INCREMENT, `hostname` varchar(128) CHARACTER SET latin1 NOT NULL, `sysName` varchar(128) CHARACTER SET latin1 DEFAULT NULL, - `community` varchar(32) CHARACTER SET latin1 NOT NULL, + `community` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `snmpver` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT 'v2c', `port` smallint(5) NOT NULL DEFAULT '161', + `transport` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'udp', + `timeout` int(11) DEFAULT NULL, + `retries` int(11) DEFAULT NULL, `bgpLocalAs` varchar(16) CHARACTER SET latin1 DEFAULT NULL, `sysDescr` text CHARACTER SET latin1, `sysContact` text CHARACTER SET latin1, @@ -206,6 +232,7 @@ CREATE TABLE IF NOT EXISTS `devices` ( `ignore` tinyint(4) NOT NULL DEFAULT '0', `disabled` tinyint(1) NOT NULL DEFAULT '0', `uptime` bigint(20) DEFAULT NULL, + `agent_uptime` int(11) NOT NULL, `last_polled` timestamp NULL DEFAULT NULL, `last_polled_timetaken` double(5,2) DEFAULT NULL, `last_discovered_timetaken` double(5,2) DEFAULT NULL, @@ -218,22 +245,7 @@ CREATE TABLE IF NOT EXISTS `devices` ( KEY `hostname` (`hostname`), KEY `sysName` (`sysName`), KEY `os` (`os`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=97 ; - --- -------------------------------------------------------- - --- --- Table structure for table `perf_times` --- - -CREATE TABLE IF NOT EXISTS `perf_times` ( - `type` varchar(8) NOT NULL, - `doing` varchar(64) NOT NULL, - `start` int(11) NOT NULL, - `duration` double(5,2) NOT NULL, - `devices` int(11) NOT NULL, - KEY `type` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -241,6 +253,7 @@ CREATE TABLE IF NOT EXISTS `perf_times` ( -- Table structure for table `devices_attribs` -- +DROP TABLE IF EXISTS `devices_attribs`; CREATE TABLE IF NOT EXISTS `devices_attribs` ( `attrib_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, @@ -248,7 +261,7 @@ CREATE TABLE IF NOT EXISTS `devices_attribs` ( `attrib_value` text NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`attrib_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -256,12 +269,25 @@ CREATE TABLE IF NOT EXISTS `devices_attribs` ( -- Table structure for table `devices_perms` -- +DROP TABLE IF EXISTS `devices_perms`; CREATE TABLE IF NOT EXISTS `devices_perms` ( `user_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=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `device_graphs` +-- + +DROP TABLE IF EXISTS `device_graphs`; +CREATE TABLE IF NOT EXISTS `device_graphs` ( + `device_id` int(11) NOT NULL, + `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -269,6 +295,7 @@ CREATE TABLE IF NOT EXISTS `devices_perms` ( -- Table structure for table `entPhysical` -- +DROP TABLE IF EXISTS `entPhysical`; CREATE TABLE IF NOT EXISTS `entPhysical` ( `entPhysical_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, @@ -291,7 +318,7 @@ CREATE TABLE IF NOT EXISTS `entPhysical` ( `ifIndex` int(11) DEFAULT NULL, PRIMARY KEY (`entPhysical_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -299,37 +326,53 @@ CREATE TABLE IF NOT EXISTS `entPhysical` ( -- Table structure for table `eventlog` -- +DROP TABLE IF EXISTS `eventlog`; CREATE TABLE IF NOT EXISTS `eventlog` ( `event_id` int(11) NOT NULL AUTO_INCREMENT, `host` int(11) NOT NULL DEFAULT '0', `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `message` text, - `type` varchar(64) DEFAULT NULL, - `reference` varchar(64) NOT NULL, + `message` text CHARACTER SET latin1, + `type` varchar(64) CHARACTER SET latin1 DEFAULT NULL, + `reference` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`event_id`), KEY `host` (`host`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- --- Table structure for table `frequency` +-- Table structure for table `graph_types` -- -CREATE TABLE IF NOT EXISTS `frequency` ( - `freq_id` int(11) NOT NULL AUTO_INCREMENT, - `device_id` int(11) NOT NULL DEFAULT '0', - `freq_oid` varchar(64) NOT NULL, - `freq_index` varchar(10) NOT NULL, - `freq_type` varchar(32) NOT NULL, - `freq_descr` varchar(32) NOT NULL DEFAULT '', - `freq_precision` int(11) NOT NULL DEFAULT '1', - `freq_current` float DEFAULT NULL, - `freq_limit` float DEFAULT NULL, - `freq_limit_low` float DEFAULT NULL, - PRIMARY KEY (`freq_id`), - KEY `freq_host` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +DROP TABLE IF EXISTS `graph_types`; +CREATE TABLE IF NOT EXISTS `graph_types` ( + `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `graph_order` int(11) NOT NULL, + KEY `graph_type` (`graph_type`), + KEY `graph_subtype` (`graph_subtype`), + KEY `graph_section` (`graph_section`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `graph_types_dead` +-- + +DROP TABLE IF EXISTS `graph_types_dead`; +CREATE TABLE IF NOT EXISTS `graph_types_dead` ( + `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `graph_order` int(11) NOT NULL, + KEY `graph_type` (`graph_type`), + KEY `graph_subtype` (`graph_subtype`), + KEY `graph_section` (`graph_section`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -337,18 +380,19 @@ CREATE TABLE IF NOT EXISTS `frequency` ( -- Table structure for table `hrDevice` -- +DROP TABLE IF EXISTS `hrDevice`; CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, - `hrDeviceDescr` text NOT NULL, - `hrDeviceType` text NOT NULL, + `hrDeviceDescr` text CHARACTER SET latin1 NOT NULL, + `hrDeviceType` text CHARACTER SET latin1 NOT NULL, `hrDeviceErrors` int(11) NOT NULL, - `hrDeviceStatus` text NOT NULL, + `hrDeviceStatus` text CHARACTER SET latin1 NOT NULL, `hrProcessorLoad` tinyint(4) DEFAULT NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -356,22 +400,16 @@ CREATE TABLE IF NOT EXISTS `hrDevice` ( -- Table structure for table `ipv4_addresses` -- +DROP TABLE IF EXISTS `ipv4_addresses`; CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( `ipv4_address_id` int(11) NOT NULL AUTO_INCREMENT, - `ipv4_address` varchar(32) NOT NULL, + `ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_prefixlen` int(11) NOT NULL, - `ipv4_network_id` varchar(32) NOT NULL, + `ipv4_network_id` varchar(32) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv4_address_id`), - KEY `interface_id` (`interface_id`), - KEY `interface_id_2` (`interface_id`), - KEY `interface_id_3` (`interface_id`), - KEY `interface_id_4` (`interface_id`), - KEY `interface_id_5` (`interface_id`), - KEY `interface_id_6` (`interface_id`), - KEY `interface_id_7` (`interface_id`), - KEY `interface_id_8` (`interface_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; + KEY `interface_id` (`interface_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -379,19 +417,13 @@ CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( -- Table structure for table `ipv4_mac` -- +DROP TABLE IF EXISTS `ipv4_mac`; CREATE TABLE IF NOT EXISTS `ipv4_mac` ( `interface_id` int(11) NOT NULL, - `mac_address` varchar(32) NOT NULL, - `ipv4_address` varchar(32) NOT NULL, - KEY `interface_id` (`interface_id`), - KEY `interface_id_2` (`interface_id`), - KEY `interface_id_3` (`interface_id`), - KEY `interface_id_4` (`interface_id`), - KEY `interface_id_5` (`interface_id`), - KEY `interface_id_6` (`interface_id`), - KEY `interface_id_7` (`interface_id`), - KEY `interface_id_8` (`interface_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + `mac_address` varchar(32) CHARACTER SET latin1 NOT NULL, + `ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, + KEY `interface_id` (`interface_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -399,11 +431,12 @@ CREATE TABLE IF NOT EXISTS `ipv4_mac` ( -- Table structure for table `ipv4_networks` -- +DROP TABLE IF EXISTS `ipv4_networks`; CREATE TABLE IF NOT EXISTS `ipv4_networks` ( `ipv4_network_id` int(11) NOT NULL AUTO_INCREMENT, - `ipv4_network` varchar(64) NOT NULL, + `ipv4_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv4_network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -411,23 +444,18 @@ CREATE TABLE IF NOT EXISTS `ipv4_networks` ( -- Table structure for table `ipv6_addresses` -- +DROP TABLE IF EXISTS `ipv6_addresses`; CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( `ipv6_address_id` int(11) NOT NULL AUTO_INCREMENT, - `ipv6_address` varchar(128) NOT NULL, - `ipv6_compressed` varchar(128) NOT NULL, + `ipv6_address` varchar(128) CHARACTER SET latin1 NOT NULL, + `ipv6_compressed` varchar(128) CHARACTER SET latin1 NOT NULL, `ipv6_prefixlen` int(11) NOT NULL, - `ipv6_origin` varchar(16) NOT NULL, - `ipv6_network_id` varchar(128) NOT NULL, + `ipv6_origin` varchar(16) CHARACTER SET latin1 NOT NULL, + `ipv6_network_id` varchar(128) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv6_address_id`), - KEY `interface_id` (`interface_id`), - KEY `interface_id_2` (`interface_id`), - KEY `interface_id_3` (`interface_id`), - KEY `interface_id_4` (`interface_id`), - KEY `interface_id_5` (`interface_id`), - KEY `interface_id_6` (`interface_id`), - KEY `interface_id_7` (`interface_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; + KEY `interface_id` (`interface_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -435,11 +463,12 @@ CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( -- Table structure for table `ipv6_networks` -- +DROP TABLE IF EXISTS `ipv6_networks`; CREATE TABLE IF NOT EXISTS `ipv6_networks` ( `ipv6_network_id` int(11) NOT NULL AUTO_INCREMENT, - `ipv6_network` varchar(64) NOT NULL, + `ipv6_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv6_network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -447,12 +476,13 @@ CREATE TABLE IF NOT EXISTS `ipv6_networks` ( -- Table structure for table `juniAtmVp` -- +DROP TABLE IF EXISTS `juniAtmVp`; CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -460,6 +490,7 @@ CREATE TABLE IF NOT EXISTS `juniAtmVp` ( -- Table structure for table `links` -- +DROP TABLE IF EXISTS `links`; CREATE TABLE IF NOT EXISTS `links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `local_interface_id` int(11) DEFAULT NULL, @@ -473,7 +504,7 @@ CREATE TABLE IF NOT EXISTS `links` ( PRIMARY KEY (`id`), KEY `src_if` (`local_interface_id`), KEY `dst_if` (`remote_interface_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -481,13 +512,11 @@ CREATE TABLE IF NOT EXISTS `links` ( -- Table structure for table `mac_accounting` -- +DROP TABLE IF EXISTS `mac_accounting`; CREATE TABLE IF NOT EXISTS `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, + `mac` varchar(32) NOT NULL, `in_oid` varchar(128) NOT NULL, `out_oid` varchar(128) NOT NULL, `bps_out` int(11) NOT NULL, @@ -512,15 +541,8 @@ CREATE TABLE IF NOT EXISTS `mac_accounting` ( `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`ma_id`), - KEY `interface_id` (`interface_id`), - KEY `interface_id_2` (`interface_id`), - KEY `interface_id_3` (`interface_id`), - KEY `interface_id_4` (`interface_id`), - KEY `interface_id_5` (`interface_id`), - KEY `interface_id_6` (`interface_id`), - KEY `interface_id_7` (`interface_id`), - KEY `interface_id_8` (`interface_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; + KEY `interface_id` (`interface_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -528,15 +550,17 @@ CREATE TABLE IF NOT EXISTS `mac_accounting` ( -- Table structure for table `mempools` -- +DROP TABLE IF EXISTS `mempools`; CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, - `mempool_index` varchar(8) CHARACTER SET latin1 NOT NULL, + `mempool_index` varchar(16) CHARACTER SET latin1 NOT NULL, `entPhysicalIndex` int(11) DEFAULT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `mempool_type` varchar(32) CHARACTER SET latin1 NOT NULL, `mempool_precision` int(11) NOT NULL DEFAULT '1', `mempool_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, + `mempool_perc` int(11) NOT NULL, `mempool_used` bigint(16) NOT NULL, `mempool_free` bigint(16) NOT NULL, `mempool_total` bigint(16) NOT NULL, @@ -544,7 +568,131 @@ CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_lowestfree` bigint(16) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ospf_areas` +-- + +DROP TABLE IF EXISTS `ospf_areas`; +CREATE TABLE IF NOT EXISTS `ospf_areas` ( + `device_id` int(11) NOT NULL, + `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ospfImportAsExtern` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `ospfSpfRuns` int(11) NOT NULL, + `ospfAreaBdrRtrCount` int(11) NOT NULL, + `ospfAsBdrRtrCount` int(11) NOT NULL, + `ospfAreaLsaCount` int(11) NOT NULL, + `ospfAreaLsaCksumSum` int(11) NOT NULL, + `ospfAreaSummary` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ospfAreaStatus` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `device_area` (`device_id`,`ospfAreaId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ospf_instances` +-- + +DROP TABLE IF EXISTS `ospf_instances`; +CREATE TABLE IF NOT EXISTS `ospf_instances` ( + `device_id` int(11) NOT NULL, + `ospf_instance_id` int(11) NOT NULL, + `ospfRouterId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAdminStat` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfVersionNumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAreaBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfASBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfExternLsaCount` int(11) NOT NULL, + `ospfExternLsaCksumSum` int(11) NOT NULL, + `ospfTOSSupport` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfOriginateNewLsas` int(11) NOT NULL, + `ospfRxNewLsas` int(11) NOT NULL, + `ospfExtLsdbLimit` int(11) DEFAULT NULL, + `ospfMulticastExtensions` int(11) DEFAULT NULL, + `ospfExitOverflowInterval` int(11) DEFAULT NULL, + `ospfDemandExtensions` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + UNIQUE KEY `device_id` (`device_id`,`ospf_instance_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ospf_nbrs` +-- + +DROP TABLE IF EXISTS `ospf_nbrs`; +CREATE TABLE IF NOT EXISTS `ospf_nbrs` ( + `device_id` int(11) NOT NULL, + `interface_id` int(11) NOT NULL, + `ospf_nbr_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbrIpAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbrAddressLessIndex` int(11) NOT NULL, + `ospfNbrRtrId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbrOptions` int(11) NOT NULL, + `ospfNbrPriority` int(11) NOT NULL, + `ospfNbrState` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbrEvents` int(11) NOT NULL, + `ospfNbrLsRetransQLen` int(11) NOT NULL, + `ospfNbmaNbrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbmaNbrPermanence` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfNbrHelloSuppressed` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `device_id` (`device_id`,`ospf_nbr_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ospf_ports` +-- + +DROP TABLE IF EXISTS `ospf_ports`; +CREATE TABLE IF NOT EXISTS `ospf_ports` ( + `device_id` int(11) NOT NULL, + `interface_id` int(11) NOT NULL, + `ospf_port_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfIfIpAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAddressLessIf` int(11) NOT NULL, + `ospfIfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfIfType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfAdminStat` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfRtrPriority` int(11) DEFAULT NULL, + `ospfIfTransitDelay` int(11) DEFAULT NULL, + `ospfIfRetransInterval` int(11) DEFAULT NULL, + `ospfIfHelloInterval` int(11) DEFAULT NULL, + `ospfIfRtrDeadInterval` int(11) DEFAULT NULL, + `ospfIfPollInterval` int(11) DEFAULT NULL, + `ospfIfState` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfBackupDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfEvents` int(11) DEFAULT NULL, + `ospfIfAuthKey` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfStatus` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfMulticastForwarding` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfDemand` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `ospfIfAuthType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + UNIQUE KEY `device_id` (`device_id`,`ospf_port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `perf_times` +-- + +DROP TABLE IF EXISTS `perf_times`; +CREATE TABLE IF NOT EXISTS `perf_times` ( + `type` varchar(8) CHARACTER SET latin1 NOT NULL, + `doing` varchar(64) CHARACTER SET latin1 NOT NULL, + `start` int(11) NOT NULL, + `duration` double(8,2) NOT NULL, + `devices` int(11) NOT NULL, + KEY `type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -552,15 +700,16 @@ CREATE TABLE IF NOT EXISTS `mempools` ( -- Table structure for table `ports` -- +DROP TABLE IF EXISTS `ports`; CREATE TABLE IF NOT EXISTS `ports` ( `interface_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', - `port_descr_type` varchar(32) DEFAULT NULL, - `port_descr_descr` varchar(64) DEFAULT NULL, - `port_descr_circuit` varchar(64) DEFAULT NULL, + `port_descr_type` varchar(255) DEFAULT NULL, + `port_descr_descr` varchar(255) DEFAULT NULL, + `port_descr_circuit` varchar(255) DEFAULT NULL, `port_descr_speed` varchar(32) DEFAULT NULL, - `port_descr_notes` varchar(128) DEFAULT NULL, - `ifDescr` varchar(255) NOT NULL, + `port_descr_notes` varchar(255) DEFAULT NULL, + `ifDescr` varchar(255) DEFAULT NULL, `ifName` varchar(64) DEFAULT NULL, `portName` varchar(128) DEFAULT NULL, `ifIndex` int(11) DEFAULT '0', @@ -583,6 +732,7 @@ CREATE TABLE IF NOT EXISTS `ports` ( `counter_in` int(11) DEFAULT NULL, `counter_out` int(11) DEFAULT NULL, `ignore` tinyint(1) NOT NULL DEFAULT '0', + `disabled` tinyint(1) NOT NULL DEFAULT '0', `detailed` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `pagpOperationMode` varchar(32) DEFAULT NULL, @@ -623,10 +773,9 @@ CREATE TABLE IF NOT EXISTS `ports` ( `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`interface_id`), - KEY `host` (`device_id`), - KEY `snmpid` (`ifIndex`), + UNIQUE KEY `device_ifIndex` (`device_id`,`ifIndex`), KEY `if_2` (`ifDescr`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -634,6 +783,7 @@ CREATE TABLE IF NOT EXISTS `ports` ( -- Table structure for table `ports_adsl` -- +DROP TABLE IF EXISTS `ports_adsl`; CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -663,11 +813,27 @@ CREATE TABLE IF NOT EXISTS `ports_adsl` ( -- Table structure for table `ports_perms` -- +DROP TABLE IF EXISTS `ports_perms`; CREATE TABLE IF NOT EXISTS `ports_perms` ( `user_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `access_level` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ports_stack` +-- + +DROP TABLE IF EXISTS `ports_stack`; +CREATE TABLE IF NOT EXISTS `ports_stack` ( + `device_id` int(11) NOT NULL, + `interface_id_high` int(11) NOT NULL, + `interface_id_low` int(11) NOT NULL, + `ifStackStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `device_id` (`device_id`,`interface_id_high`,`interface_id_low`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -675,13 +841,14 @@ CREATE TABLE IF NOT EXISTS `ports_perms` ( -- Table structure for table `port_in_measurements` -- +DROP TABLE IF EXISTS `port_in_measurements`; CREATE TABLE IF NOT EXISTS `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, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -689,13 +856,14 @@ CREATE TABLE IF NOT EXISTS `port_in_measurements` ( -- Table structure for table `port_out_measurements` -- +DROP TABLE IF EXISTS `port_out_measurements`; CREATE TABLE IF NOT EXISTS `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, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -703,27 +871,21 @@ CREATE TABLE IF NOT EXISTS `port_out_measurements` ( -- Table structure for table `processors` -- +DROP TABLE IF EXISTS `processors`; CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `device_id` int(11) NOT NULL, - `processor_oid` varchar(128) NOT NULL, - `processor_index` varchar(32) NOT NULL, - `processor_type` varchar(16) NOT NULL, + `processor_oid` varchar(128) CHARACTER SET latin1 NOT NULL, + `processor_index` varchar(32) CHARACTER SET latin1 NOT NULL, + `processor_type` varchar(16) CHARACTER SET latin1 NOT NULL, `processor_usage` int(11) NOT NULL, - `processor_descr` varchar(64) NOT NULL, + `processor_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `processor_precision` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`processor_id`), KEY `device_id` (`device_id`), - KEY `device_id_2` (`device_id`), - KEY `device_id_3` (`device_id`), - KEY `device_id_4` (`device_id`), - KEY `device_id_5` (`device_id`), - KEY `device_id_6` (`device_id`), - KEY `device_id_7` (`device_id`), - KEY `device_id_8` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -731,6 +893,7 @@ CREATE TABLE IF NOT EXISTS `processors` ( -- Table structure for table `pseudowires` -- +DROP TABLE IF EXISTS `pseudowires`; CREATE TABLE IF NOT EXISTS `pseudowires` ( `pseudowire_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, @@ -739,7 +902,7 @@ CREATE TABLE IF NOT EXISTS `pseudowires` ( `cpwVcID` int(11) NOT NULL, `cpwOid` int(11) NOT NULL, PRIMARY KEY (`pseudowire_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -747,25 +910,30 @@ CREATE TABLE IF NOT EXISTS `pseudowires` ( -- Table structure for table `sensors` -- +DROP TABLE IF EXISTS `sensors`; CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL AUTO_INCREMENT, - `sensor_class` varchar(64) NOT NULL, + `sensor_class` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL DEFAULT '0', - `sensor_oid` varchar(64) NOT NULL, - `sensor_index` varchar(10) NOT NULL, - `sensor_type` varchar(32) NOT NULL, - `sensor_descr` varchar(32) NOT NULL DEFAULT '', - `sensor_precision` int(11) NOT NULL DEFAULT '1', + `poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp', + `sensor_oid` varchar(64) CHARACTER SET latin1 NOT NULL, + `sensor_index` varchar(10) COLLATE utf8_unicode_ci NOT NULL, + `sensor_type` varchar(32) CHARACTER SET latin1 NOT NULL, + `sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_divisor` int(11) NOT NULL DEFAULT '1', + `sensor_multiplier` int(11) NOT NULL DEFAULT '1', `sensor_current` float DEFAULT NULL, `sensor_limit` float DEFAULT NULL, `sensor_limit_warn` float DEFAULT NULL, `sensor_limit_low` float DEFAULT NULL, `sensor_limit_low_warn` float DEFAULT NULL, - `entPhysicalIndex` varchar(16) DEFAULT NULL, - `entPhysicalIndex_measured` varchar(16) DEFAULT NULL, + `entPhysicalIndex` varchar(16) CHARACTER SET latin1 DEFAULT NULL, + `entPhysicalIndex_measured` varchar(16) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`sensor_id`), - KEY `sensor_host` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; + KEY `sensor_host` (`device_id`), + KEY `sensor_class` (`sensor_class`), + KEY `sensor_type` (`sensor_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -773,6 +941,7 @@ CREATE TABLE IF NOT EXISTS `sensors` ( -- Table structure for table `services` -- +DROP TABLE IF EXISTS `services`; CREATE TABLE IF NOT EXISTS `services` ( `service_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, @@ -788,7 +957,7 @@ CREATE TABLE IF NOT EXISTS `services` ( `service_disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`service_id`), KEY `service_host` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -796,6 +965,7 @@ CREATE TABLE IF NOT EXISTS `services` ( -- Table structure for table `storage` -- +DROP TABLE IF EXISTS `storage`; CREATE TABLE IF NOT EXISTS `storage` ( `storage_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, @@ -811,14 +981,7 @@ CREATE TABLE IF NOT EXISTS `storage` ( `storage_perc_warn` int(11) DEFAULT '60', PRIMARY KEY (`storage_id`), KEY `device_id` (`device_id`), - KEY `device_id_2` (`device_id`), - KEY `device_id_3` (`device_id`), - KEY `device_id_4` (`device_id`), - KEY `device_id_5` (`device_id`), - KEY `device_id_6` (`device_id`), - KEY `device_id_7` (`device_id`), - KEY `device_id_8` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -826,6 +989,7 @@ CREATE TABLE IF NOT EXISTS `storage` ( -- Table structure for table `syslog` -- +DROP TABLE IF EXISTS `syslog`; CREATE TABLE IF NOT EXISTS `syslog` ( `device_id` int(11) DEFAULT NULL, `facility` varchar(10) DEFAULT NULL, @@ -839,7 +1003,7 @@ CREATE TABLE IF NOT EXISTS `syslog` ( PRIMARY KEY (`seq`), KEY `datetime` (`timestamp`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -847,6 +1011,7 @@ CREATE TABLE IF NOT EXISTS `syslog` ( -- Table structure for table `toner` -- +DROP TABLE IF EXISTS `toner`; CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', @@ -858,7 +1023,7 @@ CREATE TABLE IF NOT EXISTS `toner` ( `toner_current` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -866,21 +1031,15 @@ CREATE TABLE IF NOT EXISTS `toner` ( -- Table structure for table `ucd_diskio` -- +DROP TABLE IF EXISTS `ucd_diskio`; CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, - `diskio_descr` varchar(32) NOT NULL, + `diskio_descr` varchar(32) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`diskio_id`), KEY `device_id` (`device_id`), - KEY `device_id_2` (`device_id`), - KEY `device_id_3` (`device_id`), - KEY `device_id_4` (`device_id`), - KEY `device_id_5` (`device_id`), - KEY `device_id_6` (`device_id`), - KEY `device_id_7` (`device_id`), - KEY `device_id_8` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- @@ -888,17 +1047,18 @@ CREATE TABLE IF NOT EXISTS `ucd_diskio` ( -- Table structure for table `users` -- +DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(30) NOT NULL, - `password` char(32) NOT NULL, + `password` varchar(34) DEFAULT NULL, `realname` varchar(64) NOT NULL, `email` varchar(64) NOT NULL, `descr` char(30) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -906,6 +1066,7 @@ CREATE TABLE IF NOT EXISTS `users` ( -- Table structure for table `users_prefs` -- +DROP TABLE IF EXISTS `users_prefs`; CREATE TABLE IF NOT EXISTS `users_prefs` ( `user_id` int(16) NOT NULL, `pref` varchar(32) NOT NULL, @@ -913,7 +1074,7 @@ CREATE TABLE IF NOT EXISTS `users_prefs` ( PRIMARY KEY (`user_id`), UNIQUE KEY `user_id.pref` (`user_id`,`pref`), KEY `pref` (`pref`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -921,6 +1082,7 @@ CREATE TABLE IF NOT EXISTS `users_prefs` ( -- Table structure for table `vlans` -- +DROP TABLE IF EXISTS `vlans`; CREATE TABLE IF NOT EXISTS `vlans` ( `vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) DEFAULT NULL, @@ -929,7 +1091,50 @@ CREATE TABLE IF NOT EXISTS `vlans` ( `vlan_descr` text, PRIMARY KEY (`vlan_id`), KEY `device_id` (`device_id`,`vlan_vlan`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `vminfo` +-- + +DROP TABLE IF EXISTS `vminfo`; +CREATE TABLE IF NOT EXISTS `vminfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `device_id` int(11) NOT NULL, + `vm_type` varchar(16) NOT NULL DEFAULT 'vmware', + `vmwVmVMID` int(11) NOT NULL, + `vmwVmDisplayName` varchar(128) NOT NULL, + `vmwVmGuestOS` varchar(128) NOT NULL, + `vmwVmMemSize` int(11) NOT NULL, + `vmwVmCpus` int(11) NOT NULL, + `vmwVmState` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + KEY `device_id` (`device_id`), + KEY `vmwVmVMID` (`vmwVmVMID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `vmware_vminfo` +-- + +DROP TABLE IF EXISTS `vmware_vminfo`; +CREATE TABLE IF NOT EXISTS `vmware_vminfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `device_id` int(11) NOT NULL, + `vmwVmVMID` int(11) NOT NULL, + `vmwVmDisplayName` varchar(128) NOT NULL, + `vmwVmGuestOS` varchar(128) NOT NULL, + `vmwVmMemSize` int(11) NOT NULL, + `vmwVmCpus` int(11) NOT NULL, + `vmwVmState` varchar(128) NOT NULL, + PRIMARY KEY (`id`), + KEY `device_id` (`device_id`), + KEY `vmwVmVMID` (`vmwVmVMID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -937,14 +1142,14 @@ CREATE TABLE IF NOT EXISTS `vlans` ( -- Table structure for table `vrfs` -- +DROP TABLE IF EXISTS `vrfs`; CREATE TABLE IF NOT EXISTS `vrfs` ( `vrf_id` int(11) NOT NULL AUTO_INCREMENT, `vrf_oid` varchar(256) NOT NULL, - `vrf_name` varchar(32) NOT NULL, - `mplsVpnVrfRouteDistinguisher` varchar(16) NOT NULL, + `vrf_name` varchar(128) DEFAULT NULL, + `mplsVpnVrfRouteDistinguisher` varchar(128) DEFAULT NULL, `mplsVpnVrfDescription` text NOT NULL, `device_id` int(11) NOT NULL, PRIMARY KEY (`vrf_id`), KEY `device_id` (`device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8;