diff --git a/mysql-schema.sql b/mysql-schema.sql index cfe1e2197..fb05099b9 100644 --- a/mysql-schema.sql +++ b/mysql-schema.sql @@ -1,21 +1,38 @@ --- --- Table structure for table `adjacencies` --- +-- MySQL dump 10.10 +-- +-- Host: localhost Database: vostron_network +-- ------------------------------------------------------ +-- Server version 5.0.22-Debian_0ubuntu6.06.2-log -CREATE TABLE IF NOT EXISTS `adjacencies` ( +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `adjacencies` +-- + +DROP TABLE IF EXISTS `adjacencies`; +CREATE TABLE `adjacencies` ( `adj_id` int(11) NOT NULL auto_increment, `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 AUTO_INCREMENT=125 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `alerts` --- +-- -CREATE TABLE IF NOT EXISTS `alerts` ( +DROP TABLE IF 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, @@ -23,15 +40,14 @@ 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=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=882 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `customers` --- +-- -CREATE TABLE IF NOT EXISTS `customers` ( +DROP TABLE IF EXISTS `customers`; +CREATE TABLE `customers` ( `username` char(64) NOT NULL, `password` char(32) NOT NULL, `string` char(64) NOT NULL, @@ -39,17 +55,27 @@ CREATE TABLE IF NOT EXISTS `customers` ( UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- +-- +-- Table structure for table `device_uptime` +-- --- +DROP TABLE IF EXISTS `device_uptime`; +CREATE TABLE `device_uptime` ( + `device_id` int(11) NOT NULL default '0', + `device_uptime` int(11) NOT NULL default '0', + UNIQUE KEY `device_id` (`device_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -- Table structure for table `devices` --- +-- -CREATE TABLE IF NOT EXISTS `devices` ( - `id` int(11) NOT NULL auto_increment, - `hostname` varchar(64) NOT NULL default '', +DROP TABLE IF EXISTS `devices`; +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 '', + `community` varchar(32) NOT NULL default 'v05tr0n82', `snmpver` varchar(4) NOT NULL default 'v2c', `sysDescr` text, `monowall` tinyint(4) NOT NULL default '0', @@ -60,66 +86,78 @@ CREATE TABLE IF NOT EXISTS `devices` ( `os` varchar(8) NOT NULL default '', `status` tinyint(4) NOT NULL default '0', `ignore` tinyint(4) NOT NULL default '0', - `uptime` int(11) 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 (`id`), - UNIQUE KEY `hostname` (`hostname`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=55 ; + PRIMARY KEY (`device_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- +-- +-- Table structure for table `devices_attribs` +-- --- +DROP TABLE IF 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, + `attrib_value` varchar(256) NOT NULL, + PRIMARY KEY (`attrib_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -- Table structure for table `eventlog` --- +-- -CREATE TABLE IF NOT EXISTS `eventlog` ( +DROP TABLE IF EXISTS `eventlog`; +CREATE TABLE `eventlog` ( `id` int(11) NOT NULL default '0', `host` int(11) NOT NULL default '0', `interface` int(11) default NULL, `datetime` datetime NOT NULL default '0000-00-00 00:00:00', `message` text NOT NULL, - `type` int(11) NOT NULL + `type` int(11) NOT NULL, + KEY `host` (`host`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `interfaces` --- +-- -CREATE TABLE IF NOT EXISTS `interfaces` ( - `id` int(11) NOT NULL auto_increment, - `host` int(11) NOT NULL default '0', - `if` varchar(64) NOT NULL default '', - `ifIndex` int(11) NOT NULL default '0', +DROP TABLE IF EXISTS `interfaces`; +CREATE TABLE `interfaces` ( + `interface_id` int(11) NOT NULL auto_increment, + `device_id` int(11) NOT NULL default '0', + `ifDescr` varchar(64) NOT NULL, + `ifIndex` int(11) default '0', `ifSpeed` text, - `up` varchar(12) NOT NULL default '', - `up_admin` varchar(12) default NULL, + `ifOperStatus` varchar(12) default NULL, + `ifAdminStatus` varchar(12) default NULL, `ifDuplex` varchar(12) default NULL, `ifMtu` int(11) default NULL, `ifType` text, - `name` text, + `ifAlias` text, `ifPhysAddress` text, - `lastchange` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `ifHardType` varchar(64) default NULL, + `ifLastChange` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `ifVlan` int(11) default NULL, + `ifTrunk` varchar(8) default '', `ignore` tinyint(1) NOT NULL default '0', - PRIMARY KEY (`id`), - KEY `host` (`host`), + PRIMARY KEY (`interface_id`), + KEY `host` (`device_id`), KEY `snmpid` (`ifIndex`), - KEY `if_2` (`if`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3516 ; + KEY `if_2` (`ifDescr`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `ipaddr` --- +-- -CREATE TABLE IF NOT EXISTS `ipaddr` ( +DROP TABLE IF EXISTS `ipaddr`; +CREATE TABLE `ipaddr` ( `id` int(11) NOT NULL auto_increment, `addr` varchar(32) NOT NULL default '', `cidr` smallint(6) NOT NULL default '0', @@ -127,30 +165,28 @@ CREATE TABLE IF NOT EXISTS `ipaddr` ( `interface_id` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `addr` (`addr`,`cidr`,`interface_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=589 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `links` --- +-- -CREATE TABLE IF NOT EXISTS `links` ( +DROP TABLE IF EXISTS `links`; +CREATE TABLE `links` ( `id` int(11) NOT NULL auto_increment, `src_if` int(11) default NULL, `dst_if` int(11) default NULL, `active` tinyint(4) NOT NULL default '1', `cdp` int(11) default NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=568 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `logs` --- +-- -CREATE TABLE IF NOT EXISTS `logs` ( +DROP TABLE IF EXISTS `logs`; +CREATE TABLE `logs` ( `host` varchar(32) default NULL, `facility` varchar(10) default NULL, `priority` varchar(10) default NULL, @@ -166,29 +202,27 @@ CREATE TABLE IF NOT EXISTS `logs` ( KEY `datetime` (`datetime`), KEY `priority` (`priority`), KEY `facility` (`facility`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1955040 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `networks` --- +-- -CREATE TABLE IF NOT EXISTS `networks` ( +DROP TABLE IF EXISTS `networks`; +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 AUTO_INCREMENT=391 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `services` --- +-- -CREATE TABLE IF NOT EXISTS `services` ( +DROP TABLE IF EXISTS `services`; +CREATE TABLE `services` ( `service_id` int(11) NOT NULL auto_increment, `service_host` int(11) NOT NULL, `service_ip` text NOT NULL, @@ -202,15 +236,14 @@ CREATE TABLE IF NOT EXISTS `services` ( `service_message` text NOT NULL, PRIMARY KEY (`service_id`), KEY `service_host` (`service_host`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=45 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `storage` --- +-- -CREATE TABLE IF NOT EXISTS `storage` ( +DROP TABLE IF EXISTS `storage`; +CREATE TABLE `storage` ( `storage_id` int(11) NOT NULL auto_increment, `host_id` int(11) NOT NULL, `hrStorageIndex` int(11) NOT NULL, @@ -218,15 +251,14 @@ CREATE TABLE IF NOT EXISTS `storage` ( `hrStorageSize` int(11) NOT NULL, `hrStorageAllocationUnits` int(11) NOT NULL, PRIMARY KEY (`storage_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `syslog` --- +-- -CREATE TABLE IF NOT EXISTS `syslog` ( +DROP TABLE IF EXISTS `syslog`; +CREATE TABLE `syslog` ( `host` varchar(32) default NULL, `facility` varchar(10) default NULL, `priority` varchar(10) default NULL, @@ -242,15 +274,14 @@ CREATE TABLE IF NOT EXISTS `syslog` ( KEY `datetime` (`datetime`), KEY `priority` (`priority`), KEY `facility` (`facility`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1385390 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `temperature` --- +-- -CREATE TABLE IF NOT EXISTS `temperature` ( +DROP TABLE IF EXISTS `temperature`; +CREATE TABLE `temperature` ( `temp_id` int(11) NOT NULL auto_increment, `temp_host` int(11) NOT NULL default '0', `temp_oid` varchar(32) NOT NULL default '', @@ -258,15 +289,14 @@ CREATE TABLE IF NOT EXISTS `temperature` ( `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 AUTO_INCREMENT=91 ; +) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- -------------------------------------------------------- - --- +-- -- Table structure for table `users` --- +-- -CREATE TABLE IF NOT EXISTS `users` ( +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( `username` char(30) NOT NULL, `password` char(32) NOT NULL, `descr` char(30) NOT NULL, @@ -274,4 +304,27 @@ CREATE TABLE IF NOT EXISTS `users` ( UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO `users` VALUES ('admin','6033c66e583283ac','Default User',10); +-- +-- Table structure for table `vlans` +-- + +DROP TABLE IF 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, + `vlan_domain` text, + `vlan_descr` text, + PRIMARY KEY (`vlan_id`), + KEY `device_id` (`device_id`,`vlan_vlan`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +