diff --git a/LibreNMS/DB/Schema.php b/LibreNMS/DB/Schema.php index dceaaa12fc..9d68886e48 100644 --- a/LibreNMS/DB/Schema.php +++ b/LibreNMS/DB/Schema.php @@ -24,6 +24,7 @@ namespace LibreNMS\DB; +use DB; use Illuminate\Support\Str; use LibreNMS\Config; use LibreNMS\Util\Version; @@ -307,4 +308,81 @@ class Schema { return in_array($column, $this->getColumns($table)); } + + /** + * Dump the database schema to an array. + * The top level will be a list of tables + * Each table contains the keys Columns and Indexes. + * + * Each entry in the Columns array contains these keys: Field, Type, Null, Default, Extra + * Each entry in the Indexes array contains these keys: Name, Columns(array), Unique + * + * @param string $connection use a specific connection + * @return array + */ + public static function dump($connection = null) + { + $output = []; + $db_name = DB::connection($connection)->getDatabaseName(); + + foreach (DB::connection($connection)->select(DB::raw("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$db_name' ORDER BY TABLE_NAME;")) as $table) { + $table = $table->TABLE_NAME; + foreach (DB::connection($connection)->select(DB::raw("SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_DEFAULT, EXTRA FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$db_name' AND TABLE_NAME='$table'")) as $data) { + $def = [ + 'Field' => $data->COLUMN_NAME, + 'Type' => preg_replace('/int\([0-9]+\)/', 'int', $data->COLUMN_TYPE), + 'Null' => $data->IS_NULLABLE === 'YES', + 'Extra' => str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $data->EXTRA), + ]; + + if (isset($data->COLUMN_DEFAULT) && $data->COLUMN_DEFAULT != 'NULL') { + $default = trim($data->COLUMN_DEFAULT, "'"); + $def['Default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $default); + } + // MySQL 8 fix, remove DEFAULT_GENERATED from timestamp extra columns + if ($def['Type'] == 'timestamp') { + $def['Extra'] = preg_replace('/DEFAULT_GENERATED[ ]*/', '', $def['Extra']); + } + + $output[$table]['Columns'][] = $def; + } + + $keys = DB::connection($connection)->select(DB::raw("SHOW INDEX FROM `$table`")); + usort($keys, function ($a, $b) { + return $a->Key_name <=> $b->Key_name; + }); + foreach ($keys as $key) { + $key_name = $key->Key_name; + if (isset($output[$table]['Indexes'][$key_name])) { + $output[$table]['Indexes'][$key_name]['Columns'][] = $key->Column_name; + } else { + $output[$table]['Indexes'][$key_name] = [ + 'Name' => $key->Key_name, + 'Columns' => [$key->Column_name], + 'Unique' => ! $key->Non_unique, + 'Type' => $key->Index_type, + ]; + } + } + + $create = DB::connection($connection)->select(DB::raw("SHOW CREATE TABLE `$table`"))[0]; + + if (isset($create->{'Create Table'})) { + $constraint_regex = '/CONSTRAINT `(?[A-Za-z_0-9]+)` FOREIGN KEY \(`(?[A-Za-z_0-9]+)`\) REFERENCES `(?[A-Za-z_0-9]+)` \(`(?[A-Za-z_0-9]+)`\) ?(?[ A-Z]+)?/'; + $constraint_count = preg_match_all($constraint_regex, $create->{'Create Table'}, $constraints); + for ($i = 0; $i < $constraint_count; $i++) { + $constraint_name = $constraints['name'][$i]; + $output[$table]['Constraints'][$constraint_name] = [ + 'name' => $constraint_name, + 'foreign_key' => $constraints['foreign_key'][$i], + 'table' => $constraints['table'][$i], + 'key' => $constraints['key'][$i], + 'extra' => $constraints['extra'][$i], + ]; + } + } + } + + return $output; + } } diff --git a/LibreNMS/Validations/Database.php b/LibreNMS/Validations/Database.php index 6b08034d15..888956f5b2 100644 --- a/LibreNMS/Validations/Database.php +++ b/LibreNMS/Validations/Database.php @@ -124,9 +124,9 @@ class Database extends BaseValidation $db_name = dbFetchCell('SELECT DATABASE()'); // Test for correct character set and collation - $db_collation_sql = "SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME - FROM information_schema.SCHEMATA S - WHERE schema_name = '$db_name' AND + $db_collation_sql = "SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME + FROM information_schema.SCHEMATA S + WHERE schema_name = '$db_name' AND ( DEFAULT_CHARACTER_SET_NAME != 'utf8' OR DEFAULT_COLLATION_NAME != 'utf8_unicode_ci')"; $collation = dbFetchRows($db_collation_sql); if (empty($collation) !== true) { @@ -136,8 +136,8 @@ class Database extends BaseValidation ); } - $table_collation_sql = "SELECT T.TABLE_NAME, C.CHARACTER_SET_NAME, C.COLLATION_NAME - FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS C + $table_collation_sql = "SELECT T.TABLE_NAME, C.CHARACTER_SET_NAME, C.COLLATION_NAME + FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS C WHERE C.collation_name = T.table_collation AND T.table_schema = '$db_name' AND ( C.CHARACTER_SET_NAME != 'utf8' OR C.COLLATION_NAME != 'utf8_unicode_ci' );"; $collation_tables = dbFetchRows($table_collation_sql); @@ -148,7 +148,7 @@ class Database extends BaseValidation $validator->result($result); } - $column_collation_sql = "SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME + $column_collation_sql = "SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$db_name' AND ( CHARACTER_SET_NAME != 'utf8' OR COLLATION_NAME != 'utf8_unicode_ci' );"; $collation_columns = dbFetchRows($column_collation_sql); @@ -171,7 +171,7 @@ class Database extends BaseValidation } $master_schema = Yaml::parse(file_get_contents($schema_file)); - $current_schema = dump_db_schema(); + $current_schema = Schema::dump(); $schema_update = []; foreach ((array) $master_schema as $table => $data) { @@ -337,7 +337,7 @@ class Database extends BaseValidation } /** - * Generate an SQL segment to create the column based on data from dump_db_schema() + * Generate an SQL segment to create the column based on data from Schema::dump() * * @param array $column_data The array of data for the column * @return string sql fragment, for example: "`ix_id` int(10) unsigned NOT NULL" @@ -368,7 +368,7 @@ class Database extends BaseValidation } /** - * Generate an SQL segment to create the index based on data from dump_db_schema() + * Generate an SQL segment to create the index based on data from Schema::dump() * * @param array $index_data The array of data for the index * @return string sql fragment, for example: "PRIMARY KEY (`device_id`)" diff --git a/app/Console/Commands/SchemaDumpCommand.php b/app/Console/Commands/SchemaDumpCommand.php new file mode 100644 index 0000000000..b2e82cd113 --- /dev/null +++ b/app/Console/Commands/SchemaDumpCommand.php @@ -0,0 +1,72 @@ +signature .= '{--snapshots : Dump snapshots to reduce initial migration time}'; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return int + */ + public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher) + { + $database = $this->option('database'); + + if ($this->option('snapshots')) { + $databases = $database ? [$database] : ['mysql', 'testing', 'testing_persistent']; + foreach ($databases as $database) { + $this->line("Database: $database"); + $this->input->setOption('database', $database); + parent::handle($connections, $dispatcher); + } + + // in memory db doesn't dump right, copy the sqlite on-disk dump + $persistent_dump_file = base_path('/database/schema/testing_persistent-schema.dump'); + if (in_array('testing_persistent', $databases) && file_exists($persistent_dump_file)) { + copy($persistent_dump_file, base_path('/database/schema/testing_memory-schema.dump')); + } + + return 0; + } + + $stdout = new StreamOutput(fopen('php://stdout', 'w')); + $parameters = ['--force' => true, '--ansi' => true]; + if ($database) { + $parameters['--database'] = $database; + } + + \Artisan::call('migrate', $parameters, $stdout); + + $file = $this->option('path') ?: base_path('/misc/db_schema.yaml'); + $yaml = Yaml::dump(Schema::dump($database), 3, 2); + + if (file_put_contents($file, $yaml)) { + $this->info(basename($file) . ' updated!'); + + return 0; + } + + $this->error('Failed to write file ' . $file); + + return 1; + } +} diff --git a/build.sql b/build.sql deleted file mode 100644 index a6e7ab313d..0000000000 --- a/build.sql +++ /dev/null @@ -1,94 +0,0 @@ -CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `importance` int(11) NOT NULL DEFAULT '0', `device_id` int(11) NOT NULL, `message` text NOT NULL, `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `alerted` smallint(6) NOT NULL DEFAULT '0', KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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=utf8; -CREATE TABLE IF NOT EXISTS `authlog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `user` text NOT NULL, `address` text NOT NULL, `result` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bgpPeers` ( `bgpPeer_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `astext` varchar(64) NOT NULL, `bgpPeerIdentifier` text NOT NULL, `bgpPeerRemoteAs` int(11) NOT NULL, `bgpPeerState` text NOT NULL, `bgpPeerAdminStatus` text NOT NULL, `bgpLocalAddr` text NOT NULL, `bgpPeerRemoteAddr` text NOT NULL, `bgpPeerInUpdates` int(11) NOT NULL, `bgpPeerOutUpdates` int(11) NOT NULL, `bgpPeerInTotalMessages` int(11) NOT NULL, `bgpPeerOutTotalMessages` int(11) NOT NULL, `bgpPeerFsmEstablishedTime` int(11) NOT NULL, `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, PRIMARY KEY (`bgpPeer_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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=utf8; -CREATE TABLE IF NOT EXISTS `bills` ( `bill_id` int(11) NOT NULL AUTO_INCREMENT, `bill_name` text NOT NULL, `bill_type` text NOT NULL, `bill_cdr` int(11) DEFAULT NULL, `bill_day` int(11) NOT NULL DEFAULT '1', `bill_gb` int(11) DEFAULT NULL, `rate_95th_in` int(11) NOT NULL, `rate_95th_out` int(11) NOT NULL, `rate_95th` int(11) NOT NULL, `dir_95th` varchar(3) NOT NULL, `total_data` int(11) NOT NULL, `total_data_in` int(11) NOT NULL, `total_data_out` int(11) NOT NULL, `rate_average_in` int(11) NOT NULL, `rate_average_out` int(11) NOT NULL, `rate_average` int(11) NOT NULL, `bill_last_calc` datetime NOT NULL, `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=utf8 ; -CREATE TABLE IF NOT EXISTS `bill_data` ( `bill_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `period` int(11) NOT NULL, `delta` bigint(11) NOT NULL, `in_delta` bigint(11) NOT NULL, `out_delta` bigint(11) NOT NULL, KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bill_perms` ( `user_id` int(11) NOT NULL, `bill_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bill_ports` ( `bill_id` int(11) NOT NULL, `port_id` int(11) NOT NULL, `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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; -CREATE TABLE IF NOT EXISTS `customers` ( `customer_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(64) NOT NULL, `password` char(32) NOT NULL, `string` char(64) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`customer_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `dbSchema` ( `version` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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(255) COLLATE utf8_unicode_ci DEFAULT NULL, `snmpver` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT 'v2c', `port` smallint(5) unsigned 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, `version` text CHARACTER SET latin1, `hardware` text CHARACTER SET latin1, `features` text CHARACTER SET latin1, `location` text COLLATE utf8_unicode_ci, `os` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `status` tinyint(4) NOT NULL DEFAULT '0', `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, `last_discovered` timestamp NULL DEFAULT NULL, `purpose` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `serial` text COLLATE utf8_unicode_ci, PRIMARY KEY (`device_id`), KEY `status` (`status`), KEY `hostname` (`hostname`), KEY `sysName` (`sysName`), KEY `os` (`os`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `devices_attribs` ( `attrib_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `attrib_type` varchar(32) NOT NULL, `attrib_value` text NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`attrib_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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=utf8; -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; -CREATE TABLE IF NOT EXISTS `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, `entPhysicalHardwareRev` varchar(64) DEFAULT NULL, `entPhysicalFirmwareRev` varchar(64) DEFAULT NULL, `entPhysicalSoftwareRev` varchar(64) DEFAULT NULL, `entPhysicalAlias` varchar(32) DEFAULT NULL, `entPhysicalAssetID` varchar(32) DEFAULT NULL, `entPhysicalIsFRU` varchar(8) DEFAULT 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=InnoDB DEFAULT CHARSET=utf8; -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 '1000-01-01', `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=utf8 COLLATE=utf8_unicode_ci; -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; -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; -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 CHARACTER SET latin1 NOT NULL, `hrDeviceType` text CHARACTER SET latin1 NOT NULL, `hrDeviceErrors` int(11) 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=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( `ipv4_address_id` int(11) NOT NULL AUTO_INCREMENT,`ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_prefixlen` int(11) 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`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv4_mac` ( `interface_id` int(11) NOT NULL, `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; -CREATE TABLE IF NOT EXISTS `ipv4_networks` ( `ipv4_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv4_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv4_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( `ipv6_address_id` int(11) NOT NULL AUTO_INCREMENT, `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) 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`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv6_networks` ( `ipv6_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv6_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv6_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -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=utf8; -CREATE TABLE IF NOT EXISTS `links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `local_interface_id` int(11) DEFAULT NULL, `remote_interface_id` int(11) DEFAULT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `protocol` varchar(11) DEFAULT NULL, `remote_hostname` varchar(128) NOT NULL, `remote_port` varchar(128) NOT NULL, `remote_platform` varchar(128) NOT NULL, `remote_version` varchar(256) NOT NULL, PRIMARY KEY (`id`), KEY `src_if` (`local_interface_id`), KEY `dst_if` (`remote_interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `mac_accounting` ( `ma_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) 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, `bps_in` int(11) NOT NULL, `cipMacHCSwitchedBytes_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedBytes_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`ma_id`), KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `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, `mempool_largestfree` bigint(16) DEFAULT NULL, `mempool_lowestfree` bigint(16) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -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; -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; -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; -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; -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; -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(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(255) DEFAULT NULL, `ifDescr` varchar(255) DEFAULT NULL, `ifName` varchar(64) DEFAULT NULL, `portName` varchar(128) DEFAULT NULL, `ifIndex` int(11) DEFAULT '0', `ifSpeed` bigint(20) DEFAULT NULL, `ifConnectorPresent` varchar(12) DEFAULT NULL, `ifPromiscuousMode` varchar(12) DEFAULT NULL, `ifHighSpeed` int(11) DEFAULT NULL, `ifOperStatus` varchar(16) DEFAULT NULL, `ifAdminStatus` varchar(16) DEFAULT NULL, `ifDuplex` varchar(12) DEFAULT NULL, `ifMtu` int(11) DEFAULT NULL, `ifType` text, `ifAlias` text, `ifPhysAddress` text, `ifHardType` varchar(64) DEFAULT NULL, `ifLastChange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `ifVlan` varchar(8) NOT NULL DEFAULT '', `ifTrunk` varchar(8) DEFAULT '', `ifVrf` int(11) NOT NULL, `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, `pagpPortState` varchar(16) DEFAULT NULL, `pagpPartnerDeviceId` varchar(48) DEFAULT NULL, `pagpPartnerLearnMethod` varchar(16) DEFAULT NULL, `pagpPartnerIfIndex` int(11) DEFAULT NULL, `pagpPartnerGroupIfIndex` int(11) DEFAULT NULL, `pagpPartnerDeviceName` varchar(128) DEFAULT NULL, `pagpEthcOperationMode` varchar(16) DEFAULT NULL, `pagpDeviceId` varchar(48) DEFAULT NULL, `pagpGroupIfIndex` int(11) DEFAULT NULL, `ifInUcastPkts` bigint(20) DEFAULT NULL, `ifInUcastPkts_prev` bigint(20) DEFAULT NULL, `ifInUcastPkts_delta` bigint(20) DEFAULT NULL, `ifInUcastPkts_rate` int(11) DEFAULT NULL, `ifOutUcastPkts` bigint(20) DEFAULT NULL, `ifOutUcastPkts_prev` bigint(20) DEFAULT NULL, `ifOutUcastPkts_delta` bigint(20) DEFAULT NULL, `ifOutUcastPkts_rate` int(11) DEFAULT NULL, `ifInErrors` bigint(20) DEFAULT NULL, `ifInErrors_prev` bigint(20) DEFAULT NULL, `ifInErrors_delta` bigint(20) DEFAULT NULL, `ifInErrors_rate` int(11) DEFAULT NULL, `ifOutErrors` bigint(20) DEFAULT NULL, `ifOutErrors_prev` bigint(20) DEFAULT NULL, `ifOutErrors_delta` bigint(20) DEFAULT NULL, `ifOutErrors_rate` int(11) DEFAULT NULL, `ifInOctets` bigint(20) DEFAULT NULL, `ifInOctets_prev` bigint(20) DEFAULT NULL, `ifInOctets_delta` bigint(20) DEFAULT NULL, `ifInOctets_rate` int(11) DEFAULT NULL, `ifOutOctets` bigint(20) DEFAULT NULL, `ifOutOctets_prev` bigint(20) DEFAULT NULL, `ifOutOctets_delta` bigint(20) DEFAULT NULL, `ifOutOctets_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`interface_id`), UNIQUE KEY `device_ifIndex` (`device_id`,`ifIndex`), KEY `if_2` (`ifDescr`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -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=utf8; -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; -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=utf8; -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=utf8; -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) 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) CHARACTER SET latin1 NOT NULL, `processor_precision` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`processor_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `pseudowires` ( `pseudowire_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `peer_device_id` int(11) NOT NULL, `peer_ldp_id` int(11) NOT NULL, `cpwVcID` int(11) NOT NULL, `cpwOid` int(11) NOT NULL, PRIMARY KEY (`pseudowire_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL AUTO_INCREMENT, `sensor_class` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL DEFAULT '0', `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(255) 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) CHARACTER SET latin1 DEFAULT NULL, `entPhysicalIndex_measured` varchar(16) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`), KEY `sensor_class` (`sensor_class`), KEY `sensor_type` (`sensor_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `services` ( `service_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `service_ip` text NOT NULL, `service_type` varchar(16) NOT NULL, `service_desc` text NOT NULL, `service_param` text NOT NULL, `service_ignore` tinyint(1) NOT NULL, `service_status` tinyint(4) NOT NULL DEFAULT '0', `service_checked` int(11) NOT NULL DEFAULT '0', `service_changed` int(11) NOT NULL DEFAULT '0', `service_message` text NOT NULL, `service_disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`service_id`), KEY `service_host` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `storage` ( `storage_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `storage_mib` varchar(16) NOT NULL, `storage_index` int(11) NOT NULL, `storage_type` varchar(32) DEFAULT NULL, `storage_descr` text NOT NULL, `storage_size` bigint(20) NOT NULL, `storage_units` int(11) NOT NULL, `storage_used` bigint(20) NOT NULL, `storage_free` bigint(20) NOT NULL, `storage_perc` text NOT NULL, `storage_perc_warn` int(11) DEFAULT '60', PRIMARY KEY (`storage_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `syslog` ( `device_id` int(11) DEFAULT NULL, `facility` varchar(10) DEFAULT NULL, `priority` varchar(10) DEFAULT NULL, `level` varchar(10) DEFAULT NULL, `tag` varchar(10) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `program` varchar(32) DEFAULT NULL, `msg` text, `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`seq`), KEY `datetime` (`timestamp`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL DEFAULT '', `toner_capacity` int(11) NOT NULL DEFAULT '0', `toner_current` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -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) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`diskio_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(30) NOT NULL, `password` varchar(34) DEFAULT NULL, `realname` varchar(64) NOT NULL, `email` varchar(64) NOT NULL, `descr` varchar(200) DEFAULT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', `can_modify_passwd` tinyint(4) NOT NULL DEFAULT '1', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `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=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `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=InnoDB DEFAULT CHARSET=utf8; -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; -CREATE TABLE IF NOT EXISTS `vrfs` ( `vrf_id` int(11) NOT NULL AUTO_INCREMENT, `vrf_oid` varchar(256) 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=utf8; -CREATE TABLE IF NOT EXISTS `bill_history` ( `bill_hist_id` int(11) NOT NULL AUTO_INCREMENT, `bill_id` int(11) NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `bill_datefrom` datetime NOT NULL, `bill_dateto` datetime NOT NULL, `bill_type` text NOT NULL, `bill_allowed` bigint(20) NOT NULL, `bill_used` bigint(20) NOT NULL, `bill_overuse` bigint(20) NOT NULL, `bill_percent` decimal(10,2) NOT NULL, `rate_95th_in` bigint(20) NOT NULL, `rate_95th_out` bigint(20) NOT NULL, `rate_95th` bigint(20) NOT NULL, `dir_95th` varchar(3) NOT NULL, `rate_average` bigint(20) NOT NULL, `rate_average_in` bigint(20) NOT NULL, `rate_average_out` bigint(20) NOT NULL, `traf_in` bigint(20) NOT NULL, `traf_out` bigint(20) NOT NULL, `traf_total` bigint(20) NOT NULL, `pdf` longblob, PRIMARY KEY (`bill_hist_id`), UNIQUE KEY `unique_index` (`bill_id`,`bill_datefrom`,`bill_dateto`), KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `cmpMemPool` ( `cmp_id` int(11) NOT NULL auto_increment, `Index` varchar(8) NOT NULL, `cmpName` varchar(32) NOT NULL, `cmpValid` varchar(8) NOT NULL, `device_id` int(11) NOT NULL, `cmpUsed` int(11) NOT NULL, `cmpFree` int(11) NOT NULL, `cmpLargestFree` int(11) NOT NULL, `cmpAlternate` tinyint(4) default NULL, PRIMARY KEY (`cmp_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -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, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text NOT NULL, `hrProcessorLoad` tinyint(4) default NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `voltage` ( `volt_id` int(11) NOT NULL auto_increment, `volt_host` int(11) NOT NULL default '0', `volt_oid` varchar(64) NOT NULL, `volt_descr` varchar(32) NOT NULL default '', `volt_precision` int(11) NOT NULL default '1', `volt_current` int(11) NOT NULL default '0', `volt_limit` int(11) NOT NULL default '60', PRIMARY KEY (`volt_id`), KEY `volt_host` (`volt_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `fanspeed` ( `fan_id` int(11) NOT NULL auto_increment, `fan_host` int(11) NOT NULL default '0', `fan_oid` varchar(64) NOT NULL, `fan_descr` varchar(32) NOT NULL default '', `fan_precision` int(11) NOT NULL default '1', `fan_current` int(11) NOT NULL default '0', `fan_limit` int(11) NOT NULL default '60', PRIMARY KEY (`fan_id`), KEY `fan_host` (`fan_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `device_id` int(11) NOT NULL, `processor_oid` int(11) NOT NULL, `processor_type` int(11) NOT NULL, `processor_usage` int(11) NOT NULL, `processor_description` varchar(64) NOT NULL, PRIMARY KEY (`processor_id`), KEY `cpuCPU_id` (`processor_id`,`device_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `mempool_index` varchar(8) 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(32) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, `mempool_used` int(11) NOT NULL, `mempool_free` int(11) NOT NULL, `mempool_total` int(11) NOT NULL, `mempool_largestfree` int(11) DEFAULT NULL, `mempool_lowestfree` int(11) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; -CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL, PRIMARY KEY (`juniAtmVp_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL default '', `toner_capacity` int(11) NOT NULL default '0', `toner_current` int(11) NOT NULL default '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -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(8) 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=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -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, PRIMARY KEY (`diskio_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -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=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL auto_increment, `sensor_class` varchar(64) NOT NULL, `device_id` int(11) NOT NULL default '0', `sensor_oid` varchar(64) NOT NULL, `sensor_index` varchar(8) NOT NULL, `sensor_type` varchar(32) NOT NULL, `sensor_descr` varchar(32) NOT NULL default '', `sensor_precision` 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, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -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; -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; -CREATE TABLE IF NOT EXISTS `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; -CREATE TABLE IF NOT EXISTS `cef_switching` ( `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 NOT NULL , `updated_prev` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -UPDATE sensors SET sensor_class='frequency' WHERE sensor_class='freq'; -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; -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; -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`,`interface_id`,`ospf_port_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -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; -CREATE TABLE IF NOT EXISTS `ports_stack` (`interface_id_high` INT NOT NULL ,`interface_id_low` INT NOT NULL) ENGINE = INNODB; -CREATE TABLE IF NOT EXISTS `ipsec_tunnels` ( `tunnel_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `peer_port` int(11) NOT NULL, `peer_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_port` int(11) NOT NULL, `tunnel_name` varchar(96) COLLATE utf8_unicode_ci NOT NULL, `tunnel_status` varchar(11) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`tunnel_id`), UNIQUE KEY `unique_index` (`device_id`,`peer_addr`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `loadbalancer_rservers` ( `rserver_id` int(11) NOT NULL AUTO_INCREMENT, `farm_id` varchar(128) CHARACTER SET utf8 NOT NULL, `device_id` int(11) NOT NULL, `StateDescr` varchar(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`rserver_id`)) ENGINE=MyISAM AUTO_INCREMENT=514 DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `loadbalancer_vservers` ( `classmap_id` int(11) NOT NULL, `classmap` varchar(128) NOT NULL, `serverstate` varchar(64) NOT NULL, `device_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; -CREATE TABLE IF NOT EXISTS `packages` ( `pkg_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `name` varchar(64) NOT NULL, `manager` varchar(16) NOT NULL default '1', `status` tinyint(1) NOT NULL, `version` varchar(64) NOT NULL, `build` varchar(64) NOT NULL, `arch` varchar(16) NOT NULL, `size` bigint(20) default NULL, PRIMARY KEY (`pkg_id`), UNIQUE KEY `unique_key` (`device_id`,`name`,`manager`,`arch`,`version`,`build`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; -CREATE TABLE IF NOT EXISTS `slas` ( `sla_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `sla_nr` int(11) NOT NULL, `owner` varchar(255) NOT NULL, `tag` varchar(255) NOT NULL, `rtt_type` varchar(16) NOT NULL, `status` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`sla_id`), UNIQUE KEY `unique_key` (`device_id`,`sla_nr`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; -CREATE TABLE IF NOT EXISTS `munin_plugins` ( `mplug_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `mplug_type` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `mplug_instance` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_info` text CHARACTER SET utf8 COLLATE utf8_bin, `mplug_vlabel` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_args` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_total` binary(1) NOT NULL DEFAULT '0', `mplug_graph` binary(1) NOT NULL DEFAULT '1', PRIMARY KEY (`mplug_id`), UNIQUE KEY `UNIQUE` (`device_id`,`mplug_type`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; -CREATE TABLE IF NOT EXISTS `munin_plugins_ds` ( `mplug_id` int(11) NOT NULL, `ds_name` varchar(32) COLLATE utf8_bin NOT NULL, `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_bin NOT NULL DEFAULT 'GAUGE', `ds_label` varchar(64) COLLATE utf8_bin NOT NULL, `ds_cdef` text COLLATE utf8_bin NOT NULL, `ds_draw` varchar(64) COLLATE utf8_bin NOT NULL, `ds_graph` enum('no','yes') COLLATE utf8_bin NOT NULL DEFAULT 'yes', `ds_info` varchar(255) COLLATE utf8_bin NOT NULL, `ds_extinfo` text COLLATE utf8_bin NOT NULL, `ds_max` varchar(32) COLLATE utf8_bin NOT NULL, `ds_min` varchar(32) COLLATE utf8_bin NOT NULL, `ds_negative` varchar(32) COLLATE utf8_bin NOT NULL, `ds_warning` varchar(32) COLLATE utf8_bin NOT NULL, `ds_critical` varchar(32) COLLATE utf8_bin NOT NULL, `ds_colour` varchar(32) COLLATE utf8_bin NOT NULL, `ds_sum` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `ds_stack` text COLLATE utf8_bin NOT NULL, `ds_line` varchar(64) COLLATE utf8_bin NOT NULL, UNIQUE KEY `splug_id` (`mplug_id`,`ds_name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -CREATE TABLE IF NOT EXISTS `access_points` ( `accesspoint_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `radio_number` tinyint(4) DEFAULT NULL, `type` varchar(16) NOT NULL, `mac_addr` varchar(24) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `channel` tinyint(4) unsigned NOT NULL DEFAULT '0', `txpow` tinyint(4) NOT NULL DEFAULT '0', `radioutil` tinyint(4) NOT NULL DEFAULT '0', `numasoclients` smallint(6) NOT NULL DEFAULT '0', `nummonclients` smallint(6) NOT NULL DEFAULT '0', `numactbssid` tinyint(4) NOT NULL DEFAULT '0', `nummonbssid` tinyint(4) NOT NULL DEFAULT '0', `interference` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`accesspoint_id`), KEY `deleted` (`deleted`), KEY `name` (`name`,`radio_number`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Points'; diff --git a/database/schema/mysql-schema.dump b/database/schema/mysql-schema.dump new file mode 100644 index 0000000000..30ca06e3eb --- /dev/null +++ b/database/schema/mysql-schema.dump @@ -0,0 +1,2510 @@ +/*!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 */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `access_points` ( + `accesspoint_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `radio_number` tinyint(4) DEFAULT NULL, + `type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `mac_addr` varchar(24) COLLATE utf8_unicode_ci NOT NULL, + `deleted` tinyint(1) NOT NULL DEFAULT 0, + `channel` tinyint(3) unsigned NOT NULL DEFAULT 0, + `txpow` tinyint(4) NOT NULL DEFAULT 0, + `radioutil` tinyint(4) NOT NULL DEFAULT 0, + `numasoclients` smallint(6) NOT NULL DEFAULT 0, + `nummonclients` smallint(6) NOT NULL DEFAULT 0, + `numactbssid` tinyint(4) NOT NULL DEFAULT 0, + `nummonbssid` tinyint(4) NOT NULL DEFAULT 0, + `interference` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`accesspoint_id`), + KEY `name` (`name`,`radio_number`), + KEY `access_points_deleted_index` (`deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_device_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_device_map_rule_id_device_id_unique` (`rule_id`,`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_group_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `group_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_group_map_rule_id_group_id_unique` (`rule_id`,`group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_location_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `location_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_location_map_rule_id_location_id_uindex` (`rule_id`,`location_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `state` int(11) NOT NULL, + `details` longblob DEFAULT NULL, + `time_logged` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `alert_log_rule_id_index` (`rule_id`), + KEY `alert_log_device_id_index` (`device_id`), + KEY `alert_log_time_logged_index` (`time_logged`), + KEY `alert_log_rule_id_device_id_index` (`rule_id`,`device_id`), + KEY `alert_log_rule_id_device_id_state_index` (`rule_id`,`device_id`,`state`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_rules` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule` text COLLATE utf8_unicode_ci NOT NULL, + `severity` enum('ok','warning','critical') COLLATE utf8_unicode_ci NOT NULL, + `extra` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `disabled` tinyint(1) NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `query` text COLLATE utf8_unicode_ci NOT NULL, + `builder` text COLLATE utf8_unicode_ci NOT NULL, + `proc` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `invert_map` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_rules_name_unique` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_schedulables` ( + `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `schedule_id` int(10) unsigned NOT NULL, + `alert_schedulable_id` int(10) unsigned NOT NULL, + `alert_schedulable_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`item_id`), + KEY `schedulable_morph_index` (`alert_schedulable_type`,`alert_schedulable_id`), + KEY `alert_schedulables_schedule_id_index` (`schedule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_schedule` ( + `schedule_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `recurring` tinyint(1) unsigned NOT NULL DEFAULT 0, + `start` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `end` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `recurring_day` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`schedule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_template_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `alert_templates_id` int(10) unsigned NOT NULL, + `alert_rule_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `alert_templates_id` (`alert_templates_id`,`alert_rule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `template` longtext COLLATE utf8_unicode_ci NOT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `title_rec` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transport_groups` ( + `transport_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transport_group_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`transport_group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transport_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `transport_or_group_id` int(10) unsigned NOT NULL, + `target_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transports` ( + `transport_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transport_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + `transport_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'mail', + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `transport_config` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`transport_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alerts` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `rule_id` int(10) unsigned NOT NULL, + `state` int(11) NOT NULL, + `alerted` int(11) NOT NULL, + `open` int(11) NOT NULL, + `note` text COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `info` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alerts_device_id_rule_id_unique` (`device_id`,`rule_id`), + KEY `alerts_device_id_index` (`device_id`), + KEY `alerts_rule_id_index` (`rule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `api_tokens` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `token_hash` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `disabled` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `api_tokens_token_hash_unique` (`token_hash`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `application_metrics` ( + `app_id` int(10) unsigned NOT NULL, + `metric` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `value` double DEFAULT NULL, + `value_prev` double DEFAULT NULL, + UNIQUE KEY `application_metrics_app_id_metric_unique` (`app_id`,`metric`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `applications` ( + `app_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `app_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `app_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UNKNOWN', + `discovered` tinyint(4) NOT NULL DEFAULT 0, + `app_state_prev` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `app_status` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `app_instance` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`app_id`), + UNIQUE KEY `applications_device_id_app_type_unique` (`device_id`,`app_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `authlog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `datetime` timestamp NOT NULL DEFAULT current_timestamp(), + `user` text COLLATE utf8_unicode_ci NOT NULL, + `address` text COLLATE utf8_unicode_ci NOT NULL, + `result` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `availability` ( + `availability_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `duration` bigint(20) NOT NULL, + `availability_perc` decimal(9,6) NOT NULL DEFAULT 0.000000, + PRIMARY KEY (`availability_id`), + UNIQUE KEY `availability_device_id_duration_unique` (`device_id`,`duration`), + KEY `availability_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bgpPeers` ( + `bgpPeer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vrf_id` int(10) unsigned DEFAULT NULL, + `astext` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerIdentifier` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerRemoteAs` bigint(20) NOT NULL, + `bgpPeerState` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerAdminStatus` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerLastErrorCode` int(11) DEFAULT NULL, + `bgpPeerLastErrorSubCode` int(11) DEFAULT NULL, + `bgpPeerLastErrorText` varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL, + `bgpLocalAddr` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerRemoteAddr` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerDescr` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `bgpPeerInUpdates` int(11) NOT NULL, + `bgpPeerOutUpdates` int(11) NOT NULL, + `bgpPeerInTotalMessages` int(11) NOT NULL, + `bgpPeerOutTotalMessages` int(11) NOT NULL, + `bgpPeerFsmEstablishedTime` int(11) NOT NULL, + `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`bgpPeer_id`), + KEY `bgppeers_device_id_context_name_index` (`device_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bgpPeers_cbgp` ( + `device_id` int(10) unsigned NOT NULL, + `bgpPeerIdentifier` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `afi` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `safi` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `AcceptedPrefixes` int(11) NOT NULL, + `DeniedPrefixes` int(11) NOT NULL, + `PrefixAdminLimit` int(11) NOT NULL, + `PrefixThreshold` int(11) NOT NULL, + `PrefixClearThreshold` int(11) NOT NULL, + `AdvertisedPrefixes` int(11) NOT NULL, + `SuppressedPrefixes` int(11) NOT NULL, + `WithdrawnPrefixes` int(11) NOT NULL, + `AcceptedPrefixes_delta` int(11) NOT NULL, + `AcceptedPrefixes_prev` int(11) NOT NULL, + `DeniedPrefixes_delta` int(11) NOT NULL, + `DeniedPrefixes_prev` int(11) NOT NULL, + `AdvertisedPrefixes_delta` int(11) NOT NULL, + `AdvertisedPrefixes_prev` int(11) NOT NULL, + `SuppressedPrefixes_delta` int(11) NOT NULL, + `SuppressedPrefixes_prev` int(11) NOT NULL, + `WithdrawnPrefixes_delta` int(11) NOT NULL, + `WithdrawnPrefixes_prev` int(11) NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + UNIQUE KEY `bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique` (`device_id`,`bgpPeerIdentifier`,`afi`,`safi`), + KEY `bgppeers_cbgp_device_id_bgppeeridentifier_context_name_index` (`device_id`,`bgpPeerIdentifier`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_data` ( + `bill_id` int(10) unsigned NOT NULL, + `timestamp` datetime NOT NULL, + `period` int(11) NOT NULL, + `delta` bigint(20) NOT NULL, + `in_delta` bigint(20) NOT NULL, + `out_delta` bigint(20) NOT NULL, + PRIMARY KEY (`bill_id`,`timestamp`), + KEY `bill_data_bill_id_index` (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_history` ( + `bill_hist_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `bill_id` int(10) unsigned NOT NULL, + `updated` timestamp NOT NULL DEFAULT current_timestamp(), + `bill_datefrom` datetime NOT NULL, + `bill_dateto` datetime NOT NULL, + `bill_type` text COLLATE utf8_unicode_ci NOT NULL, + `bill_allowed` bigint(20) NOT NULL, + `bill_used` bigint(20) NOT NULL, + `bill_overuse` bigint(20) NOT NULL, + `bill_percent` decimal(10,2) NOT NULL, + `rate_95th_in` bigint(20) NOT NULL, + `rate_95th_out` bigint(20) NOT NULL, + `rate_95th` bigint(20) NOT NULL, + `dir_95th` varchar(3) COLLATE utf8_unicode_ci NOT NULL, + `rate_average` bigint(20) NOT NULL, + `rate_average_in` bigint(20) NOT NULL, + `rate_average_out` bigint(20) NOT NULL, + `traf_in` bigint(20) NOT NULL, + `traf_out` bigint(20) NOT NULL, + `traf_total` bigint(20) NOT NULL, + `pdf` longblob DEFAULT NULL, + PRIMARY KEY (`bill_hist_id`), + UNIQUE KEY `bill_history_bill_id_bill_datefrom_bill_dateto_unique` (`bill_id`,`bill_datefrom`,`bill_dateto`), + KEY `bill_history_bill_id_index` (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `bill_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_port_counters` ( + `port_id` int(10) unsigned NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `in_counter` bigint(20) DEFAULT NULL, + `in_delta` bigint(20) NOT NULL DEFAULT 0, + `out_counter` bigint(20) DEFAULT NULL, + `out_delta` bigint(20) NOT NULL DEFAULT 0, + `bill_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`port_id`,`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_ports` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `bill_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bills` ( + `bill_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `bill_name` text COLLATE utf8_unicode_ci NOT NULL, + `bill_type` text COLLATE utf8_unicode_ci NOT NULL, + `bill_cdr` bigint(20) DEFAULT NULL, + `bill_day` int(11) NOT NULL DEFAULT 1, + `bill_quota` bigint(20) DEFAULT NULL, + `rate_95th_in` bigint(20) NOT NULL, + `rate_95th_out` bigint(20) NOT NULL, + `rate_95th` bigint(20) NOT NULL, + `dir_95th` varchar(3) COLLATE utf8_unicode_ci NOT NULL, + `total_data` bigint(20) NOT NULL, + `total_data_in` bigint(20) NOT NULL, + `total_data_out` bigint(20) NOT NULL, + `rate_average_in` bigint(20) NOT NULL, + `rate_average_out` bigint(20) NOT NULL, + `rate_average` bigint(20) NOT NULL, + `bill_last_calc` datetime NOT NULL, + `bill_custid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `bill_ref` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `bill_notes` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + `bill_autoadded` tinyint(1) NOT NULL, + PRIMARY KEY (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache` ( + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `value` text COLLATE utf8_unicode_ci NOT NULL, + `expiration` int(11) NOT NULL, + UNIQUE KEY `cache_key_unique` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache_locks` ( + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `expiration` int(11) NOT NULL, + PRIMARY KEY (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `callback` ( + `callback_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` char(64) COLLATE utf8_unicode_ci NOT NULL, + `value` char(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`callback_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cef_switching` ( + `cef_switching_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned 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(10) unsigned NOT NULL, + `updated_prev` int(10) unsigned NOT NULL, + PRIMARY KEY (`cef_switching_id`), + UNIQUE KEY `cef_switching_device_id_entphysicalindex_afi_cef_index_unique` (`device_id`,`entPhysicalIndex`,`afi`,`cef_index`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ciscoASA` ( + `ciscoASA_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `oid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `data` bigint(20) NOT NULL, + `high_alert` bigint(20) NOT NULL, + `low_alert` bigint(20) NOT NULL, + `disabled` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`ciscoASA_id`), + KEY `ciscoasa_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each component, unique index', + `device_id` int(10) unsigned NOT NULL COMMENT 'device_id from the devices table', + `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'name from the component_type table', + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Display label for the component', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'The status of the component, retreived from the device', + `disabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Should this component be polled', + `ignore` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Should this component be alerted on', + `error` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Error message if in Alert state', + PRIMARY KEY (`id`), + KEY `component_device_id_index` (`device_id`), + KEY `component_type_index` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component_prefs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each entry', + `component` int(10) unsigned NOT NULL COMMENT 'id from the component table', + `attribute` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Attribute for the Component', + `value` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Value for the Component', + PRIMARY KEY (`id`), + KEY `component_prefs_component_index` (`component`), + CONSTRAINT `component_prefs_ibfk_1` FOREIGN KEY (`component`) REFERENCES `component` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component_statuslog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each log entry, unique index', + `component_id` int(10) unsigned NOT NULL COMMENT 'id from the component table', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'The status that the component was changed TO', + `message` text COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'When the status of the component was changed', + PRIMARY KEY (`id`), + KEY `component_statuslog_component_id_index` (`component_id`), + CONSTRAINT `component_statuslog_ibfk_1` FOREIGN KEY (`component_id`) REFERENCES `component` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `config` ( + `config_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `config_value` varchar(512) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`config_id`), + UNIQUE KEY `config_config_name_unique` (`config_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customers` ( + `customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` char(64) COLLATE utf8_unicode_ci NOT NULL, + `password` char(32) COLLATE utf8_unicode_ci NOT NULL, + `string` char(64) COLLATE utf8_unicode_ci NOT NULL, + `level` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`customer_id`), + UNIQUE KEY `customers_username_unique` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customoids` ( + `customoid_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `customoid_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', + `customoid_deleted` tinyint(4) NOT NULL DEFAULT 0, + `customoid_current` double DEFAULT NULL, + `customoid_prev` double DEFAULT NULL, + `customoid_oid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `customoid_datatype` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GAUGE', + `customoid_unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, + `customoid_divisor` int(10) unsigned NOT NULL DEFAULT 1, + `customoid_multiplier` int(10) unsigned NOT NULL DEFAULT 1, + `customoid_limit` double DEFAULT NULL, + `customoid_limit_warn` double DEFAULT NULL, + `customoid_limit_low` double DEFAULT NULL, + `customoid_limit_low_warn` double DEFAULT NULL, + `customoid_alert` tinyint(4) NOT NULL DEFAULT 0, + `customoid_passed` tinyint(4) NOT NULL DEFAULT 0, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `user_func` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`customoid_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dashboards` ( + `dashboard_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL DEFAULT 0, + `dashboard_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `access` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`dashboard_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dbSchema` ( + `version` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_graphs` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `graph` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `device_graphs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_group_device` ( + `device_group_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`device_group_id`,`device_id`), + KEY `device_group_device_device_group_id_index` (`device_group_id`), + KEY `device_group_device_device_id_index` (`device_id`), + CONSTRAINT `device_group_device_device_group_id_foreign` FOREIGN KEY (`device_group_id`) REFERENCES `device_groups` (`id`) ON DELETE CASCADE, + CONSTRAINT `device_group_device_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_groups` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', + `type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'dynamic', + `rules` text COLLATE utf8_unicode_ci DEFAULT NULL, + `pattern` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `device_groups_name_unique` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_outages` ( + `device_id` int(10) unsigned NOT NULL, + `going_down` bigint(20) NOT NULL, + `up_again` bigint(20) DEFAULT NULL, + UNIQUE KEY `device_outages_device_id_going_down_unique` (`device_id`,`going_down`), + KEY `device_outages_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_perf` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `timestamp` datetime NOT NULL, + `xmt` int(11) NOT NULL, + `rcv` int(11) NOT NULL, + `loss` int(11) NOT NULL, + `min` double(8,2) NOT NULL, + `max` double(8,2) NOT NULL, + `avg` double(8,2) NOT NULL, + `debug` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `device_perf_device_id_index` (`device_id`), + KEY `device_perf_device_id_timestamp_index` (`device_id`,`timestamp`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_relationships` ( + `parent_device_id` int(10) unsigned NOT NULL DEFAULT 0, + `child_device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`parent_device_id`,`child_device_id`), + KEY `device_relationships_child_device_id_index` (`child_device_id`), + CONSTRAINT `device_relationship_child_device_id_fk` FOREIGN KEY (`child_device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE, + CONSTRAINT `device_relationship_parent_device_id_fk` FOREIGN KEY (`parent_device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices` ( + `device_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `inserted` timestamp NULL DEFAULT current_timestamp(), + `hostname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `sysName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ip` varbinary(16) DEFAULT NULL, + `overwrite_ip` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, + `community` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `authlevel` enum('noAuthNoPriv','authNoPriv','authPriv') COLLATE utf8_unicode_ci DEFAULT NULL, + `authname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `authpass` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `authalgo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `cryptopass` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `cryptoalgo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `snmpver` varchar(4) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'v2c', + `port` smallint(5) unsigned 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, + `snmp_disable` tinyint(1) NOT NULL DEFAULT 0, + `bgpLocalAs` int(10) unsigned DEFAULT NULL, + `sysObjectID` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `sysDescr` text COLLATE utf8_unicode_ci DEFAULT NULL, + `sysContact` text COLLATE utf8_unicode_ci DEFAULT NULL, + `version` text COLLATE utf8_unicode_ci DEFAULT NULL, + `hardware` text COLLATE utf8_unicode_ci DEFAULT NULL, + `features` text COLLATE utf8_unicode_ci DEFAULT NULL, + `location_id` int(10) unsigned DEFAULT NULL, + `os` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` tinyint(1) NOT NULL DEFAULT 0, + `status_reason` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `ignore` tinyint(1) NOT NULL DEFAULT 0, + `disabled` tinyint(1) NOT NULL DEFAULT 0, + `uptime` bigint(20) DEFAULT NULL, + `agent_uptime` int(10) unsigned NOT NULL DEFAULT 0, + `last_polled` timestamp NULL DEFAULT NULL, + `last_poll_attempted` timestamp NULL DEFAULT NULL, + `last_polled_timetaken` double(5,2) DEFAULT NULL, + `last_discovered_timetaken` double(5,2) DEFAULT NULL, + `last_discovered` timestamp NULL DEFAULT NULL, + `last_ping` timestamp NULL DEFAULT NULL, + `last_ping_timetaken` double(8,2) DEFAULT NULL, + `purpose` text COLLATE utf8_unicode_ci DEFAULT NULL, + `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `serial` text COLLATE utf8_unicode_ci DEFAULT NULL, + `icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `poller_group` int(11) NOT NULL DEFAULT 0, + `override_sysLocation` tinyint(1) DEFAULT 0, + `notes` text COLLATE utf8_unicode_ci DEFAULT NULL, + `port_association_mode` int(11) NOT NULL DEFAULT 1, + `max_depth` int(11) NOT NULL DEFAULT 0, + `disable_notify` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`device_id`), + KEY `devices_hostname_index` (`hostname`), + KEY `devices_sysname_index` (`sysName`), + KEY `devices_os_index` (`os`), + KEY `devices_status_index` (`status`), + KEY `devices_last_polled_index` (`last_polled`), + KEY `devices_last_poll_attempted_index` (`last_poll_attempted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_attribs` ( + `attrib_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `attrib_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `attrib_value` text COLLATE utf8_unicode_ci NOT NULL, + `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`attrib_id`), + KEY `devices_attribs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_group_perms` ( + `user_id` int(10) unsigned NOT NULL, + `device_group_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`device_group_id`,`user_id`), + KEY `devices_group_perms_user_id_index` (`user_id`), + KEY `devices_group_perms_device_group_id_index` (`device_group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `devices_perms_user_id_index` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entPhysical` ( + `entPhysical_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `entPhysicalIndex` int(11) NOT NULL, + `entPhysicalDescr` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalClass` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalName` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalHardwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalFirmwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalSoftwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalAlias` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalAssetID` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIsFRU` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalModelName` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalVendorType` text COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalSerialNum` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalContainedIn` int(11) NOT NULL, + `entPhysicalParentRelPos` int(11) NOT NULL, + `entPhysicalMfgName` text COLLATE utf8_unicode_ci NOT NULL, + `ifIndex` int(11) DEFAULT NULL, + PRIMARY KEY (`entPhysical_id`), + KEY `entphysical_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entPhysical_state` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `entPhysicalIndex` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `subindex` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `group` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `key` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `device_id_index` (`device_id`,`entPhysicalIndex`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entityState` ( + `entity_state_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `entPhysical_id` int(10) unsigned DEFAULT NULL, + `entStateLastChanged` datetime DEFAULT NULL, + `entStateAdmin` int(11) DEFAULT NULL, + `entStateOper` int(11) DEFAULT NULL, + `entStateUsage` int(11) DEFAULT NULL, + `entStateAlarm` text COLLATE utf8_unicode_ci DEFAULT NULL, + `entStateStandby` int(11) DEFAULT NULL, + PRIMARY KEY (`entity_state_id`), + KEY `entitystate_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `eventlog` ( + `event_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `datetime` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `message` text COLLATE utf8_unicode_ci DEFAULT NULL, + `type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `reference` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `username` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `severity` tinyint(4) NOT NULL DEFAULT 2, + PRIMARY KEY (`event_id`), + KEY `eventlog_device_id_index` (`device_id`), + KEY `eventlog_datetime_index` (`datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `graph_types` ( + `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_subtype` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `graph_order` int(11) NOT NULL, + PRIMARY KEY (`graph_type`,`graph_subtype`,`graph_section`), + KEY `graph_types_graph_type_index` (`graph_type`), + KEY `graph_types_graph_subtype_index` (`graph_subtype`), + KEY `graph_types_graph_section_index` (`graph_section`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `hrDevice` ( + `hrDevice_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `hrDeviceIndex` int(11) NOT NULL, + `hrDeviceDescr` text COLLATE utf8_unicode_ci NOT NULL, + `hrDeviceType` text COLLATE utf8_unicode_ci NOT NULL, + `hrDeviceErrors` int(11) NOT NULL DEFAULT 0, + `hrDeviceStatus` text COLLATE utf8_unicode_ci NOT NULL, + `hrProcessorLoad` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`hrDevice_id`), + KEY `hrdevice_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipsec_tunnels` ( + `tunnel_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `peer_port` int(10) unsigned NOT NULL, + `peer_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `local_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `local_port` int(10) unsigned NOT NULL, + `tunnel_name` varchar(96) COLLATE utf8_unicode_ci NOT NULL, + `tunnel_status` varchar(11) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`tunnel_id`), + UNIQUE KEY `ipsec_tunnels_device_id_peer_addr_unique` (`device_id`,`peer_addr`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_addresses` ( + `ipv4_address_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv4_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ipv4_prefixlen` int(11) NOT NULL, + `ipv4_network_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv4_address_id`), + KEY `ipv4_addresses_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_mac` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned DEFAULT NULL, + `mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ipv4_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `ipv4_mac_port_id_index` (`port_id`), + KEY `ipv4_mac_mac_address_index` (`mac_address`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_networks` ( + `ipv4_network_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv4_network` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv4_network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv6_addresses` ( + `ipv6_address_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv6_address` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_compressed` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_prefixlen` int(11) NOT NULL, + `ipv6_origin` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_network_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv6_address_id`), + KEY `ipv6_addresses_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv6_networks` ( + `ipv6_network_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv6_network` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv6_network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `juniAtmVp` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `juniAtmVp_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `vp_id` int(10) unsigned NOT NULL, + `vp_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `juniatmvp_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `links` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `local_port_id` int(10) unsigned DEFAULT NULL, + `local_device_id` int(10) unsigned NOT NULL, + `remote_port_id` int(10) unsigned DEFAULT NULL, + `active` tinyint(1) NOT NULL DEFAULT 1, + `protocol` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_hostname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `remote_device_id` int(10) unsigned NOT NULL, + `remote_port` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `remote_platform` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_version` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `local_device_id` (`local_device_id`,`remote_device_id`), + KEY `links_local_port_id_index` (`local_port_id`), + KEY `links_remote_port_id_index` (`remote_port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `loadbalancer_rservers` ( + `rserver_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `farm_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `StateDescr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`rserver_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `loadbalancer_vservers` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `classmap_id` int(10) unsigned NOT NULL, + `classmap` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `serverstate` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `loadbalancer_vservers_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `location` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `lat` double(10,6) DEFAULT NULL, + `lng` double(10,6) DEFAULT NULL, + `timestamp` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `locations_location_unique` (`location`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mac_accounting` ( + `ma_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `mac` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `in_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `out_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `bps_out` int(11) NOT NULL, + `bps_in` int(11) NOT NULL, + `cipMacHCSwitchedBytes_input` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedBytes_output` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedPkts_input` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedPkts_output` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_rate` int(11) DEFAULT NULL, + `poll_time` int(10) unsigned DEFAULT NULL, + `poll_prev` int(10) unsigned DEFAULT NULL, + `poll_period` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`ma_id`), + KEY `mac_accounting_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mefinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `mefID` int(11) NOT NULL, + `mefType` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefIdent` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefMTU` int(11) NOT NULL DEFAULT 1500, + `mefAdmState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefRowState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `mefinfo_device_id_index` (`device_id`), + KEY `mefinfo_mefid_index` (`mefID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mempools` ( + `mempool_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mempool_index` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalIndex` int(11) DEFAULT NULL, + `hrDeviceIndex` int(11) DEFAULT NULL, + `mempool_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mempool_precision` int(11) NOT NULL DEFAULT 1, + `mempool_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mempool_perc` int(11) NOT NULL, + `mempool_used` bigint(20) NOT NULL, + `mempool_free` bigint(20) NOT NULL, + `mempool_total` bigint(20) NOT NULL, + `mempool_largestfree` bigint(20) DEFAULT NULL, + `mempool_lowestfree` bigint(20) DEFAULT NULL, + `mempool_deleted` tinyint(1) NOT NULL DEFAULT 0, + `mempool_perc_warn` int(11) DEFAULT NULL, + PRIMARY KEY (`mempool_id`), + KEY `mempools_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `migrations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `batch` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_lsp_paths` ( + `lsp_path_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `lsp_id` int(10) unsigned NOT NULL, + `path_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mplsLspPathRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathLastChange` bigint(20) NOT NULL, + `mplsLspPathType` enum('other','primary','standby','secondary') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathBandwidth` int(10) unsigned NOT NULL, + `mplsLspPathOperBandwidth` int(10) unsigned NOT NULL, + `mplsLspPathAdminState` enum('noop','inService','outOfService') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathOperState` enum('unknown','inService','outOfService','transition') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathState` enum('unknown','active','inactive') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathFailCode` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathFailNodeAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathMetric` int(10) unsigned NOT NULL, + `mplsLspPathOperMetric` int(10) unsigned DEFAULT NULL, + `mplsLspPathTimeUp` bigint(20) DEFAULT NULL, + `mplsLspPathTimeDown` bigint(20) DEFAULT NULL, + `mplsLspPathTransitionCount` int(10) unsigned DEFAULT NULL, + `mplsLspPathTunnelARHopListIndex` int(10) unsigned DEFAULT NULL, + `mplsLspPathTunnelCHopListIndex` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`lsp_path_id`), + KEY `mpls_lsp_paths_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_lsps` ( + `lsp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vrf_oid` int(10) unsigned NOT NULL, + `lsp_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mplsLspRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspLastChange` bigint(20) DEFAULT NULL, + `mplsLspName` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspAdminState` enum('noop','inService','outOfService') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspOperState` enum('unknown','inService','outOfService','transition') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspFromAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspToAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspType` enum('unknown','dynamic','static','bypassOnly','p2mpLsp','p2mpAuto','mplsTp','meshP2p','oneHopP2p','srTe','meshP2pSrTe','oneHopP2pSrTe') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspFastReroute` enum('true','false') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspAge` bigint(20) DEFAULT NULL, + `mplsLspTimeUp` bigint(20) DEFAULT NULL, + `mplsLspTimeDown` bigint(20) DEFAULT NULL, + `mplsLspPrimaryTimeUp` bigint(20) DEFAULT NULL, + `mplsLspTransitions` int(10) unsigned DEFAULT NULL, + `mplsLspLastTransition` bigint(20) DEFAULT NULL, + `mplsLspConfiguredPaths` int(10) unsigned DEFAULT NULL, + `mplsLspStandbyPaths` int(10) unsigned DEFAULT NULL, + `mplsLspOperationalPaths` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`lsp_id`), + KEY `mpls_lsps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_saps` ( + `sap_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `svc_id` int(10) unsigned NOT NULL, + `svc_oid` int(10) unsigned NOT NULL, + `sapPortId` int(10) unsigned NOT NULL, + `ifName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `sapEncapValue` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `sapRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapType` enum('unknown','epipe','tls','vprn','ies','mirror','apipe','fpipe','ipipe','cpipe','intTls','evpnIsaTls') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `sapAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapLastMgmtChange` bigint(20) DEFAULT NULL, + `sapLastStatusChange` bigint(20) DEFAULT NULL, + PRIMARY KEY (`sap_id`), + KEY `mpls_saps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_sdp_binds` ( + `bind_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sdp_id` int(10) unsigned NOT NULL, + `svc_id` int(10) unsigned NOT NULL, + `sdp_oid` int(10) unsigned NOT NULL, + `svc_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `sdpBindRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindLastMgmtChange` bigint(20) DEFAULT NULL, + `sdpBindLastStatusChange` bigint(20) DEFAULT NULL, + `sdpBindType` enum('spoke','mesh') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindVcType` enum('undef','ether','vlan','mirrior','atmSduatmCell','atmVcc','atmVpc','frDlci','ipipe','satopE1','satopT1','satopE3','satopT3','cesopsn','cesopsnCas') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindBaseStatsIngFwdPackets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsIngFwdOctets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsEgrFwdPackets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsEgrFwdOctets` bigint(20) DEFAULT NULL, + PRIMARY KEY (`bind_id`), + KEY `mpls_sdp_binds_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_sdps` ( + `sdp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sdp_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `sdpRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpDelivery` enum('gre','mpls','l2tpv3','greethbridged') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpOperStatus` enum('up','notAlive','notReady','invalidEgressInterface','transportTunnelDown','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpAdminPathMtu` int(11) DEFAULT NULL, + `sdpOperPathMtu` int(11) DEFAULT NULL, + `sdpLastMgmtChange` bigint(20) DEFAULT NULL, + `sdpLastStatusChange` bigint(20) DEFAULT NULL, + `sdpActiveLspType` enum('not-applicable','rsvp','ldp','bgp','none','mplsTp','srIsis','srOspf','srTeLsp','fpe') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpFarEndInetAddressType` enum('ipv4','ipv6') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpFarEndInetAddress` varchar(46) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`sdp_id`), + KEY `mpls_sdps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_services` ( + `svc_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `svc_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `svcRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcType` enum('unknown','epipe','tls','vprn','ies','mirror','apipe','fpipe','ipipe','cpipe','intTls','evpnIsaTls') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcCustId` int(10) unsigned DEFAULT NULL, + `svcAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `svcMtu` int(11) DEFAULT NULL, + `svcNumSaps` int(11) DEFAULT NULL, + `svcNumSdps` int(11) DEFAULT NULL, + `svcLastMgmtChange` bigint(20) DEFAULT NULL, + `svcLastStatusChange` bigint(20) DEFAULT NULL, + `svcVRouterId` int(11) DEFAULT NULL, + `svcTlsMacLearning` enum('enabled','disabled') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsStpAdminStatus` enum('enabled','disabled') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsStpOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsFdbTableSize` int(11) DEFAULT NULL, + `svcTlsFdbNumEntries` int(11) DEFAULT NULL, + PRIMARY KEY (`svc_id`), + KEY `mpls_services_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_tunnel_ar_hops` ( + `ar_hop_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mplsTunnelARHopListIndex` int(10) unsigned NOT NULL, + `mplsTunnelARHopIndex` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `lsp_path_id` int(10) unsigned NOT NULL, + `mplsTunnelARHopAddrType` enum('unknown','ipV4','ipV6','asNumber','lspid','unnum') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopIpv4Addr` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopIpv6Addr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopAsNumber` int(10) unsigned DEFAULT NULL, + `mplsTunnelARHopStrictOrLoose` enum('strict','loose') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopRouterId` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `localProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `linkProtectionInUse` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `bandwidthProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `nextNodeProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + PRIMARY KEY (`ar_hop_id`), + KEY `mpls_tunnel_ar_hops_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_tunnel_c_hops` ( + `c_hop_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mplsTunnelCHopListIndex` int(10) unsigned NOT NULL, + `mplsTunnelCHopIndex` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `lsp_path_id` int(10) unsigned DEFAULT NULL, + `mplsTunnelCHopAddrType` enum('unknown','ipV4','ipV6','asNumber','lspid','unnum') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopIpv4Addr` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopIpv6Addr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopAsNumber` int(10) unsigned DEFAULT NULL, + `mplsTunnelCHopStrictOrLoose` enum('strict','loose') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopRouterId` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`c_hop_id`), + KEY `mpls_tunnel_c_hops_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `munin_plugins` ( + `mplug_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `mplug_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `mplug_instance` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_category` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_info` text COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_vlabel` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_args` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_total` tinyint(1) NOT NULL DEFAULT 0, + `mplug_graph` tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`mplug_id`), + UNIQUE KEY `munin_plugins_device_id_mplug_type_unique` (`device_id`,`mplug_type`), + KEY `munin_plugins_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `munin_plugins_ds` ( + `mplug_id` int(10) unsigned NOT NULL, + `ds_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GAUGE', + `ds_label` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ds_cdef` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ds_draw` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ds_graph` enum('no','yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'yes', + `ds_info` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ds_extinfo` text COLLATE utf8_unicode_ci NOT NULL, + `ds_max` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_min` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_negative` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_warning` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_critical` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_colour` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_sum` text COLLATE utf8_unicode_ci NOT NULL, + `ds_stack` text COLLATE utf8_unicode_ci NOT NULL, + `ds_line` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `munin_plugins_ds_mplug_id_ds_name_unique` (`mplug_id`,`ds_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `netscaler_vservers` ( + `vsvr_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_port` int(11) NOT NULL, + `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_clients` int(11) NOT NULL, + `vsvr_server` int(11) NOT NULL, + `vsvr_req_rate` int(11) NOT NULL, + `vsvr_bps_in` int(11) NOT NULL, + `vsvr_bps_out` int(11) NOT NULL, + PRIMARY KEY (`vsvr_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `notifications` ( + `notifications_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `body` text COLLATE utf8_unicode_ci NOT NULL, + `severity` int(11) DEFAULT 0 COMMENT '0=ok,1=warning,2=critical', + `source` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `checksum` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00', + PRIMARY KEY (`notifications_id`), + UNIQUE KEY `notifications_checksum_unique` (`checksum`), + KEY `notifications_severity_index` (`severity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `notifications_attribs` ( + `attrib_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `notifications_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + PRIMARY KEY (`attrib_id`), + KEY `notifications_attribs_notifications_id_user_id_index` (`notifications_id`,`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_areas` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci DEFAULT 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_areas_device_id_ospfareaid_context_name_unique` (`device_id`,`ospfAreaId`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_instances` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `ospf_instance_id` int(10) unsigned 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_instances_device_id_ospf_instance_id_context_name_unique` (`device_id`,`ospf_instance_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_nbrs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned DEFAULT 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_nbrs_device_id_ospf_nbr_id_context_name_unique` (`device_id`,`ospf_nbr_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_ports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_ports_device_id_ospf_port_id_context_name_unique` (`device_id`,`ospf_port_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `packages` ( + `pkg_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `manager` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `status` tinyint(1) NOT NULL, + `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `build` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `arch` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `size` bigint(20) DEFAULT NULL, + PRIMARY KEY (`pkg_id`), + UNIQUE KEY `packages_device_id_name_manager_arch_version_build_unique` (`device_id`,`name`,`manager`,`arch`,`version`,`build`), + KEY `packages_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdb_ix` ( + `pdb_ix_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ix_id` int(10) unsigned NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `asn` int(10) unsigned NOT NULL, + `timestamp` int(10) unsigned NOT NULL, + PRIMARY KEY (`pdb_ix_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdb_ix_peers` ( + `pdb_ix_peers_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ix_id` int(10) unsigned NOT NULL, + `peer_id` int(10) unsigned NOT NULL, + `remote_asn` int(10) unsigned NOT NULL, + `remote_ipaddr4` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_ipaddr6` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`pdb_ix_peers_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `perf_times` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `doing` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `start` int(10) unsigned NOT NULL, + `duration` double(8,2) NOT NULL, + `devices` int(10) unsigned NOT NULL, + `poller` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `perf_times_type_index` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `plugins` ( + `plugin_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `plugin_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `plugin_active` int(11) NOT NULL, + PRIMARY KEY (`plugin_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_cluster` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `node_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `poller_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `poller_version` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `poller_groups` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `last_report` datetime NOT NULL, + `master` tinyint(1) NOT NULL, + `poller_enabled` tinyint(1) DEFAULT NULL, + `poller_frequency` int(11) DEFAULT NULL, + `poller_workers` int(11) DEFAULT NULL, + `poller_down_retry` int(11) DEFAULT NULL, + `discovery_enabled` tinyint(1) DEFAULT NULL, + `discovery_frequency` int(11) DEFAULT NULL, + `discovery_workers` int(11) DEFAULT NULL, + `services_enabled` tinyint(1) DEFAULT NULL, + `services_frequency` int(11) DEFAULT NULL, + `services_workers` int(11) DEFAULT NULL, + `billing_enabled` tinyint(1) DEFAULT NULL, + `billing_frequency` int(11) DEFAULT NULL, + `billing_calculate_frequency` int(11) DEFAULT NULL, + `alerting_enabled` tinyint(1) DEFAULT NULL, + `alerting_frequency` int(11) DEFAULT NULL, + `ping_enabled` tinyint(1) DEFAULT NULL, + `ping_frequency` int(11) DEFAULT NULL, + `update_enabled` tinyint(1) DEFAULT NULL, + `update_frequency` int(11) DEFAULT NULL, + `loglevel` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, + `watchdog_enabled` tinyint(1) DEFAULT NULL, + `watchdog_log` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `poller_cluster_node_id_unique` (`node_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_cluster_stats` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent_poller` int(10) unsigned NOT NULL DEFAULT 0, + `poller_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `depth` int(10) unsigned NOT NULL, + `devices` int(10) unsigned NOT NULL, + `worker_seconds` double unsigned NOT NULL, + `workers` int(10) unsigned NOT NULL, + `frequency` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `poller_cluster_stats_parent_poller_poller_type_unique` (`parent_poller`,`poller_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_groups` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `group_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `descr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pollers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `poller_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `last_polled` datetime NOT NULL, + `devices` int(10) unsigned NOT NULL, + `time_taken` double NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `pollers_poller_name_unique` (`poller_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports` ( + `port_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `port_descr_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_circuit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_speed` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_notes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifDescr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `portName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifIndex` bigint(20) DEFAULT 0, + `ifSpeed` bigint(20) DEFAULT NULL, + `ifSpeed_prev` bigint(20) DEFAULT NULL, + `ifConnectorPresent` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifPromiscuousMode` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifHighSpeed` int(11) DEFAULT NULL, + `ifHighSpeed_prev` int(11) DEFAULT NULL, + `ifOperStatus` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifOperStatus_prev` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAdminStatus` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAdminStatus_prev` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifDuplex` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifMtu` int(11) DEFAULT NULL, + `ifType` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAlias` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifPhysAddress` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifHardType` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifLastChange` bigint(20) unsigned NOT NULL DEFAULT 0, + `ifVlan` varchar(8) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `ifTrunk` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifVrf` int(11) NOT NULL DEFAULT 0, + `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) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPortState` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerDeviceId` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerLearnMethod` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerIfIndex` int(11) DEFAULT NULL, + `pagpPartnerGroupIfIndex` int(11) DEFAULT NULL, + `pagpPartnerDeviceName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpEthcOperationMode` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpDeviceId` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpGroupIfIndex` int(11) DEFAULT NULL, + `ifInUcastPkts` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_prev` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_delta` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_rate` bigint(20) unsigned DEFAULT NULL, + `ifInErrors` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_prev` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_delta` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_rate` bigint(20) unsigned DEFAULT NULL, + `ifInOctets` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_prev` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_delta` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_rate` bigint(20) unsigned DEFAULT NULL, + `poll_time` int(10) unsigned DEFAULT NULL, + `poll_prev` int(10) unsigned DEFAULT NULL, + `poll_period` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`port_id`), + UNIQUE KEY `ports_device_id_ifindex_unique` (`device_id`,`ifIndex`), + KEY `ports_ifdescr_index` (`ifDescr`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_adsl` ( + `port_id` int(10) unsigned NOT NULL, + `port_adsl_updated` timestamp NOT NULL DEFAULT current_timestamp(), + `adslLineCoding` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslLineType` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucInvVendorID` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, + `adslAtucCurrAtn` decimal(5,1) NOT NULL, + `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, + `adslAtucCurrAttainableRate` int(11) NOT NULL, + `adslAtucChanCurrTxRate` int(11) NOT NULL, + `adslAturInvSerialNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturInvVendorID` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturInvVersionNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturChanCurrTxRate` int(11) NOT NULL, + `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, + `adslAturCurrAtn` decimal(5,1) NOT NULL, + `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, + `adslAturCurrAttainableRate` int(11) NOT NULL, + UNIQUE KEY `ports_adsl_port_id_unique` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_fdb` ( + `ports_fdb_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `vlan_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`ports_fdb_id`), + KEY `ports_fdb_port_id_index` (`port_id`), + KEY `ports_fdb_mac_address_index` (`mac_address`), + KEY `ports_fdb_vlan_id_index` (`vlan_id`), + KEY `ports_fdb_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_nac` ( + `ports_nac_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `auth_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `domain` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `username` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `mac_address` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `ip_address` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `host_mode` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authz_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authz_by` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authc_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `method` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `timeout` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `time_left` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan` int(10) unsigned DEFAULT NULL, + `time_elapsed` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ports_nac_id`), + KEY `ports_nac_port_id_mac_address_index` (`port_id`,`mac_address`), + KEY `ports_nac_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_stack` ( + `device_id` int(10) unsigned NOT NULL, + `port_id_high` int(10) unsigned NOT NULL, + `port_id_low` int(10) unsigned NOT NULL, + `ifStackStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `ports_stack_device_id_port_id_high_port_id_low_unique` (`device_id`,`port_id_high`,`port_id_low`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_statistics` ( + `port_id` int(10) unsigned NOT NULL, + `ifInNUcastPkts` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_prev` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_delta` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_rate` int(11) DEFAULT NULL, + `ifOutNUcastPkts` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_rate` int(11) DEFAULT NULL, + `ifInDiscards` bigint(20) DEFAULT NULL, + `ifInDiscards_prev` bigint(20) DEFAULT NULL, + `ifInDiscards_delta` bigint(20) DEFAULT NULL, + `ifInDiscards_rate` int(11) DEFAULT NULL, + `ifOutDiscards` bigint(20) DEFAULT NULL, + `ifOutDiscards_prev` bigint(20) DEFAULT NULL, + `ifOutDiscards_delta` bigint(20) DEFAULT NULL, + `ifOutDiscards_rate` int(11) DEFAULT NULL, + `ifInUnknownProtos` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_prev` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_delta` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_rate` int(11) DEFAULT NULL, + `ifInBroadcastPkts` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_prev` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_delta` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_rate` int(11) DEFAULT NULL, + `ifOutBroadcastPkts` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_rate` int(11) DEFAULT NULL, + `ifInMulticastPkts` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_prev` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_delta` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_rate` int(11) DEFAULT NULL, + `ifOutMulticastPkts` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_rate` int(11) DEFAULT NULL, + PRIMARY KEY (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_stp` ( + `port_stp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `priority` tinyint(3) unsigned NOT NULL, + `state` varchar(11) COLLATE utf8_unicode_ci NOT NULL, + `enable` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `pathCost` int(10) unsigned NOT NULL, + `designatedRoot` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `designatedCost` smallint(5) unsigned NOT NULL, + `designatedBridge` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `designatedPort` mediumint(9) NOT NULL, + `forwardTransitions` int(10) unsigned NOT NULL, + PRIMARY KEY (`port_stp_id`), + UNIQUE KEY `ports_stp_device_id_port_id_unique` (`device_id`,`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_vlans` ( + `port_vlan_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `vlan` int(11) NOT NULL, + `baseport` int(11) NOT NULL, + `priority` bigint(20) NOT NULL, + `state` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `cost` int(11) NOT NULL, + `untagged` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`port_vlan_id`), + UNIQUE KEY `ports_vlans_device_id_port_id_vlan_unique` (`device_id`,`port_id`,`vlan`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `processes` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `pid` int(11) NOT NULL, + `vsz` int(11) NOT NULL, + `rss` int(11) NOT NULL, + `cputime` varchar(12) COLLATE utf8_unicode_ci NOT NULL, + `user` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `command` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `processes_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `processors` ( + `processor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entPhysicalIndex` int(11) NOT NULL DEFAULT 0, + `hrDeviceIndex` int(11) DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `processor_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `processor_index` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `processor_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `processor_usage` int(11) NOT NULL, + `processor_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `processor_precision` int(11) NOT NULL DEFAULT 1, + `processor_perc_warn` int(11) DEFAULT 75, + PRIMARY KEY (`processor_id`), + KEY `processors_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxmox` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `vmid` int(11) NOT NULL, + `cluster` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `last_seen` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `proxmox_cluster_vmid_unique` (`cluster`,`vmid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxmox_ports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vm_id` int(11) NOT NULL, + `port` varchar(10) COLLATE utf8_unicode_ci NOT NULL, + `last_seen` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `proxmox_ports_vm_id_port_unique` (`vm_id`,`port`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pseudowires` ( + `pseudowire_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `peer_device_id` int(10) unsigned NOT NULL, + `peer_ldp_id` int(11) NOT NULL, + `cpwVcID` int(11) NOT NULL, + `cpwOid` int(11) NOT NULL, + `pw_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `pw_psntype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `pw_local_mtu` int(11) NOT NULL, + `pw_peer_mtu` int(11) NOT NULL, + `pw_descr` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`pseudowire_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `route` ( + `route_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `inetCidrRouteIfIndex` bigint(20) NOT NULL, + `inetCidrRouteType` int(10) unsigned NOT NULL, + `inetCidrRouteProto` int(10) unsigned NOT NULL, + `inetCidrRouteNextHopAS` int(10) unsigned NOT NULL, + `inetCidrRouteMetric1` int(10) unsigned NOT NULL, + `inetCidrRouteDestType` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteDest` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteNextHopType` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteNextHop` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRoutePolicy` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRoutePfxLen` int(10) unsigned NOT NULL, + PRIMARY KEY (`route_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sensors` ( + `sensor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_deleted` tinyint(1) NOT NULL DEFAULT 0, + `sensor_class` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp', + `sensor_oid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `sensor_index` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `group` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_divisor` bigint(20) NOT NULL DEFAULT 1, + `sensor_multiplier` int(11) NOT NULL DEFAULT 1, + `sensor_current` double DEFAULT NULL, + `sensor_limit` double DEFAULT NULL, + `sensor_limit_warn` double DEFAULT NULL, + `sensor_limit_low` double DEFAULT NULL, + `sensor_limit_low_warn` double DEFAULT NULL, + `sensor_alert` tinyint(1) NOT NULL DEFAULT 1, + `sensor_custom` enum('No','Yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No', + `entPhysicalIndex` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIndex_measured` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `sensor_prev` double DEFAULT NULL, + `user_func` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`sensor_id`), + KEY `sensors_sensor_class_index` (`sensor_class`), + KEY `sensors_device_id_index` (`device_id`), + KEY `sensors_sensor_type_index` (`sensor_type`), + CONSTRAINT `sensors_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sensors_to_state_indexes` ( + `sensors_to_state_translations_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_id` int(10) unsigned NOT NULL, + `state_index_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`sensors_to_state_translations_id`), + UNIQUE KEY `sensors_to_state_indexes_sensor_id_state_index_id_unique` (`sensor_id`,`state_index_id`), + KEY `sensors_to_state_indexes_state_index_id_index` (`state_index_id`), + CONSTRAINT `sensors_to_state_indexes_ibfk_1` FOREIGN KEY (`state_index_id`) REFERENCES `state_indexes` (`state_index_id`), + CONSTRAINT `sensors_to_state_indexes_sensor_id_foreign` FOREIGN KEY (`sensor_id`) REFERENCES `sensors` (`sensor_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `services` ( + `service_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `service_ip` text COLLATE utf8_unicode_ci NOT NULL, + `service_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `service_desc` text COLLATE utf8_unicode_ci NOT NULL, + `service_param` text COLLATE utf8_unicode_ci NOT NULL, + `service_ignore` tinyint(1) NOT NULL, + `service_status` tinyint(4) NOT NULL DEFAULT 0, + `service_changed` int(10) unsigned NOT NULL DEFAULT 0, + `service_message` text COLLATE utf8_unicode_ci NOT NULL, + `service_disabled` tinyint(1) NOT NULL DEFAULT 0, + `service_ds` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`service_id`), + KEY `services_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `session` ( + `session_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `session_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `session_value` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `session_token` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `session_auth` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `session_expiry` int(11) NOT NULL, + PRIMARY KEY (`session_id`), + UNIQUE KEY `session_session_value_unique` (`session_value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `slas` ( + `sla_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `sla_nr` int(11) NOT NULL, + `owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `tag` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `rtt_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `status` tinyint(1) NOT NULL, + `opstatus` tinyint(1) NOT NULL DEFAULT 0, + `deleted` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`sla_id`), + UNIQUE KEY `slas_device_id_sla_nr_unique` (`device_id`,`sla_nr`), + KEY `slas_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `state_indexes` ( + `state_index_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`state_index_id`), + UNIQUE KEY `state_indexes_state_name_unique` (`state_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `state_translations` ( + `state_translation_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_index_id` int(10) unsigned NOT NULL, + `state_descr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `state_draw_graph` tinyint(1) NOT NULL, + `state_value` smallint(6) NOT NULL DEFAULT 0, + `state_generic_value` tinyint(1) NOT NULL, + `state_lastupdated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`state_translation_id`), + UNIQUE KEY `state_translations_state_index_id_state_value_unique` (`state_index_id`,`state_value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `storage` ( + `storage_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `storage_mib` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `storage_index` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `storage_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `storage_descr` text COLLATE utf8_unicode_ci NOT NULL, + `storage_size` bigint(20) NOT NULL, + `storage_units` int(11) NOT NULL, + `storage_used` bigint(20) NOT NULL DEFAULT 0, + `storage_free` bigint(20) NOT NULL DEFAULT 0, + `storage_perc` int(11) NOT NULL DEFAULT 0, + `storage_perc_warn` int(11) DEFAULT 60, + `storage_deleted` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`storage_id`), + UNIQUE KEY `storage_device_id_storage_mib_storage_index_unique` (`device_id`,`storage_mib`,`storage_index`), + KEY `storage_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stp` ( + `stp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `rootBridge` tinyint(1) NOT NULL, + `bridgeAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `protocolSpecification` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `priority` mediumint(9) NOT NULL, + `timeSinceTopologyChange` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `topChanges` mediumint(9) NOT NULL, + `designatedRoot` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `rootCost` mediumint(9) NOT NULL, + `rootPort` int(11) DEFAULT NULL, + `maxAge` mediumint(9) NOT NULL, + `helloTime` mediumint(9) NOT NULL, + `holdTime` mediumint(9) NOT NULL, + `forwardDelay` mediumint(9) NOT NULL, + `bridgeMaxAge` smallint(6) NOT NULL, + `bridgeHelloTime` smallint(6) NOT NULL, + `bridgeForwardDelay` smallint(6) NOT NULL, + PRIMARY KEY (`stp_id`), + KEY `stp_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `syslog` ( + `device_id` int(10) unsigned DEFAULT NULL, + `facility` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `priority` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `level` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `tag` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `program` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `msg` text COLLATE utf8_unicode_ci DEFAULT NULL, + `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`seq`), + KEY `syslog_priority_level_index` (`priority`,`level`), + KEY `syslog_device_id_timestamp_index` (`device_id`,`timestamp`), + KEY `syslog_device_id_index` (`device_id`), + KEY `syslog_timestamp_index` (`timestamp`), + KEY `syslog_program_index` (`program`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tnmsneinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `neID` int(11) NOT NULL, + `neType` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neName` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neLocation` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neAlarm` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neOpMode` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neOpState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `tnmsneinfo_device_id_index` (`device_id`), + KEY `tnmsneinfo_neid_index` (`neID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `toner` ( + `toner_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `toner_index` int(11) NOT NULL, + `toner_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `toner_oid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `toner_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `toner_capacity` int(11) NOT NULL DEFAULT 0, + `toner_current` int(11) NOT NULL DEFAULT 0, + `toner_capacity_oid` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`toner_id`), + KEY `toner_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `transport_group_transport` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `transport_group_id` int(10) unsigned NOT NULL, + `transport_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ucd_diskio` ( + `diskio_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `diskio_index` int(11) NOT NULL, + `diskio_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`diskio_id`), + KEY `ucd_diskio_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `auth_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `auth_id` int(11) DEFAULT NULL, + `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `realname` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `email` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `descr` char(30) COLLATE utf8_unicode_ci NOT NULL, + `level` tinyint(4) NOT NULL DEFAULT 0, + `can_modify_passwd` tinyint(1) NOT NULL DEFAULT 1, + `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01', + `updated_at` timestamp NOT NULL DEFAULT current_timestamp(), + `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + `enabled` tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`user_id`), + UNIQUE KEY `users_auth_type_username_unique` (`auth_type`,`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_prefs` ( + `user_id` int(10) unsigned NOT NULL, + `pref` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `users_prefs_user_id_pref_unique` (`user_id`,`pref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_widgets` ( + `user_widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `widget_id` int(10) unsigned NOT NULL, + `col` tinyint(4) NOT NULL, + `row` tinyint(4) NOT NULL, + `size_x` tinyint(4) NOT NULL, + `size_y` tinyint(4) NOT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `refresh` tinyint(4) NOT NULL DEFAULT 60, + `settings` text COLLATE utf8_unicode_ci NOT NULL, + `dashboard_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`user_widget_id`), + KEY `user_id` (`user_id`,`widget_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vlans` ( + `vlan_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `vlan_vlan` int(11) DEFAULT NULL, + `vlan_domain` int(11) DEFAULT NULL, + `vlan_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan_type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan_mtu` int(11) DEFAULT NULL, + PRIMARY KEY (`vlan_id`), + KEY `device_id` (`device_id`,`vlan_vlan`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vminfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vm_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'vmware', + `vmwVmVMID` int(11) NOT NULL, + `vmwVmDisplayName` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vmwVmGuestOS` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vmwVmMemSize` int(11) NOT NULL, + `vmwVmCpus` int(11) NOT NULL, + `vmwVmState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `vminfo_device_id_index` (`device_id`), + KEY `vminfo_vmwvmvmid_index` (`vmwVmVMID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vrf_lite_cisco` ( + `vrf_lite_cisco_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `intance_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT '', + `vrf_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT 'Default', + PRIMARY KEY (`vrf_lite_cisco_id`), + KEY `vrf_lite_cisco_device_id_context_name_vrf_name_index` (`device_id`,`context_name`,`vrf_name`), + KEY `vrf_lite_cisco_device_id_index` (`device_id`), + KEY `vrf_lite_cisco_context_name_index` (`context_name`), + KEY `vrf_lite_cisco_vrf_name_index` (`vrf_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vrfs` ( + `vrf_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vrf_oid` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + `vrf_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `bgpLocalAs` int(10) unsigned DEFAULT NULL, + `mplsVpnVrfRouteDistinguisher` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsVpnVrfDescription` text COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`vrf_id`), + KEY `vrfs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `widgets` ( + `widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `widget_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `widget` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `base_dimensions` varchar(10) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`widget_id`), + UNIQUE KEY `widgets_widget_unique` (`widget`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wireless_sensors` ( + `sensor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_deleted` tinyint(1) NOT NULL DEFAULT 0, + `sensor_class` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `sensor_index` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_type` varchar(255) COLLATE utf8_unicode_ci 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_aggregator` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'sum', + `sensor_current` double DEFAULT NULL, + `sensor_prev` double DEFAULT NULL, + `sensor_limit` double DEFAULT NULL, + `sensor_limit_warn` double DEFAULT NULL, + `sensor_limit_low` double DEFAULT NULL, + `sensor_limit_low_warn` double DEFAULT NULL, + `sensor_alert` tinyint(1) NOT NULL DEFAULT 1, + `sensor_custom` enum('No','Yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No', + `entPhysicalIndex` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIndex_measured` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp(), + `sensor_oids` text COLLATE utf8_unicode_ci NOT NULL, + `access_point_id` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`sensor_id`), + KEY `wireless_sensors_sensor_class_index` (`sensor_class`), + KEY `wireless_sensors_device_id_index` (`device_id`), + KEY `wireless_sensors_sensor_type_index` (`sensor_type`), + CONSTRAINT `wireless_sensors_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!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 */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +INSERT INTO `migrations` VALUES (1,'2018_07_03_091314_create_access_points_table',1); +INSERT INTO `migrations` VALUES (2,'2018_07_03_091314_create_alert_device_map_table',1); +INSERT INTO `migrations` VALUES (3,'2018_07_03_091314_create_alert_group_map_table',1); +INSERT INTO `migrations` VALUES (4,'2018_07_03_091314_create_alert_log_table',1); +INSERT INTO `migrations` VALUES (5,'2018_07_03_091314_create_alert_rules_table',1); +INSERT INTO `migrations` VALUES (6,'2018_07_03_091314_create_alert_schedulables_table',1); +INSERT INTO `migrations` VALUES (7,'2018_07_03_091314_create_alert_schedule_table',1); +INSERT INTO `migrations` VALUES (8,'2018_07_03_091314_create_alert_template_map_table',1); +INSERT INTO `migrations` VALUES (9,'2018_07_03_091314_create_alert_templates_table',1); +INSERT INTO `migrations` VALUES (10,'2018_07_03_091314_create_alert_transport_groups_table',1); +INSERT INTO `migrations` VALUES (11,'2018_07_03_091314_create_alert_transport_map_table',1); +INSERT INTO `migrations` VALUES (12,'2018_07_03_091314_create_alert_transports_table',1); +INSERT INTO `migrations` VALUES (13,'2018_07_03_091314_create_alerts_table',1); +INSERT INTO `migrations` VALUES (14,'2018_07_03_091314_create_api_tokens_table',1); +INSERT INTO `migrations` VALUES (15,'2018_07_03_091314_create_application_metrics_table',1); +INSERT INTO `migrations` VALUES (16,'2018_07_03_091314_create_applications_table',1); +INSERT INTO `migrations` VALUES (17,'2018_07_03_091314_create_authlog_table',1); +INSERT INTO `migrations` VALUES (18,'2018_07_03_091314_create_bgpPeers_cbgp_table',1); +INSERT INTO `migrations` VALUES (19,'2018_07_03_091314_create_bgpPeers_table',1); +INSERT INTO `migrations` VALUES (20,'2018_07_03_091314_create_bill_data_table',1); +INSERT INTO `migrations` VALUES (21,'2018_07_03_091314_create_bill_history_table',1); +INSERT INTO `migrations` VALUES (22,'2018_07_03_091314_create_bill_perms_table',1); +INSERT INTO `migrations` VALUES (23,'2018_07_03_091314_create_bill_port_counters_table',1); +INSERT INTO `migrations` VALUES (24,'2018_07_03_091314_create_bill_ports_table',1); +INSERT INTO `migrations` VALUES (25,'2018_07_03_091314_create_bills_table',1); +INSERT INTO `migrations` VALUES (26,'2018_07_03_091314_create_callback_table',1); +INSERT INTO `migrations` VALUES (27,'2018_07_03_091314_create_cef_switching_table',1); +INSERT INTO `migrations` VALUES (28,'2018_07_03_091314_create_ciscoASA_table',1); +INSERT INTO `migrations` VALUES (29,'2018_07_03_091314_create_component_prefs_table',1); +INSERT INTO `migrations` VALUES (30,'2018_07_03_091314_create_component_statuslog_table',1); +INSERT INTO `migrations` VALUES (31,'2018_07_03_091314_create_component_table',1); +INSERT INTO `migrations` VALUES (32,'2018_07_03_091314_create_config_table',1); +INSERT INTO `migrations` VALUES (33,'2018_07_03_091314_create_customers_table',1); +INSERT INTO `migrations` VALUES (34,'2018_07_03_091314_create_dashboards_table',1); +INSERT INTO `migrations` VALUES (35,'2018_07_03_091314_create_dbSchema_table',1); +INSERT INTO `migrations` VALUES (36,'2018_07_03_091314_create_device_graphs_table',1); +INSERT INTO `migrations` VALUES (37,'2018_07_03_091314_create_device_group_device_table',1); +INSERT INTO `migrations` VALUES (38,'2018_07_03_091314_create_device_groups_table',1); +INSERT INTO `migrations` VALUES (39,'2018_07_03_091314_create_device_mibs_table',1); +INSERT INTO `migrations` VALUES (40,'2018_07_03_091314_create_device_oids_table',1); +INSERT INTO `migrations` VALUES (41,'2018_07_03_091314_create_device_perf_table',1); +INSERT INTO `migrations` VALUES (42,'2018_07_03_091314_create_device_relationships_table',1); +INSERT INTO `migrations` VALUES (43,'2018_07_03_091314_create_devices_attribs_table',1); +INSERT INTO `migrations` VALUES (44,'2018_07_03_091314_create_devices_perms_table',1); +INSERT INTO `migrations` VALUES (45,'2018_07_03_091314_create_devices_table',1); +INSERT INTO `migrations` VALUES (46,'2018_07_03_091314_create_entPhysical_state_table',1); +INSERT INTO `migrations` VALUES (47,'2018_07_03_091314_create_entPhysical_table',1); +INSERT INTO `migrations` VALUES (48,'2018_07_03_091314_create_entityState_table',1); +INSERT INTO `migrations` VALUES (49,'2018_07_03_091314_create_eventlog_table',1); +INSERT INTO `migrations` VALUES (50,'2018_07_03_091314_create_graph_types_table',1); +INSERT INTO `migrations` VALUES (51,'2018_07_03_091314_create_hrDevice_table',1); +INSERT INTO `migrations` VALUES (52,'2018_07_03_091314_create_ipsec_tunnels_table',1); +INSERT INTO `migrations` VALUES (53,'2018_07_03_091314_create_ipv4_addresses_table',1); +INSERT INTO `migrations` VALUES (54,'2018_07_03_091314_create_ipv4_mac_table',1); +INSERT INTO `migrations` VALUES (55,'2018_07_03_091314_create_ipv4_networks_table',1); +INSERT INTO `migrations` VALUES (56,'2018_07_03_091314_create_ipv6_addresses_table',1); +INSERT INTO `migrations` VALUES (57,'2018_07_03_091314_create_ipv6_networks_table',1); +INSERT INTO `migrations` VALUES (58,'2018_07_03_091314_create_juniAtmVp_table',1); +INSERT INTO `migrations` VALUES (59,'2018_07_03_091314_create_links_table',1); +INSERT INTO `migrations` VALUES (60,'2018_07_03_091314_create_loadbalancer_rservers_table',1); +INSERT INTO `migrations` VALUES (61,'2018_07_03_091314_create_loadbalancer_vservers_table',1); +INSERT INTO `migrations` VALUES (62,'2018_07_03_091314_create_locations_table',1); +INSERT INTO `migrations` VALUES (63,'2018_07_03_091314_create_mac_accounting_table',1); +INSERT INTO `migrations` VALUES (64,'2018_07_03_091314_create_mefinfo_table',1); +INSERT INTO `migrations` VALUES (65,'2018_07_03_091314_create_mempools_table',1); +INSERT INTO `migrations` VALUES (66,'2018_07_03_091314_create_mibdefs_table',1); +INSERT INTO `migrations` VALUES (67,'2018_07_03_091314_create_munin_plugins_ds_table',1); +INSERT INTO `migrations` VALUES (68,'2018_07_03_091314_create_munin_plugins_table',1); +INSERT INTO `migrations` VALUES (69,'2018_07_03_091314_create_netscaler_vservers_table',1); +INSERT INTO `migrations` VALUES (70,'2018_07_03_091314_create_notifications_attribs_table',1); +INSERT INTO `migrations` VALUES (71,'2018_07_03_091314_create_notifications_table',1); +INSERT INTO `migrations` VALUES (72,'2018_07_03_091314_create_ospf_areas_table',1); +INSERT INTO `migrations` VALUES (73,'2018_07_03_091314_create_ospf_instances_table',1); +INSERT INTO `migrations` VALUES (74,'2018_07_03_091314_create_ospf_nbrs_table',1); +INSERT INTO `migrations` VALUES (75,'2018_07_03_091314_create_ospf_ports_table',1); +INSERT INTO `migrations` VALUES (76,'2018_07_03_091314_create_packages_table',1); +INSERT INTO `migrations` VALUES (77,'2018_07_03_091314_create_pdb_ix_peers_table',1); +INSERT INTO `migrations` VALUES (78,'2018_07_03_091314_create_pdb_ix_table',1); +INSERT INTO `migrations` VALUES (79,'2018_07_03_091314_create_perf_times_table',1); +INSERT INTO `migrations` VALUES (80,'2018_07_03_091314_create_plugins_table',1); +INSERT INTO `migrations` VALUES (81,'2018_07_03_091314_create_poller_cluster_stats_table',1); +INSERT INTO `migrations` VALUES (82,'2018_07_03_091314_create_poller_cluster_table',1); +INSERT INTO `migrations` VALUES (83,'2018_07_03_091314_create_poller_groups_table',1); +INSERT INTO `migrations` VALUES (84,'2018_07_03_091314_create_pollers_table',1); +INSERT INTO `migrations` VALUES (85,'2018_07_03_091314_create_ports_adsl_table',1); +INSERT INTO `migrations` VALUES (86,'2018_07_03_091314_create_ports_fdb_table',1); +INSERT INTO `migrations` VALUES (87,'2018_07_03_091314_create_ports_nac_table',1); +INSERT INTO `migrations` VALUES (88,'2018_07_03_091314_create_ports_perms_table',1); +INSERT INTO `migrations` VALUES (89,'2018_07_03_091314_create_ports_stack_table',1); +INSERT INTO `migrations` VALUES (90,'2018_07_03_091314_create_ports_statistics_table',1); +INSERT INTO `migrations` VALUES (91,'2018_07_03_091314_create_ports_stp_table',1); +INSERT INTO `migrations` VALUES (92,'2018_07_03_091314_create_ports_table',1); +INSERT INTO `migrations` VALUES (93,'2018_07_03_091314_create_ports_vlans_table',1); +INSERT INTO `migrations` VALUES (94,'2018_07_03_091314_create_processes_table',1); +INSERT INTO `migrations` VALUES (95,'2018_07_03_091314_create_processors_table',1); +INSERT INTO `migrations` VALUES (96,'2018_07_03_091314_create_proxmox_ports_table',1); +INSERT INTO `migrations` VALUES (97,'2018_07_03_091314_create_proxmox_table',1); +INSERT INTO `migrations` VALUES (98,'2018_07_03_091314_create_pseudowires_table',1); +INSERT INTO `migrations` VALUES (99,'2018_07_03_091314_create_route_table',1); +INSERT INTO `migrations` VALUES (100,'2018_07_03_091314_create_sensors_table',1); +INSERT INTO `migrations` VALUES (101,'2018_07_03_091314_create_sensors_to_state_indexes_table',1); +INSERT INTO `migrations` VALUES (102,'2018_07_03_091314_create_services_table',1); +INSERT INTO `migrations` VALUES (103,'2018_07_03_091314_create_session_table',1); +INSERT INTO `migrations` VALUES (104,'2018_07_03_091314_create_slas_table',1); +INSERT INTO `migrations` VALUES (105,'2018_07_03_091314_create_state_indexes_table',1); +INSERT INTO `migrations` VALUES (106,'2018_07_03_091314_create_state_translations_table',1); +INSERT INTO `migrations` VALUES (107,'2018_07_03_091314_create_storage_table',1); +INSERT INTO `migrations` VALUES (108,'2018_07_03_091314_create_stp_table',1); +INSERT INTO `migrations` VALUES (109,'2018_07_03_091314_create_syslog_table',1); +INSERT INTO `migrations` VALUES (110,'2018_07_03_091314_create_tnmsneinfo_table',1); +INSERT INTO `migrations` VALUES (111,'2018_07_03_091314_create_toner_table',1); +INSERT INTO `migrations` VALUES (112,'2018_07_03_091314_create_transport_group_transport_table',1); +INSERT INTO `migrations` VALUES (113,'2018_07_03_091314_create_ucd_diskio_table',1); +INSERT INTO `migrations` VALUES (114,'2018_07_03_091314_create_users_prefs_table',1); +INSERT INTO `migrations` VALUES (115,'2018_07_03_091314_create_users_table',1); +INSERT INTO `migrations` VALUES (116,'2018_07_03_091314_create_users_widgets_table',1); +INSERT INTO `migrations` VALUES (117,'2018_07_03_091314_create_vlans_table',1); +INSERT INTO `migrations` VALUES (118,'2018_07_03_091314_create_vminfo_table',1); +INSERT INTO `migrations` VALUES (119,'2018_07_03_091314_create_vrf_lite_cisco_table',1); +INSERT INTO `migrations` VALUES (120,'2018_07_03_091314_create_vrfs_table',1); +INSERT INTO `migrations` VALUES (121,'2018_07_03_091314_create_widgets_table',1); +INSERT INTO `migrations` VALUES (122,'2018_07_03_091314_create_wireless_sensors_table',1); +INSERT INTO `migrations` VALUES (123,'2018_07_03_091322_add_foreign_keys_to_component_prefs_table',1); +INSERT INTO `migrations` VALUES (124,'2018_07_03_091322_add_foreign_keys_to_component_statuslog_table',1); +INSERT INTO `migrations` VALUES (125,'2018_07_03_091322_add_foreign_keys_to_device_group_device_table',1); +INSERT INTO `migrations` VALUES (126,'2018_07_03_091322_add_foreign_keys_to_device_relationships_table',1); +INSERT INTO `migrations` VALUES (127,'2018_07_03_091322_add_foreign_keys_to_sensors_table',1); +INSERT INTO `migrations` VALUES (128,'2018_07_03_091322_add_foreign_keys_to_sensors_to_state_indexes_table',1); +INSERT INTO `migrations` VALUES (129,'2018_07_03_091322_add_foreign_keys_to_wireless_sensors_table',1); +INSERT INTO `migrations` VALUES (130,'2019_01_16_132200_add_vlan_and_elapsed_to_nac',1); +INSERT INTO `migrations` VALUES (131,'2019_01_16_195644_add_vrf_id_and_bgpLocalAs',1); +INSERT INTO `migrations` VALUES (132,'2019_02_05_140857_remove_config_definition_from_db',1); +INSERT INTO `migrations` VALUES (133,'2019_02_10_220000_add_dates_to_fdb',1); +INSERT INTO `migrations` VALUES (134,'2019_04_22_220000_update_route_table',1); +INSERT INTO `migrations` VALUES (135,'2019_05_12_202407_create_mpls_lsps_table',1); +INSERT INTO `migrations` VALUES (136,'2019_05_12_202408_create_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (137,'2019_05_30_225937_device_groups_rewrite',1); +INSERT INTO `migrations` VALUES (138,'2019_06_30_190400_create_mpls_sdps_table',1); +INSERT INTO `migrations` VALUES (139,'2019_06_30_190401_create_mpls_sdp_binds_table',1); +INSERT INTO `migrations` VALUES (140,'2019_06_30_190402_create_mpls_services_table',1); +INSERT INTO `migrations` VALUES (141,'2019_07_03_132417_create_mpls_saps_table',1); +INSERT INTO `migrations` VALUES (142,'2019_07_09_150217_update_users_widgets_settings',1); +INSERT INTO `migrations` VALUES (143,'2019_08_10_223200_add_enabled_to_users',1); +INSERT INTO `migrations` VALUES (144,'2019_08_28_105051_fix-template-linefeeds',1); +INSERT INTO `migrations` VALUES (145,'2019_09_05_153524_create_notifications_attribs_index',1); +INSERT INTO `migrations` VALUES (146,'2019_09_29_114433_change_default_mempool_perc_warn_in_mempools_table',1); +INSERT INTO `migrations` VALUES (147,'2019_10_03_211702_serialize_config',1); +INSERT INTO `migrations` VALUES (148,'2019_10_21_105350_devices_group_perms',1); +INSERT INTO `migrations` VALUES (149,'2019_11_30_191013_create_mpls_tunnel_ar_hops_table',1); +INSERT INTO `migrations` VALUES (150,'2019_11_30_191013_create_mpls_tunnel_c_hops_table',1); +INSERT INTO `migrations` VALUES (151,'2019_12_01_165514_add_indexes_to_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (152,'2019_12_05_164700_alerts_disable_on_update_current_timestamp',1); +INSERT INTO `migrations` VALUES (153,'2019_12_16_140000_create_customoids_table',1); +INSERT INTO `migrations` VALUES (154,'2019_12_17_151314_add_invert_map_to_alert_rules',1); +INSERT INTO `migrations` VALUES (155,'2019_12_28_180000_add_overwrite_ip_to_devices',1); +INSERT INTO `migrations` VALUES (156,'2020_01_09_1300_migrate_devices_attribs_table',1); +INSERT INTO `migrations` VALUES (157,'2020_01_10_075852_alter_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (158,'2020_02_05_093457_add_inserted_to_devices',1); +INSERT INTO `migrations` VALUES (159,'2020_02_05_224042_device_inserted_null',1); +INSERT INTO `migrations` VALUES (160,'2020_02_10_223323_create_alert_location_map_table',1); +INSERT INTO `migrations` VALUES (161,'2020_03_24_0844_add_primary_key_to_device_graphs',1); +INSERT INTO `migrations` VALUES (162,'2020_03_25_165300_add_column_to_ports',1); +INSERT INTO `migrations` VALUES (163,'2020_04_06_001048_the_great_index_rename',1); +INSERT INTO `migrations` VALUES (164,'2020_04_08_172357_alert_schedule_utc',1); +INSERT INTO `migrations` VALUES (165,'2020_04_13_150500_add_last_error_fields_to_bgp_peers',1); +INSERT INTO `migrations` VALUES (166,'2020_04_19_010532_eventlog_sensor_reference_cleanup',1); +INSERT INTO `migrations` VALUES (167,'2020_05_22_020303_alter_metric_column',1); +INSERT INTO `migrations` VALUES (168,'2020_05_24_212054_poller_cluster_settings',1); +INSERT INTO `migrations` VALUES (169,'2020_05_30_162638_remove_mib_polling_tables',1); +INSERT INTO `migrations` VALUES (170,'2020_06_06_222222_create_device_outages_table',1); +INSERT INTO `migrations` VALUES (171,'2020_06_23_00522_alter_availability_perc_column',1); +INSERT INTO `migrations` VALUES (172,'2020_07_27_00522_alter_devices_snmp_algo_columns',1); +INSERT INTO `migrations` VALUES (173,'2020_07_29_143221_add_device_perf_index',1); +INSERT INTO `migrations` VALUES (174,'2020_08_28_212054_drop_uptime_column_outages',1); +INSERT INTO `migrations` VALUES (175,'2020_09_18_223431_create_cache_table',1); +INSERT INTO `migrations` VALUES (176,'2020_09_22_172321_add_alert_log_index',1); +INSERT INTO `migrations` VALUES (177,'2020_09_24_000500_create_cache_locks_table',1); +INSERT INTO `migrations` VALUES (178,'2020_10_03_1000_add_primary_key_bill_perms',1); +INSERT INTO `migrations` VALUES (179,'2020_10_03_1000_add_primary_key_bill_ports',1); +INSERT INTO `migrations` VALUES (180,'2020_10_03_1000_add_primary_key_devices_perms',1); +INSERT INTO `migrations` VALUES (181,'2020_10_03_1000_add_primary_key_entPhysical_state',1); +INSERT INTO `migrations` VALUES (182,'2020_10_03_1000_add_primary_key_ipv4_mac',1); +INSERT INTO `migrations` VALUES (183,'2020_10_03_1000_add_primary_key_juniAtmVp',1); +INSERT INTO `migrations` VALUES (184,'2020_10_03_1000_add_primary_key_loadbalancer_vservers',1); +INSERT INTO `migrations` VALUES (185,'2020_10_03_1000_add_primary_key_ports_perms',1); +INSERT INTO `migrations` VALUES (186,'2020_10_03_1000_add_primary_key_processes',1); +INSERT INTO `migrations` VALUES (187,'2020_10_03_1000_add_primary_key_transport_group_transport',1); +INSERT INTO `migrations` VALUES (188,'2020_10_21_124101_allow_nullable_ospf_columns',1); diff --git a/database/schema/testing-schema.dump b/database/schema/testing-schema.dump new file mode 100644 index 0000000000..30ca06e3eb --- /dev/null +++ b/database/schema/testing-schema.dump @@ -0,0 +1,2510 @@ +/*!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 */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `access_points` ( + `accesspoint_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `radio_number` tinyint(4) DEFAULT NULL, + `type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `mac_addr` varchar(24) COLLATE utf8_unicode_ci NOT NULL, + `deleted` tinyint(1) NOT NULL DEFAULT 0, + `channel` tinyint(3) unsigned NOT NULL DEFAULT 0, + `txpow` tinyint(4) NOT NULL DEFAULT 0, + `radioutil` tinyint(4) NOT NULL DEFAULT 0, + `numasoclients` smallint(6) NOT NULL DEFAULT 0, + `nummonclients` smallint(6) NOT NULL DEFAULT 0, + `numactbssid` tinyint(4) NOT NULL DEFAULT 0, + `nummonbssid` tinyint(4) NOT NULL DEFAULT 0, + `interference` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`accesspoint_id`), + KEY `name` (`name`,`radio_number`), + KEY `access_points_deleted_index` (`deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_device_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_device_map_rule_id_device_id_unique` (`rule_id`,`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_group_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `group_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_group_map_rule_id_group_id_unique` (`rule_id`,`group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_location_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `location_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_location_map_rule_id_location_id_uindex` (`rule_id`,`location_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `state` int(11) NOT NULL, + `details` longblob DEFAULT NULL, + `time_logged` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `alert_log_rule_id_index` (`rule_id`), + KEY `alert_log_device_id_index` (`device_id`), + KEY `alert_log_time_logged_index` (`time_logged`), + KEY `alert_log_rule_id_device_id_index` (`rule_id`,`device_id`), + KEY `alert_log_rule_id_device_id_state_index` (`rule_id`,`device_id`,`state`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_rules` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule` text COLLATE utf8_unicode_ci NOT NULL, + `severity` enum('ok','warning','critical') COLLATE utf8_unicode_ci NOT NULL, + `extra` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `disabled` tinyint(1) NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `query` text COLLATE utf8_unicode_ci NOT NULL, + `builder` text COLLATE utf8_unicode_ci NOT NULL, + `proc` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `invert_map` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `alert_rules_name_unique` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_schedulables` ( + `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `schedule_id` int(10) unsigned NOT NULL, + `alert_schedulable_id` int(10) unsigned NOT NULL, + `alert_schedulable_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`item_id`), + KEY `schedulable_morph_index` (`alert_schedulable_type`,`alert_schedulable_id`), + KEY `alert_schedulables_schedule_id_index` (`schedule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_schedule` ( + `schedule_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `recurring` tinyint(1) unsigned NOT NULL DEFAULT 0, + `start` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `end` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `recurring_day` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`schedule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_template_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `alert_templates_id` int(10) unsigned NOT NULL, + `alert_rule_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `alert_templates_id` (`alert_templates_id`,`alert_rule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `template` longtext COLLATE utf8_unicode_ci NOT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `title_rec` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transport_groups` ( + `transport_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transport_group_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`transport_group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transport_map` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rule_id` int(10) unsigned NOT NULL, + `transport_or_group_id` int(10) unsigned NOT NULL, + `target_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_transports` ( + `transport_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transport_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + `transport_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'mail', + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `transport_config` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`transport_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alerts` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `rule_id` int(10) unsigned NOT NULL, + `state` int(11) NOT NULL, + `alerted` int(11) NOT NULL, + `open` int(11) NOT NULL, + `note` text COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `info` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `alerts_device_id_rule_id_unique` (`device_id`,`rule_id`), + KEY `alerts_device_id_index` (`device_id`), + KEY `alerts_rule_id_index` (`rule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `api_tokens` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `token_hash` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `disabled` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `api_tokens_token_hash_unique` (`token_hash`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `application_metrics` ( + `app_id` int(10) unsigned NOT NULL, + `metric` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `value` double DEFAULT NULL, + `value_prev` double DEFAULT NULL, + UNIQUE KEY `application_metrics_app_id_metric_unique` (`app_id`,`metric`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `applications` ( + `app_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `app_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `app_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UNKNOWN', + `discovered` tinyint(4) NOT NULL DEFAULT 0, + `app_state_prev` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `app_status` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `app_instance` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`app_id`), + UNIQUE KEY `applications_device_id_app_type_unique` (`device_id`,`app_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `authlog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `datetime` timestamp NOT NULL DEFAULT current_timestamp(), + `user` text COLLATE utf8_unicode_ci NOT NULL, + `address` text COLLATE utf8_unicode_ci NOT NULL, + `result` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `availability` ( + `availability_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `duration` bigint(20) NOT NULL, + `availability_perc` decimal(9,6) NOT NULL DEFAULT 0.000000, + PRIMARY KEY (`availability_id`), + UNIQUE KEY `availability_device_id_duration_unique` (`device_id`,`duration`), + KEY `availability_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bgpPeers` ( + `bgpPeer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vrf_id` int(10) unsigned DEFAULT NULL, + `astext` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerIdentifier` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerRemoteAs` bigint(20) NOT NULL, + `bgpPeerState` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerAdminStatus` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerLastErrorCode` int(11) DEFAULT NULL, + `bgpPeerLastErrorSubCode` int(11) DEFAULT NULL, + `bgpPeerLastErrorText` varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL, + `bgpLocalAddr` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerRemoteAddr` text COLLATE utf8_unicode_ci NOT NULL, + `bgpPeerDescr` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `bgpPeerInUpdates` int(11) NOT NULL, + `bgpPeerOutUpdates` int(11) NOT NULL, + `bgpPeerInTotalMessages` int(11) NOT NULL, + `bgpPeerOutTotalMessages` int(11) NOT NULL, + `bgpPeerFsmEstablishedTime` int(11) NOT NULL, + `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`bgpPeer_id`), + KEY `bgppeers_device_id_context_name_index` (`device_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bgpPeers_cbgp` ( + `device_id` int(10) unsigned NOT NULL, + `bgpPeerIdentifier` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `afi` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `safi` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `AcceptedPrefixes` int(11) NOT NULL, + `DeniedPrefixes` int(11) NOT NULL, + `PrefixAdminLimit` int(11) NOT NULL, + `PrefixThreshold` int(11) NOT NULL, + `PrefixClearThreshold` int(11) NOT NULL, + `AdvertisedPrefixes` int(11) NOT NULL, + `SuppressedPrefixes` int(11) NOT NULL, + `WithdrawnPrefixes` int(11) NOT NULL, + `AcceptedPrefixes_delta` int(11) NOT NULL, + `AcceptedPrefixes_prev` int(11) NOT NULL, + `DeniedPrefixes_delta` int(11) NOT NULL, + `DeniedPrefixes_prev` int(11) NOT NULL, + `AdvertisedPrefixes_delta` int(11) NOT NULL, + `AdvertisedPrefixes_prev` int(11) NOT NULL, + `SuppressedPrefixes_delta` int(11) NOT NULL, + `SuppressedPrefixes_prev` int(11) NOT NULL, + `WithdrawnPrefixes_delta` int(11) NOT NULL, + `WithdrawnPrefixes_prev` int(11) NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + UNIQUE KEY `bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique` (`device_id`,`bgpPeerIdentifier`,`afi`,`safi`), + KEY `bgppeers_cbgp_device_id_bgppeeridentifier_context_name_index` (`device_id`,`bgpPeerIdentifier`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_data` ( + `bill_id` int(10) unsigned NOT NULL, + `timestamp` datetime NOT NULL, + `period` int(11) NOT NULL, + `delta` bigint(20) NOT NULL, + `in_delta` bigint(20) NOT NULL, + `out_delta` bigint(20) NOT NULL, + PRIMARY KEY (`bill_id`,`timestamp`), + KEY `bill_data_bill_id_index` (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_history` ( + `bill_hist_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `bill_id` int(10) unsigned NOT NULL, + `updated` timestamp NOT NULL DEFAULT current_timestamp(), + `bill_datefrom` datetime NOT NULL, + `bill_dateto` datetime NOT NULL, + `bill_type` text COLLATE utf8_unicode_ci NOT NULL, + `bill_allowed` bigint(20) NOT NULL, + `bill_used` bigint(20) NOT NULL, + `bill_overuse` bigint(20) NOT NULL, + `bill_percent` decimal(10,2) NOT NULL, + `rate_95th_in` bigint(20) NOT NULL, + `rate_95th_out` bigint(20) NOT NULL, + `rate_95th` bigint(20) NOT NULL, + `dir_95th` varchar(3) COLLATE utf8_unicode_ci NOT NULL, + `rate_average` bigint(20) NOT NULL, + `rate_average_in` bigint(20) NOT NULL, + `rate_average_out` bigint(20) NOT NULL, + `traf_in` bigint(20) NOT NULL, + `traf_out` bigint(20) NOT NULL, + `traf_total` bigint(20) NOT NULL, + `pdf` longblob DEFAULT NULL, + PRIMARY KEY (`bill_hist_id`), + UNIQUE KEY `bill_history_bill_id_bill_datefrom_bill_dateto_unique` (`bill_id`,`bill_datefrom`,`bill_dateto`), + KEY `bill_history_bill_id_index` (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `bill_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_port_counters` ( + `port_id` int(10) unsigned NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `in_counter` bigint(20) DEFAULT NULL, + `in_delta` bigint(20) NOT NULL DEFAULT 0, + `out_counter` bigint(20) DEFAULT NULL, + `out_delta` bigint(20) NOT NULL DEFAULT 0, + `bill_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`port_id`,`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bill_ports` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `bill_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bills` ( + `bill_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `bill_name` text COLLATE utf8_unicode_ci NOT NULL, + `bill_type` text COLLATE utf8_unicode_ci NOT NULL, + `bill_cdr` bigint(20) DEFAULT NULL, + `bill_day` int(11) NOT NULL DEFAULT 1, + `bill_quota` bigint(20) DEFAULT NULL, + `rate_95th_in` bigint(20) NOT NULL, + `rate_95th_out` bigint(20) NOT NULL, + `rate_95th` bigint(20) NOT NULL, + `dir_95th` varchar(3) COLLATE utf8_unicode_ci NOT NULL, + `total_data` bigint(20) NOT NULL, + `total_data_in` bigint(20) NOT NULL, + `total_data_out` bigint(20) NOT NULL, + `rate_average_in` bigint(20) NOT NULL, + `rate_average_out` bigint(20) NOT NULL, + `rate_average` bigint(20) NOT NULL, + `bill_last_calc` datetime NOT NULL, + `bill_custid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `bill_ref` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `bill_notes` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + `bill_autoadded` tinyint(1) NOT NULL, + PRIMARY KEY (`bill_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache` ( + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `value` text COLLATE utf8_unicode_ci NOT NULL, + `expiration` int(11) NOT NULL, + UNIQUE KEY `cache_key_unique` (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cache_locks` ( + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `expiration` int(11) NOT NULL, + PRIMARY KEY (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `callback` ( + `callback_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` char(64) COLLATE utf8_unicode_ci NOT NULL, + `value` char(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`callback_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cef_switching` ( + `cef_switching_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned 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(10) unsigned NOT NULL, + `updated_prev` int(10) unsigned NOT NULL, + PRIMARY KEY (`cef_switching_id`), + UNIQUE KEY `cef_switching_device_id_entphysicalindex_afi_cef_index_unique` (`device_id`,`entPhysicalIndex`,`afi`,`cef_index`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ciscoASA` ( + `ciscoASA_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `oid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `data` bigint(20) NOT NULL, + `high_alert` bigint(20) NOT NULL, + `low_alert` bigint(20) NOT NULL, + `disabled` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`ciscoASA_id`), + KEY `ciscoasa_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each component, unique index', + `device_id` int(10) unsigned NOT NULL COMMENT 'device_id from the devices table', + `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'name from the component_type table', + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Display label for the component', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'The status of the component, retreived from the device', + `disabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Should this component be polled', + `ignore` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Should this component be alerted on', + `error` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Error message if in Alert state', + PRIMARY KEY (`id`), + KEY `component_device_id_index` (`device_id`), + KEY `component_type_index` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component_prefs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each entry', + `component` int(10) unsigned NOT NULL COMMENT 'id from the component table', + `attribute` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Attribute for the Component', + `value` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Value for the Component', + PRIMARY KEY (`id`), + KEY `component_prefs_component_index` (`component`), + CONSTRAINT `component_prefs_ibfk_1` FOREIGN KEY (`component`) REFERENCES `component` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `component_statuslog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each log entry, unique index', + `component_id` int(10) unsigned NOT NULL COMMENT 'id from the component table', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'The status that the component was changed TO', + `message` text COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'When the status of the component was changed', + PRIMARY KEY (`id`), + KEY `component_statuslog_component_id_index` (`component_id`), + CONSTRAINT `component_statuslog_ibfk_1` FOREIGN KEY (`component_id`) REFERENCES `component` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `config` ( + `config_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `config_value` varchar(512) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`config_id`), + UNIQUE KEY `config_config_name_unique` (`config_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customers` ( + `customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` char(64) COLLATE utf8_unicode_ci NOT NULL, + `password` char(32) COLLATE utf8_unicode_ci NOT NULL, + `string` char(64) COLLATE utf8_unicode_ci NOT NULL, + `level` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`customer_id`), + UNIQUE KEY `customers_username_unique` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customoids` ( + `customoid_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `customoid_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', + `customoid_deleted` tinyint(4) NOT NULL DEFAULT 0, + `customoid_current` double DEFAULT NULL, + `customoid_prev` double DEFAULT NULL, + `customoid_oid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `customoid_datatype` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GAUGE', + `customoid_unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, + `customoid_divisor` int(10) unsigned NOT NULL DEFAULT 1, + `customoid_multiplier` int(10) unsigned NOT NULL DEFAULT 1, + `customoid_limit` double DEFAULT NULL, + `customoid_limit_warn` double DEFAULT NULL, + `customoid_limit_low` double DEFAULT NULL, + `customoid_limit_low_warn` double DEFAULT NULL, + `customoid_alert` tinyint(4) NOT NULL DEFAULT 0, + `customoid_passed` tinyint(4) NOT NULL DEFAULT 0, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `user_func` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`customoid_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dashboards` ( + `dashboard_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL DEFAULT 0, + `dashboard_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `access` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`dashboard_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dbSchema` ( + `version` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_graphs` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `graph` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `device_graphs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_group_device` ( + `device_group_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`device_group_id`,`device_id`), + KEY `device_group_device_device_group_id_index` (`device_group_id`), + KEY `device_group_device_device_id_index` (`device_id`), + CONSTRAINT `device_group_device_device_group_id_foreign` FOREIGN KEY (`device_group_id`) REFERENCES `device_groups` (`id`) ON DELETE CASCADE, + CONSTRAINT `device_group_device_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_groups` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', + `type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'dynamic', + `rules` text COLLATE utf8_unicode_ci DEFAULT NULL, + `pattern` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `device_groups_name_unique` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_outages` ( + `device_id` int(10) unsigned NOT NULL, + `going_down` bigint(20) NOT NULL, + `up_again` bigint(20) DEFAULT NULL, + UNIQUE KEY `device_outages_device_id_going_down_unique` (`device_id`,`going_down`), + KEY `device_outages_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_perf` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `timestamp` datetime NOT NULL, + `xmt` int(11) NOT NULL, + `rcv` int(11) NOT NULL, + `loss` int(11) NOT NULL, + `min` double(8,2) NOT NULL, + `max` double(8,2) NOT NULL, + `avg` double(8,2) NOT NULL, + `debug` text COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `device_perf_device_id_index` (`device_id`), + KEY `device_perf_device_id_timestamp_index` (`device_id`,`timestamp`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `device_relationships` ( + `parent_device_id` int(10) unsigned NOT NULL DEFAULT 0, + `child_device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`parent_device_id`,`child_device_id`), + KEY `device_relationships_child_device_id_index` (`child_device_id`), + CONSTRAINT `device_relationship_child_device_id_fk` FOREIGN KEY (`child_device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE, + CONSTRAINT `device_relationship_parent_device_id_fk` FOREIGN KEY (`parent_device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices` ( + `device_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `inserted` timestamp NULL DEFAULT current_timestamp(), + `hostname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `sysName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ip` varbinary(16) DEFAULT NULL, + `overwrite_ip` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, + `community` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `authlevel` enum('noAuthNoPriv','authNoPriv','authPriv') COLLATE utf8_unicode_ci DEFAULT NULL, + `authname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `authpass` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `authalgo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `cryptopass` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `cryptoalgo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `snmpver` varchar(4) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'v2c', + `port` smallint(5) unsigned 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, + `snmp_disable` tinyint(1) NOT NULL DEFAULT 0, + `bgpLocalAs` int(10) unsigned DEFAULT NULL, + `sysObjectID` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `sysDescr` text COLLATE utf8_unicode_ci DEFAULT NULL, + `sysContact` text COLLATE utf8_unicode_ci DEFAULT NULL, + `version` text COLLATE utf8_unicode_ci DEFAULT NULL, + `hardware` text COLLATE utf8_unicode_ci DEFAULT NULL, + `features` text COLLATE utf8_unicode_ci DEFAULT NULL, + `location_id` int(10) unsigned DEFAULT NULL, + `os` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` tinyint(1) NOT NULL DEFAULT 0, + `status_reason` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `ignore` tinyint(1) NOT NULL DEFAULT 0, + `disabled` tinyint(1) NOT NULL DEFAULT 0, + `uptime` bigint(20) DEFAULT NULL, + `agent_uptime` int(10) unsigned NOT NULL DEFAULT 0, + `last_polled` timestamp NULL DEFAULT NULL, + `last_poll_attempted` timestamp NULL DEFAULT NULL, + `last_polled_timetaken` double(5,2) DEFAULT NULL, + `last_discovered_timetaken` double(5,2) DEFAULT NULL, + `last_discovered` timestamp NULL DEFAULT NULL, + `last_ping` timestamp NULL DEFAULT NULL, + `last_ping_timetaken` double(8,2) DEFAULT NULL, + `purpose` text COLLATE utf8_unicode_ci DEFAULT NULL, + `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `serial` text COLLATE utf8_unicode_ci DEFAULT NULL, + `icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `poller_group` int(11) NOT NULL DEFAULT 0, + `override_sysLocation` tinyint(1) DEFAULT 0, + `notes` text COLLATE utf8_unicode_ci DEFAULT NULL, + `port_association_mode` int(11) NOT NULL DEFAULT 1, + `max_depth` int(11) NOT NULL DEFAULT 0, + `disable_notify` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`device_id`), + KEY `devices_hostname_index` (`hostname`), + KEY `devices_sysname_index` (`sysName`), + KEY `devices_os_index` (`os`), + KEY `devices_status_index` (`status`), + KEY `devices_last_polled_index` (`last_polled`), + KEY `devices_last_poll_attempted_index` (`last_poll_attempted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_attribs` ( + `attrib_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `attrib_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `attrib_value` text COLLATE utf8_unicode_ci NOT NULL, + `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`attrib_id`), + KEY `devices_attribs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_group_perms` ( + `user_id` int(10) unsigned NOT NULL, + `device_group_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`device_group_id`,`user_id`), + KEY `devices_group_perms_user_id_index` (`user_id`), + KEY `devices_group_perms_device_group_id_index` (`device_group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `devices_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `devices_perms_user_id_index` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entPhysical` ( + `entPhysical_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `entPhysicalIndex` int(11) NOT NULL, + `entPhysicalDescr` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalClass` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalName` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalHardwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalFirmwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalSoftwareRev` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalAlias` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalAssetID` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIsFRU` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalModelName` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalVendorType` text COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalSerialNum` text COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalContainedIn` int(11) NOT NULL, + `entPhysicalParentRelPos` int(11) NOT NULL, + `entPhysicalMfgName` text COLLATE utf8_unicode_ci NOT NULL, + `ifIndex` int(11) DEFAULT NULL, + PRIMARY KEY (`entPhysical_id`), + KEY `entphysical_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entPhysical_state` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `entPhysicalIndex` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `subindex` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `group` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `key` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `device_id_index` (`device_id`,`entPhysicalIndex`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entityState` ( + `entity_state_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `entPhysical_id` int(10) unsigned DEFAULT NULL, + `entStateLastChanged` datetime DEFAULT NULL, + `entStateAdmin` int(11) DEFAULT NULL, + `entStateOper` int(11) DEFAULT NULL, + `entStateUsage` int(11) DEFAULT NULL, + `entStateAlarm` text COLLATE utf8_unicode_ci DEFAULT NULL, + `entStateStandby` int(11) DEFAULT NULL, + PRIMARY KEY (`entity_state_id`), + KEY `entitystate_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `eventlog` ( + `event_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `datetime` datetime NOT NULL DEFAULT '1970-01-02 00:00:01', + `message` text COLLATE utf8_unicode_ci DEFAULT NULL, + `type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `reference` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `username` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `severity` tinyint(4) NOT NULL DEFAULT 2, + PRIMARY KEY (`event_id`), + KEY `eventlog_device_id_index` (`device_id`), + KEY `eventlog_datetime_index` (`datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `graph_types` ( + `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_subtype` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `graph_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `graph_order` int(11) NOT NULL, + PRIMARY KEY (`graph_type`,`graph_subtype`,`graph_section`), + KEY `graph_types_graph_type_index` (`graph_type`), + KEY `graph_types_graph_subtype_index` (`graph_subtype`), + KEY `graph_types_graph_section_index` (`graph_section`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `hrDevice` ( + `hrDevice_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `hrDeviceIndex` int(11) NOT NULL, + `hrDeviceDescr` text COLLATE utf8_unicode_ci NOT NULL, + `hrDeviceType` text COLLATE utf8_unicode_ci NOT NULL, + `hrDeviceErrors` int(11) NOT NULL DEFAULT 0, + `hrDeviceStatus` text COLLATE utf8_unicode_ci NOT NULL, + `hrProcessorLoad` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`hrDevice_id`), + KEY `hrdevice_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipsec_tunnels` ( + `tunnel_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `peer_port` int(10) unsigned NOT NULL, + `peer_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `local_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `local_port` int(10) unsigned NOT NULL, + `tunnel_name` varchar(96) COLLATE utf8_unicode_ci NOT NULL, + `tunnel_status` varchar(11) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`tunnel_id`), + UNIQUE KEY `ipsec_tunnels_device_id_peer_addr_unique` (`device_id`,`peer_addr`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_addresses` ( + `ipv4_address_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv4_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ipv4_prefixlen` int(11) NOT NULL, + `ipv4_network_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv4_address_id`), + KEY `ipv4_addresses_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_mac` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned DEFAULT NULL, + `mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ipv4_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `ipv4_mac_port_id_index` (`port_id`), + KEY `ipv4_mac_mac_address_index` (`mac_address`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv4_networks` ( + `ipv4_network_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv4_network` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv4_network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv6_addresses` ( + `ipv6_address_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv6_address` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_compressed` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_prefixlen` int(11) NOT NULL, + `ipv6_origin` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `ipv6_network_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv6_address_id`), + KEY `ipv6_addresses_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ipv6_networks` ( + `ipv6_network_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ipv6_network` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ipv6_network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `juniAtmVp` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `juniAtmVp_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `vp_id` int(10) unsigned NOT NULL, + `vp_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `juniatmvp_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `links` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `local_port_id` int(10) unsigned DEFAULT NULL, + `local_device_id` int(10) unsigned NOT NULL, + `remote_port_id` int(10) unsigned DEFAULT NULL, + `active` tinyint(1) NOT NULL DEFAULT 1, + `protocol` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_hostname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `remote_device_id` int(10) unsigned NOT NULL, + `remote_port` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `remote_platform` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_version` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `local_device_id` (`local_device_id`,`remote_device_id`), + KEY `links_local_port_id_index` (`local_port_id`), + KEY `links_remote_port_id_index` (`remote_port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `loadbalancer_rservers` ( + `rserver_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `farm_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `StateDescr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`rserver_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `loadbalancer_vservers` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `classmap_id` int(10) unsigned NOT NULL, + `classmap` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `serverstate` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `loadbalancer_vservers_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `location` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `lat` double(10,6) DEFAULT NULL, + `lng` double(10,6) DEFAULT NULL, + `timestamp` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `locations_location_unique` (`location`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mac_accounting` ( + `ma_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `mac` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `in_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `out_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `bps_out` int(11) NOT NULL, + `bps_in` int(11) NOT NULL, + `cipMacHCSwitchedBytes_input` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_input_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedBytes_output` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedBytes_output_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedPkts_input` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_input_rate` int(11) DEFAULT NULL, + `cipMacHCSwitchedPkts_output` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_prev` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_delta` bigint(20) DEFAULT NULL, + `cipMacHCSwitchedPkts_output_rate` int(11) DEFAULT NULL, + `poll_time` int(10) unsigned DEFAULT NULL, + `poll_prev` int(10) unsigned DEFAULT NULL, + `poll_period` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`ma_id`), + KEY `mac_accounting_port_id_index` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mefinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `mefID` int(11) NOT NULL, + `mefType` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefIdent` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefMTU` int(11) NOT NULL DEFAULT 1500, + `mefAdmState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `mefRowState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `mefinfo_device_id_index` (`device_id`), + KEY `mefinfo_mefid_index` (`mefID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mempools` ( + `mempool_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mempool_index` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `entPhysicalIndex` int(11) DEFAULT NULL, + `hrDeviceIndex` int(11) DEFAULT NULL, + `mempool_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mempool_precision` int(11) NOT NULL DEFAULT 1, + `mempool_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mempool_perc` int(11) NOT NULL, + `mempool_used` bigint(20) NOT NULL, + `mempool_free` bigint(20) NOT NULL, + `mempool_total` bigint(20) NOT NULL, + `mempool_largestfree` bigint(20) DEFAULT NULL, + `mempool_lowestfree` bigint(20) DEFAULT NULL, + `mempool_deleted` tinyint(1) NOT NULL DEFAULT 0, + `mempool_perc_warn` int(11) DEFAULT NULL, + PRIMARY KEY (`mempool_id`), + KEY `mempools_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `migrations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `batch` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_lsp_paths` ( + `lsp_path_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `lsp_id` int(10) unsigned NOT NULL, + `path_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mplsLspPathRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathLastChange` bigint(20) NOT NULL, + `mplsLspPathType` enum('other','primary','standby','secondary') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathBandwidth` int(10) unsigned NOT NULL, + `mplsLspPathOperBandwidth` int(10) unsigned NOT NULL, + `mplsLspPathAdminState` enum('noop','inService','outOfService') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathOperState` enum('unknown','inService','outOfService','transition') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathState` enum('unknown','active','inactive') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathFailCode` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathFailNodeAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspPathMetric` int(10) unsigned NOT NULL, + `mplsLspPathOperMetric` int(10) unsigned DEFAULT NULL, + `mplsLspPathTimeUp` bigint(20) DEFAULT NULL, + `mplsLspPathTimeDown` bigint(20) DEFAULT NULL, + `mplsLspPathTransitionCount` int(10) unsigned DEFAULT NULL, + `mplsLspPathTunnelARHopListIndex` int(10) unsigned DEFAULT NULL, + `mplsLspPathTunnelCHopListIndex` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`lsp_path_id`), + KEY `mpls_lsp_paths_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_lsps` ( + `lsp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vrf_oid` int(10) unsigned NOT NULL, + `lsp_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `mplsLspRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspLastChange` bigint(20) DEFAULT NULL, + `mplsLspName` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspAdminState` enum('noop','inService','outOfService') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspOperState` enum('unknown','inService','outOfService','transition') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspFromAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspToAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `mplsLspType` enum('unknown','dynamic','static','bypassOnly','p2mpLsp','p2mpAuto','mplsTp','meshP2p','oneHopP2p','srTe','meshP2pSrTe','oneHopP2pSrTe') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspFastReroute` enum('true','false') COLLATE utf8_unicode_ci NOT NULL, + `mplsLspAge` bigint(20) DEFAULT NULL, + `mplsLspTimeUp` bigint(20) DEFAULT NULL, + `mplsLspTimeDown` bigint(20) DEFAULT NULL, + `mplsLspPrimaryTimeUp` bigint(20) DEFAULT NULL, + `mplsLspTransitions` int(10) unsigned DEFAULT NULL, + `mplsLspLastTransition` bigint(20) DEFAULT NULL, + `mplsLspConfiguredPaths` int(10) unsigned DEFAULT NULL, + `mplsLspStandbyPaths` int(10) unsigned DEFAULT NULL, + `mplsLspOperationalPaths` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`lsp_id`), + KEY `mpls_lsps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_saps` ( + `sap_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `svc_id` int(10) unsigned NOT NULL, + `svc_oid` int(10) unsigned NOT NULL, + `sapPortId` int(10) unsigned NOT NULL, + `ifName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `sapEncapValue` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `sapRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapType` enum('unknown','epipe','tls','vprn','ies','mirror','apipe','fpipe','ipipe','cpipe','intTls','evpnIsaTls') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `sapAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sapLastMgmtChange` bigint(20) DEFAULT NULL, + `sapLastStatusChange` bigint(20) DEFAULT NULL, + PRIMARY KEY (`sap_id`), + KEY `mpls_saps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_sdp_binds` ( + `bind_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sdp_id` int(10) unsigned NOT NULL, + `svc_id` int(10) unsigned NOT NULL, + `sdp_oid` int(10) unsigned NOT NULL, + `svc_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `sdpBindRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindLastMgmtChange` bigint(20) DEFAULT NULL, + `sdpBindLastStatusChange` bigint(20) DEFAULT NULL, + `sdpBindType` enum('spoke','mesh') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindVcType` enum('undef','ether','vlan','mirrior','atmSduatmCell','atmVcc','atmVpc','frDlci','ipipe','satopE1','satopT1','satopE3','satopT3','cesopsn','cesopsnCas') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpBindBaseStatsIngFwdPackets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsIngFwdOctets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsEgrFwdPackets` bigint(20) DEFAULT NULL, + `sdpBindBaseStatsEgrFwdOctets` bigint(20) DEFAULT NULL, + PRIMARY KEY (`bind_id`), + KEY `mpls_sdp_binds_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_sdps` ( + `sdp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sdp_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `sdpRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpDelivery` enum('gre','mpls','l2tpv3','greethbridged') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpOperStatus` enum('up','notAlive','notReady','invalidEgressInterface','transportTunnelDown','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpAdminPathMtu` int(11) DEFAULT NULL, + `sdpOperPathMtu` int(11) DEFAULT NULL, + `sdpLastMgmtChange` bigint(20) DEFAULT NULL, + `sdpLastStatusChange` bigint(20) DEFAULT NULL, + `sdpActiveLspType` enum('not-applicable','rsvp','ldp','bgp','none','mplsTp','srIsis','srOspf','srTeLsp','fpe') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpFarEndInetAddressType` enum('ipv4','ipv6') COLLATE utf8_unicode_ci DEFAULT NULL, + `sdpFarEndInetAddress` varchar(46) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`sdp_id`), + KEY `mpls_sdps_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_services` ( + `svc_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `svc_oid` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `svcRowStatus` enum('active','notInService','notReady','createAndGo','createAndWait','destroy') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcType` enum('unknown','epipe','tls','vprn','ies','mirror','apipe','fpipe','ipipe','cpipe','intTls','evpnIsaTls') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcCustId` int(10) unsigned DEFAULT NULL, + `svcAdminStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcDescription` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, + `svcMtu` int(11) DEFAULT NULL, + `svcNumSaps` int(11) DEFAULT NULL, + `svcNumSdps` int(11) DEFAULT NULL, + `svcLastMgmtChange` bigint(20) DEFAULT NULL, + `svcLastStatusChange` bigint(20) DEFAULT NULL, + `svcVRouterId` int(11) DEFAULT NULL, + `svcTlsMacLearning` enum('enabled','disabled') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsStpAdminStatus` enum('enabled','disabled') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsStpOperStatus` enum('up','down') COLLATE utf8_unicode_ci DEFAULT NULL, + `svcTlsFdbTableSize` int(11) DEFAULT NULL, + `svcTlsFdbNumEntries` int(11) DEFAULT NULL, + PRIMARY KEY (`svc_id`), + KEY `mpls_services_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_tunnel_ar_hops` ( + `ar_hop_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mplsTunnelARHopListIndex` int(10) unsigned NOT NULL, + `mplsTunnelARHopIndex` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `lsp_path_id` int(10) unsigned NOT NULL, + `mplsTunnelARHopAddrType` enum('unknown','ipV4','ipV6','asNumber','lspid','unnum') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopIpv4Addr` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopIpv6Addr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopAsNumber` int(10) unsigned DEFAULT NULL, + `mplsTunnelARHopStrictOrLoose` enum('strict','loose') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelARHopRouterId` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `localProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `linkProtectionInUse` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `bandwidthProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + `nextNodeProtected` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false', + PRIMARY KEY (`ar_hop_id`), + KEY `mpls_tunnel_ar_hops_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mpls_tunnel_c_hops` ( + `c_hop_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mplsTunnelCHopListIndex` int(10) unsigned NOT NULL, + `mplsTunnelCHopIndex` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `lsp_path_id` int(10) unsigned DEFAULT NULL, + `mplsTunnelCHopAddrType` enum('unknown','ipV4','ipV6','asNumber','lspid','unnum') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopIpv4Addr` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopIpv6Addr` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopAsNumber` int(10) unsigned DEFAULT NULL, + `mplsTunnelCHopStrictOrLoose` enum('strict','loose') COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsTunnelCHopRouterId` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`c_hop_id`), + KEY `mpls_tunnel_c_hops_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `munin_plugins` ( + `mplug_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `mplug_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `mplug_instance` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_category` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_info` text COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_vlabel` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_args` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplug_total` tinyint(1) NOT NULL DEFAULT 0, + `mplug_graph` tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`mplug_id`), + UNIQUE KEY `munin_plugins_device_id_mplug_type_unique` (`device_id`,`mplug_type`), + KEY `munin_plugins_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `munin_plugins_ds` ( + `mplug_id` int(10) unsigned NOT NULL, + `ds_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GAUGE', + `ds_label` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ds_cdef` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ds_draw` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `ds_graph` enum('no','yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'yes', + `ds_info` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ds_extinfo` text COLLATE utf8_unicode_ci NOT NULL, + `ds_max` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_min` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_negative` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_warning` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_critical` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_colour` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ds_sum` text COLLATE utf8_unicode_ci NOT NULL, + `ds_stack` text COLLATE utf8_unicode_ci NOT NULL, + `ds_line` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `munin_plugins_ds_mplug_id_ds_name_unique` (`mplug_id`,`ds_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `netscaler_vservers` ( + `vsvr_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_port` int(11) NOT NULL, + `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `vsvr_clients` int(11) NOT NULL, + `vsvr_server` int(11) NOT NULL, + `vsvr_req_rate` int(11) NOT NULL, + `vsvr_bps_in` int(11) NOT NULL, + `vsvr_bps_out` int(11) NOT NULL, + PRIMARY KEY (`vsvr_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `notifications` ( + `notifications_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `body` text COLLATE utf8_unicode_ci NOT NULL, + `severity` int(11) DEFAULT 0 COMMENT '0=ok,1=warning,2=critical', + `source` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `checksum` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00', + PRIMARY KEY (`notifications_id`), + UNIQUE KEY `notifications_checksum_unique` (`checksum`), + KEY `notifications_severity_index` (`severity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `notifications_attribs` ( + `attrib_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `notifications_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + PRIMARY KEY (`attrib_id`), + KEY `notifications_attribs_notifications_id_user_id_index` (`notifications_id`,`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_areas` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci DEFAULT 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_areas_device_id_ospfareaid_context_name_unique` (`device_id`,`ospfAreaId`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_instances` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `ospf_instance_id` int(10) unsigned 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_instances_device_id_ospf_instance_id_context_name_unique` (`device_id`,`ospf_instance_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_nbrs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned DEFAULT 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_nbrs_device_id_ospf_nbr_id_context_name_unique` (`device_id`,`ospf_nbr_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ospf_ports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned 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, + `context_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ospf_ports_device_id_ospf_port_id_context_name_unique` (`device_id`,`ospf_port_id`,`context_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `packages` ( + `pkg_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `manager` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `status` tinyint(1) NOT NULL, + `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `build` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `arch` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `size` bigint(20) DEFAULT NULL, + PRIMARY KEY (`pkg_id`), + UNIQUE KEY `packages_device_id_name_manager_arch_version_build_unique` (`device_id`,`name`,`manager`,`arch`,`version`,`build`), + KEY `packages_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdb_ix` ( + `pdb_ix_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ix_id` int(10) unsigned NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `asn` int(10) unsigned NOT NULL, + `timestamp` int(10) unsigned NOT NULL, + PRIMARY KEY (`pdb_ix_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdb_ix_peers` ( + `pdb_ix_peers_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ix_id` int(10) unsigned NOT NULL, + `peer_id` int(10) unsigned NOT NULL, + `remote_asn` int(10) unsigned NOT NULL, + `remote_ipaddr4` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `remote_ipaddr6` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`pdb_ix_peers_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `perf_times` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `doing` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `start` int(10) unsigned NOT NULL, + `duration` double(8,2) NOT NULL, + `devices` int(10) unsigned NOT NULL, + `poller` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `perf_times_type_index` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `plugins` ( + `plugin_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `plugin_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `plugin_active` int(11) NOT NULL, + PRIMARY KEY (`plugin_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_cluster` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `node_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `poller_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `poller_version` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `poller_groups` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `last_report` datetime NOT NULL, + `master` tinyint(1) NOT NULL, + `poller_enabled` tinyint(1) DEFAULT NULL, + `poller_frequency` int(11) DEFAULT NULL, + `poller_workers` int(11) DEFAULT NULL, + `poller_down_retry` int(11) DEFAULT NULL, + `discovery_enabled` tinyint(1) DEFAULT NULL, + `discovery_frequency` int(11) DEFAULT NULL, + `discovery_workers` int(11) DEFAULT NULL, + `services_enabled` tinyint(1) DEFAULT NULL, + `services_frequency` int(11) DEFAULT NULL, + `services_workers` int(11) DEFAULT NULL, + `billing_enabled` tinyint(1) DEFAULT NULL, + `billing_frequency` int(11) DEFAULT NULL, + `billing_calculate_frequency` int(11) DEFAULT NULL, + `alerting_enabled` tinyint(1) DEFAULT NULL, + `alerting_frequency` int(11) DEFAULT NULL, + `ping_enabled` tinyint(1) DEFAULT NULL, + `ping_frequency` int(11) DEFAULT NULL, + `update_enabled` tinyint(1) DEFAULT NULL, + `update_frequency` int(11) DEFAULT NULL, + `loglevel` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, + `watchdog_enabled` tinyint(1) DEFAULT NULL, + `watchdog_log` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `poller_cluster_node_id_unique` (`node_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_cluster_stats` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent_poller` int(10) unsigned NOT NULL DEFAULT 0, + `poller_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `depth` int(10) unsigned NOT NULL, + `devices` int(10) unsigned NOT NULL, + `worker_seconds` double unsigned NOT NULL, + `workers` int(10) unsigned NOT NULL, + `frequency` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `poller_cluster_stats_parent_poller_poller_type_unique` (`parent_poller`,`poller_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poller_groups` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `group_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `descr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pollers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `poller_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `last_polled` datetime NOT NULL, + `devices` int(10) unsigned NOT NULL, + `time_taken` double NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `pollers_poller_name_unique` (`poller_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports` ( + `port_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `port_descr_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_circuit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_speed` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `port_descr_notes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifDescr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `portName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifIndex` bigint(20) DEFAULT 0, + `ifSpeed` bigint(20) DEFAULT NULL, + `ifSpeed_prev` bigint(20) DEFAULT NULL, + `ifConnectorPresent` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifPromiscuousMode` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifHighSpeed` int(11) DEFAULT NULL, + `ifHighSpeed_prev` int(11) DEFAULT NULL, + `ifOperStatus` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifOperStatus_prev` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAdminStatus` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAdminStatus_prev` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifDuplex` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifMtu` int(11) DEFAULT NULL, + `ifType` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifAlias` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifPhysAddress` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ifHardType` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifLastChange` bigint(20) unsigned NOT NULL DEFAULT 0, + `ifVlan` varchar(8) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `ifTrunk` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `ifVrf` int(11) NOT NULL DEFAULT 0, + `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) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPortState` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerDeviceId` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerLearnMethod` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpPartnerIfIndex` int(11) DEFAULT NULL, + `pagpPartnerGroupIfIndex` int(11) DEFAULT NULL, + `pagpPartnerDeviceName` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpEthcOperationMode` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpDeviceId` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL, + `pagpGroupIfIndex` int(11) DEFAULT NULL, + `ifInUcastPkts` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_prev` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_delta` bigint(20) unsigned DEFAULT NULL, + `ifInUcastPkts_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutUcastPkts_rate` bigint(20) unsigned DEFAULT NULL, + `ifInErrors` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_prev` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_delta` bigint(20) unsigned DEFAULT NULL, + `ifInErrors_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutErrors_rate` bigint(20) unsigned DEFAULT NULL, + `ifInOctets` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_prev` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_delta` bigint(20) unsigned DEFAULT NULL, + `ifInOctets_rate` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_prev` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_delta` bigint(20) unsigned DEFAULT NULL, + `ifOutOctets_rate` bigint(20) unsigned DEFAULT NULL, + `poll_time` int(10) unsigned DEFAULT NULL, + `poll_prev` int(10) unsigned DEFAULT NULL, + `poll_period` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`port_id`), + UNIQUE KEY `ports_device_id_ifindex_unique` (`device_id`,`ifIndex`), + KEY `ports_ifdescr_index` (`ifDescr`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_adsl` ( + `port_id` int(10) unsigned NOT NULL, + `port_adsl_updated` timestamp NOT NULL DEFAULT current_timestamp(), + `adslLineCoding` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslLineType` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucInvVendorID` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, + `adslAtucCurrAtn` decimal(5,1) NOT NULL, + `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, + `adslAtucCurrAttainableRate` int(11) NOT NULL, + `adslAtucChanCurrTxRate` int(11) NOT NULL, + `adslAturInvSerialNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturInvVendorID` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturInvVersionNumber` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `adslAturChanCurrTxRate` int(11) NOT NULL, + `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, + `adslAturCurrAtn` decimal(5,1) NOT NULL, + `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, + `adslAturCurrAttainableRate` int(11) NOT NULL, + UNIQUE KEY `ports_adsl_port_id_unique` (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_fdb` ( + `ports_fdb_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `port_id` int(10) unsigned NOT NULL, + `mac_address` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `vlan_id` int(10) unsigned NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`ports_fdb_id`), + KEY `ports_fdb_port_id_index` (`port_id`), + KEY `ports_fdb_mac_address_index` (`mac_address`), + KEY `ports_fdb_vlan_id_index` (`vlan_id`), + KEY `ports_fdb_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_nac` ( + `ports_nac_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `auth_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `domain` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `username` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `mac_address` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `ip_address` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `host_mode` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authz_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authz_by` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `authc_status` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `method` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `timeout` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `time_left` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan` int(10) unsigned DEFAULT NULL, + `time_elapsed` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`ports_nac_id`), + KEY `ports_nac_port_id_mac_address_index` (`port_id`,`mac_address`), + KEY `ports_nac_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_perms` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_stack` ( + `device_id` int(10) unsigned NOT NULL, + `port_id_high` int(10) unsigned NOT NULL, + `port_id_low` int(10) unsigned NOT NULL, + `ifStackStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `ports_stack_device_id_port_id_high_port_id_low_unique` (`device_id`,`port_id_high`,`port_id_low`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_statistics` ( + `port_id` int(10) unsigned NOT NULL, + `ifInNUcastPkts` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_prev` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_delta` bigint(20) DEFAULT NULL, + `ifInNUcastPkts_rate` int(11) DEFAULT NULL, + `ifOutNUcastPkts` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutNUcastPkts_rate` int(11) DEFAULT NULL, + `ifInDiscards` bigint(20) DEFAULT NULL, + `ifInDiscards_prev` bigint(20) DEFAULT NULL, + `ifInDiscards_delta` bigint(20) DEFAULT NULL, + `ifInDiscards_rate` int(11) DEFAULT NULL, + `ifOutDiscards` bigint(20) DEFAULT NULL, + `ifOutDiscards_prev` bigint(20) DEFAULT NULL, + `ifOutDiscards_delta` bigint(20) DEFAULT NULL, + `ifOutDiscards_rate` int(11) DEFAULT NULL, + `ifInUnknownProtos` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_prev` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_delta` bigint(20) DEFAULT NULL, + `ifInUnknownProtos_rate` int(11) DEFAULT NULL, + `ifInBroadcastPkts` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_prev` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_delta` bigint(20) DEFAULT NULL, + `ifInBroadcastPkts_rate` int(11) DEFAULT NULL, + `ifOutBroadcastPkts` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutBroadcastPkts_rate` int(11) DEFAULT NULL, + `ifInMulticastPkts` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_prev` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_delta` bigint(20) DEFAULT NULL, + `ifInMulticastPkts_rate` int(11) DEFAULT NULL, + `ifOutMulticastPkts` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_prev` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_delta` bigint(20) DEFAULT NULL, + `ifOutMulticastPkts_rate` int(11) DEFAULT NULL, + PRIMARY KEY (`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_stp` ( + `port_stp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `priority` tinyint(3) unsigned NOT NULL, + `state` varchar(11) COLLATE utf8_unicode_ci NOT NULL, + `enable` varchar(8) COLLATE utf8_unicode_ci NOT NULL, + `pathCost` int(10) unsigned NOT NULL, + `designatedRoot` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `designatedCost` smallint(5) unsigned NOT NULL, + `designatedBridge` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `designatedPort` mediumint(9) NOT NULL, + `forwardTransitions` int(10) unsigned NOT NULL, + PRIMARY KEY (`port_stp_id`), + UNIQUE KEY `ports_stp_device_id_port_id_unique` (`device_id`,`port_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ports_vlans` ( + `port_vlan_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `vlan` int(11) NOT NULL, + `baseport` int(11) NOT NULL, + `priority` bigint(20) NOT NULL, + `state` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `cost` int(11) NOT NULL, + `untagged` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`port_vlan_id`), + UNIQUE KEY `ports_vlans_device_id_port_id_vlan_unique` (`device_id`,`port_id`,`vlan`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `processes` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `pid` int(11) NOT NULL, + `vsz` int(11) NOT NULL, + `rss` int(11) NOT NULL, + `cputime` varchar(12) COLLATE utf8_unicode_ci NOT NULL, + `user` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `command` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `processes_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `processors` ( + `processor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entPhysicalIndex` int(11) NOT NULL DEFAULT 0, + `hrDeviceIndex` int(11) DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `processor_oid` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `processor_index` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `processor_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `processor_usage` int(11) NOT NULL, + `processor_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `processor_precision` int(11) NOT NULL DEFAULT 1, + `processor_perc_warn` int(11) DEFAULT 75, + PRIMARY KEY (`processor_id`), + KEY `processors_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxmox` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `vmid` int(11) NOT NULL, + `cluster` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `last_seen` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `proxmox_cluster_vmid_unique` (`cluster`,`vmid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxmox_ports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vm_id` int(11) NOT NULL, + `port` varchar(10) COLLATE utf8_unicode_ci NOT NULL, + `last_seen` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `proxmox_ports_vm_id_port_unique` (`vm_id`,`port`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pseudowires` ( + `pseudowire_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `peer_device_id` int(10) unsigned NOT NULL, + `peer_ldp_id` int(11) NOT NULL, + `cpwVcID` int(11) NOT NULL, + `cpwOid` int(11) NOT NULL, + `pw_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `pw_psntype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `pw_local_mtu` int(11) NOT NULL, + `pw_peer_mtu` int(11) NOT NULL, + `pw_descr` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`pseudowire_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `route` ( + `route_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `device_id` int(10) unsigned NOT NULL, + `port_id` int(10) unsigned NOT NULL, + `context_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `inetCidrRouteIfIndex` bigint(20) NOT NULL, + `inetCidrRouteType` int(10) unsigned NOT NULL, + `inetCidrRouteProto` int(10) unsigned NOT NULL, + `inetCidrRouteNextHopAS` int(10) unsigned NOT NULL, + `inetCidrRouteMetric1` int(10) unsigned NOT NULL, + `inetCidrRouteDestType` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteDest` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteNextHopType` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRouteNextHop` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRoutePolicy` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `inetCidrRoutePfxLen` int(10) unsigned NOT NULL, + PRIMARY KEY (`route_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sensors` ( + `sensor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_deleted` tinyint(1) NOT NULL DEFAULT 0, + `sensor_class` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp', + `sensor_oid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `sensor_index` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `group` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_divisor` bigint(20) NOT NULL DEFAULT 1, + `sensor_multiplier` int(11) NOT NULL DEFAULT 1, + `sensor_current` double DEFAULT NULL, + `sensor_limit` double DEFAULT NULL, + `sensor_limit_warn` double DEFAULT NULL, + `sensor_limit_low` double DEFAULT NULL, + `sensor_limit_low_warn` double DEFAULT NULL, + `sensor_alert` tinyint(1) NOT NULL DEFAULT 1, + `sensor_custom` enum('No','Yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No', + `entPhysicalIndex` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIndex_measured` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `sensor_prev` double DEFAULT NULL, + `user_func` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`sensor_id`), + KEY `sensors_sensor_class_index` (`sensor_class`), + KEY `sensors_device_id_index` (`device_id`), + KEY `sensors_sensor_type_index` (`sensor_type`), + CONSTRAINT `sensors_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sensors_to_state_indexes` ( + `sensors_to_state_translations_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_id` int(10) unsigned NOT NULL, + `state_index_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`sensors_to_state_translations_id`), + UNIQUE KEY `sensors_to_state_indexes_sensor_id_state_index_id_unique` (`sensor_id`,`state_index_id`), + KEY `sensors_to_state_indexes_state_index_id_index` (`state_index_id`), + CONSTRAINT `sensors_to_state_indexes_ibfk_1` FOREIGN KEY (`state_index_id`) REFERENCES `state_indexes` (`state_index_id`), + CONSTRAINT `sensors_to_state_indexes_sensor_id_foreign` FOREIGN KEY (`sensor_id`) REFERENCES `sensors` (`sensor_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `services` ( + `service_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `service_ip` text COLLATE utf8_unicode_ci NOT NULL, + `service_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `service_desc` text COLLATE utf8_unicode_ci NOT NULL, + `service_param` text COLLATE utf8_unicode_ci NOT NULL, + `service_ignore` tinyint(1) NOT NULL, + `service_status` tinyint(4) NOT NULL DEFAULT 0, + `service_changed` int(10) unsigned NOT NULL DEFAULT 0, + `service_message` text COLLATE utf8_unicode_ci NOT NULL, + `service_disabled` tinyint(1) NOT NULL DEFAULT 0, + `service_ds` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`service_id`), + KEY `services_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `session` ( + `session_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `session_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `session_value` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `session_token` varchar(60) COLLATE utf8_unicode_ci NOT NULL, + `session_auth` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `session_expiry` int(11) NOT NULL, + PRIMARY KEY (`session_id`), + UNIQUE KEY `session_session_value_unique` (`session_value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `slas` ( + `sla_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `sla_nr` int(11) NOT NULL, + `owner` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `tag` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `rtt_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `status` tinyint(1) NOT NULL, + `opstatus` tinyint(1) NOT NULL DEFAULT 0, + `deleted` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`sla_id`), + UNIQUE KEY `slas_device_id_sla_nr_unique` (`device_id`,`sla_nr`), + KEY `slas_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `state_indexes` ( + `state_index_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`state_index_id`), + UNIQUE KEY `state_indexes_state_name_unique` (`state_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `state_translations` ( + `state_translation_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_index_id` int(10) unsigned NOT NULL, + `state_descr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `state_draw_graph` tinyint(1) NOT NULL, + `state_value` smallint(6) NOT NULL DEFAULT 0, + `state_generic_value` tinyint(1) NOT NULL, + `state_lastupdated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`state_translation_id`), + UNIQUE KEY `state_translations_state_index_id_state_value_unique` (`state_index_id`,`state_value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `storage` ( + `storage_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `storage_mib` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `storage_index` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `storage_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `storage_descr` text COLLATE utf8_unicode_ci NOT NULL, + `storage_size` bigint(20) NOT NULL, + `storage_units` int(11) NOT NULL, + `storage_used` bigint(20) NOT NULL DEFAULT 0, + `storage_free` bigint(20) NOT NULL DEFAULT 0, + `storage_perc` int(11) NOT NULL DEFAULT 0, + `storage_perc_warn` int(11) DEFAULT 60, + `storage_deleted` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`storage_id`), + UNIQUE KEY `storage_device_id_storage_mib_storage_index_unique` (`device_id`,`storage_mib`,`storage_index`), + KEY `storage_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stp` ( + `stp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `rootBridge` tinyint(1) NOT NULL, + `bridgeAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `protocolSpecification` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `priority` mediumint(9) NOT NULL, + `timeSinceTopologyChange` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `topChanges` mediumint(9) NOT NULL, + `designatedRoot` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `rootCost` mediumint(9) NOT NULL, + `rootPort` int(11) DEFAULT NULL, + `maxAge` mediumint(9) NOT NULL, + `helloTime` mediumint(9) NOT NULL, + `holdTime` mediumint(9) NOT NULL, + `forwardDelay` mediumint(9) NOT NULL, + `bridgeMaxAge` smallint(6) NOT NULL, + `bridgeHelloTime` smallint(6) NOT NULL, + `bridgeForwardDelay` smallint(6) NOT NULL, + PRIMARY KEY (`stp_id`), + KEY `stp_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `syslog` ( + `device_id` int(10) unsigned DEFAULT NULL, + `facility` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `priority` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `level` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `tag` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + `program` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `msg` text COLLATE utf8_unicode_ci DEFAULT NULL, + `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`seq`), + KEY `syslog_priority_level_index` (`priority`,`level`), + KEY `syslog_device_id_timestamp_index` (`device_id`,`timestamp`), + KEY `syslog_device_id_index` (`device_id`), + KEY `syslog_timestamp_index` (`timestamp`), + KEY `syslog_program_index` (`program`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tnmsneinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `neID` int(11) NOT NULL, + `neType` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neName` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neLocation` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neAlarm` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neOpMode` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `neOpState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `tnmsneinfo_device_id_index` (`device_id`), + KEY `tnmsneinfo_neid_index` (`neID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `toner` ( + `toner_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `toner_index` int(11) NOT NULL, + `toner_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `toner_oid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `toner_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `toner_capacity` int(11) NOT NULL DEFAULT 0, + `toner_current` int(11) NOT NULL DEFAULT 0, + `toner_capacity_oid` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`toner_id`), + KEY `toner_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `transport_group_transport` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `transport_group_id` int(10) unsigned NOT NULL, + `transport_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ucd_diskio` ( + `diskio_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `diskio_index` int(11) NOT NULL, + `diskio_descr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`diskio_id`), + KEY `ucd_diskio_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `auth_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `auth_id` int(11) DEFAULT NULL, + `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `realname` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `email` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `descr` char(30) COLLATE utf8_unicode_ci NOT NULL, + `level` tinyint(4) NOT NULL DEFAULT 0, + `can_modify_passwd` tinyint(1) NOT NULL DEFAULT 1, + `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01', + `updated_at` timestamp NOT NULL DEFAULT current_timestamp(), + `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + `enabled` tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY (`user_id`), + UNIQUE KEY `users_auth_type_username_unique` (`auth_type`,`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_prefs` ( + `user_id` int(10) unsigned NOT NULL, + `pref` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + UNIQUE KEY `users_prefs_user_id_pref_unique` (`user_id`,`pref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_widgets` ( + `user_widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `widget_id` int(10) unsigned NOT NULL, + `col` tinyint(4) NOT NULL, + `row` tinyint(4) NOT NULL, + `size_x` tinyint(4) NOT NULL, + `size_y` tinyint(4) NOT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `refresh` tinyint(4) NOT NULL DEFAULT 60, + `settings` text COLLATE utf8_unicode_ci NOT NULL, + `dashboard_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`user_widget_id`), + KEY `user_id` (`user_id`,`widget_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vlans` ( + `vlan_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned DEFAULT NULL, + `vlan_vlan` int(11) DEFAULT NULL, + `vlan_domain` int(11) DEFAULT NULL, + `vlan_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan_type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `vlan_mtu` int(11) DEFAULT NULL, + PRIMARY KEY (`vlan_id`), + KEY `device_id` (`device_id`,`vlan_vlan`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vminfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `vm_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'vmware', + `vmwVmVMID` int(11) NOT NULL, + `vmwVmDisplayName` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vmwVmGuestOS` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `vmwVmMemSize` int(11) NOT NULL, + `vmwVmCpus` int(11) NOT NULL, + `vmwVmState` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `vminfo_device_id_index` (`device_id`), + KEY `vminfo_vmwvmvmid_index` (`vmwVmVMID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vrf_lite_cisco` ( + `vrf_lite_cisco_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `device_id` int(10) unsigned NOT NULL, + `context_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `intance_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT '', + `vrf_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT 'Default', + PRIMARY KEY (`vrf_lite_cisco_id`), + KEY `vrf_lite_cisco_device_id_context_name_vrf_name_index` (`device_id`,`context_name`,`vrf_name`), + KEY `vrf_lite_cisco_device_id_index` (`device_id`), + KEY `vrf_lite_cisco_context_name_index` (`context_name`), + KEY `vrf_lite_cisco_vrf_name_index` (`vrf_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vrfs` ( + `vrf_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vrf_oid` varchar(256) COLLATE utf8_unicode_ci NOT NULL, + `vrf_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `bgpLocalAs` int(10) unsigned DEFAULT NULL, + `mplsVpnVrfRouteDistinguisher` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `mplsVpnVrfDescription` text COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`vrf_id`), + KEY `vrfs_device_id_index` (`device_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `widgets` ( + `widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `widget_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `widget` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `base_dimensions` varchar(10) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`widget_id`), + UNIQUE KEY `widgets_widget_unique` (`widget`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wireless_sensors` ( + `sensor_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `sensor_deleted` tinyint(1) NOT NULL DEFAULT 0, + `sensor_class` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `device_id` int(10) unsigned NOT NULL DEFAULT 0, + `sensor_index` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, + `sensor_type` varchar(255) COLLATE utf8_unicode_ci 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_aggregator` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'sum', + `sensor_current` double DEFAULT NULL, + `sensor_prev` double DEFAULT NULL, + `sensor_limit` double DEFAULT NULL, + `sensor_limit_warn` double DEFAULT NULL, + `sensor_limit_low` double DEFAULT NULL, + `sensor_limit_low_warn` double DEFAULT NULL, + `sensor_alert` tinyint(1) NOT NULL DEFAULT 1, + `sensor_custom` enum('No','Yes') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No', + `entPhysicalIndex` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `entPhysicalIndex_measured` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `lastupdate` timestamp NOT NULL DEFAULT current_timestamp(), + `sensor_oids` text COLLATE utf8_unicode_ci NOT NULL, + `access_point_id` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`sensor_id`), + KEY `wireless_sensors_sensor_class_index` (`sensor_class`), + KEY `wireless_sensors_device_id_index` (`device_id`), + KEY `wireless_sensors_sensor_type_index` (`sensor_type`), + CONSTRAINT `wireless_sensors_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!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 */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +INSERT INTO `migrations` VALUES (1,'2018_07_03_091314_create_access_points_table',1); +INSERT INTO `migrations` VALUES (2,'2018_07_03_091314_create_alert_device_map_table',1); +INSERT INTO `migrations` VALUES (3,'2018_07_03_091314_create_alert_group_map_table',1); +INSERT INTO `migrations` VALUES (4,'2018_07_03_091314_create_alert_log_table',1); +INSERT INTO `migrations` VALUES (5,'2018_07_03_091314_create_alert_rules_table',1); +INSERT INTO `migrations` VALUES (6,'2018_07_03_091314_create_alert_schedulables_table',1); +INSERT INTO `migrations` VALUES (7,'2018_07_03_091314_create_alert_schedule_table',1); +INSERT INTO `migrations` VALUES (8,'2018_07_03_091314_create_alert_template_map_table',1); +INSERT INTO `migrations` VALUES (9,'2018_07_03_091314_create_alert_templates_table',1); +INSERT INTO `migrations` VALUES (10,'2018_07_03_091314_create_alert_transport_groups_table',1); +INSERT INTO `migrations` VALUES (11,'2018_07_03_091314_create_alert_transport_map_table',1); +INSERT INTO `migrations` VALUES (12,'2018_07_03_091314_create_alert_transports_table',1); +INSERT INTO `migrations` VALUES (13,'2018_07_03_091314_create_alerts_table',1); +INSERT INTO `migrations` VALUES (14,'2018_07_03_091314_create_api_tokens_table',1); +INSERT INTO `migrations` VALUES (15,'2018_07_03_091314_create_application_metrics_table',1); +INSERT INTO `migrations` VALUES (16,'2018_07_03_091314_create_applications_table',1); +INSERT INTO `migrations` VALUES (17,'2018_07_03_091314_create_authlog_table',1); +INSERT INTO `migrations` VALUES (18,'2018_07_03_091314_create_bgpPeers_cbgp_table',1); +INSERT INTO `migrations` VALUES (19,'2018_07_03_091314_create_bgpPeers_table',1); +INSERT INTO `migrations` VALUES (20,'2018_07_03_091314_create_bill_data_table',1); +INSERT INTO `migrations` VALUES (21,'2018_07_03_091314_create_bill_history_table',1); +INSERT INTO `migrations` VALUES (22,'2018_07_03_091314_create_bill_perms_table',1); +INSERT INTO `migrations` VALUES (23,'2018_07_03_091314_create_bill_port_counters_table',1); +INSERT INTO `migrations` VALUES (24,'2018_07_03_091314_create_bill_ports_table',1); +INSERT INTO `migrations` VALUES (25,'2018_07_03_091314_create_bills_table',1); +INSERT INTO `migrations` VALUES (26,'2018_07_03_091314_create_callback_table',1); +INSERT INTO `migrations` VALUES (27,'2018_07_03_091314_create_cef_switching_table',1); +INSERT INTO `migrations` VALUES (28,'2018_07_03_091314_create_ciscoASA_table',1); +INSERT INTO `migrations` VALUES (29,'2018_07_03_091314_create_component_prefs_table',1); +INSERT INTO `migrations` VALUES (30,'2018_07_03_091314_create_component_statuslog_table',1); +INSERT INTO `migrations` VALUES (31,'2018_07_03_091314_create_component_table',1); +INSERT INTO `migrations` VALUES (32,'2018_07_03_091314_create_config_table',1); +INSERT INTO `migrations` VALUES (33,'2018_07_03_091314_create_customers_table',1); +INSERT INTO `migrations` VALUES (34,'2018_07_03_091314_create_dashboards_table',1); +INSERT INTO `migrations` VALUES (35,'2018_07_03_091314_create_dbSchema_table',1); +INSERT INTO `migrations` VALUES (36,'2018_07_03_091314_create_device_graphs_table',1); +INSERT INTO `migrations` VALUES (37,'2018_07_03_091314_create_device_group_device_table',1); +INSERT INTO `migrations` VALUES (38,'2018_07_03_091314_create_device_groups_table',1); +INSERT INTO `migrations` VALUES (39,'2018_07_03_091314_create_device_mibs_table',1); +INSERT INTO `migrations` VALUES (40,'2018_07_03_091314_create_device_oids_table',1); +INSERT INTO `migrations` VALUES (41,'2018_07_03_091314_create_device_perf_table',1); +INSERT INTO `migrations` VALUES (42,'2018_07_03_091314_create_device_relationships_table',1); +INSERT INTO `migrations` VALUES (43,'2018_07_03_091314_create_devices_attribs_table',1); +INSERT INTO `migrations` VALUES (44,'2018_07_03_091314_create_devices_perms_table',1); +INSERT INTO `migrations` VALUES (45,'2018_07_03_091314_create_devices_table',1); +INSERT INTO `migrations` VALUES (46,'2018_07_03_091314_create_entPhysical_state_table',1); +INSERT INTO `migrations` VALUES (47,'2018_07_03_091314_create_entPhysical_table',1); +INSERT INTO `migrations` VALUES (48,'2018_07_03_091314_create_entityState_table',1); +INSERT INTO `migrations` VALUES (49,'2018_07_03_091314_create_eventlog_table',1); +INSERT INTO `migrations` VALUES (50,'2018_07_03_091314_create_graph_types_table',1); +INSERT INTO `migrations` VALUES (51,'2018_07_03_091314_create_hrDevice_table',1); +INSERT INTO `migrations` VALUES (52,'2018_07_03_091314_create_ipsec_tunnels_table',1); +INSERT INTO `migrations` VALUES (53,'2018_07_03_091314_create_ipv4_addresses_table',1); +INSERT INTO `migrations` VALUES (54,'2018_07_03_091314_create_ipv4_mac_table',1); +INSERT INTO `migrations` VALUES (55,'2018_07_03_091314_create_ipv4_networks_table',1); +INSERT INTO `migrations` VALUES (56,'2018_07_03_091314_create_ipv6_addresses_table',1); +INSERT INTO `migrations` VALUES (57,'2018_07_03_091314_create_ipv6_networks_table',1); +INSERT INTO `migrations` VALUES (58,'2018_07_03_091314_create_juniAtmVp_table',1); +INSERT INTO `migrations` VALUES (59,'2018_07_03_091314_create_links_table',1); +INSERT INTO `migrations` VALUES (60,'2018_07_03_091314_create_loadbalancer_rservers_table',1); +INSERT INTO `migrations` VALUES (61,'2018_07_03_091314_create_loadbalancer_vservers_table',1); +INSERT INTO `migrations` VALUES (62,'2018_07_03_091314_create_locations_table',1); +INSERT INTO `migrations` VALUES (63,'2018_07_03_091314_create_mac_accounting_table',1); +INSERT INTO `migrations` VALUES (64,'2018_07_03_091314_create_mefinfo_table',1); +INSERT INTO `migrations` VALUES (65,'2018_07_03_091314_create_mempools_table',1); +INSERT INTO `migrations` VALUES (66,'2018_07_03_091314_create_mibdefs_table',1); +INSERT INTO `migrations` VALUES (67,'2018_07_03_091314_create_munin_plugins_ds_table',1); +INSERT INTO `migrations` VALUES (68,'2018_07_03_091314_create_munin_plugins_table',1); +INSERT INTO `migrations` VALUES (69,'2018_07_03_091314_create_netscaler_vservers_table',1); +INSERT INTO `migrations` VALUES (70,'2018_07_03_091314_create_notifications_attribs_table',1); +INSERT INTO `migrations` VALUES (71,'2018_07_03_091314_create_notifications_table',1); +INSERT INTO `migrations` VALUES (72,'2018_07_03_091314_create_ospf_areas_table',1); +INSERT INTO `migrations` VALUES (73,'2018_07_03_091314_create_ospf_instances_table',1); +INSERT INTO `migrations` VALUES (74,'2018_07_03_091314_create_ospf_nbrs_table',1); +INSERT INTO `migrations` VALUES (75,'2018_07_03_091314_create_ospf_ports_table',1); +INSERT INTO `migrations` VALUES (76,'2018_07_03_091314_create_packages_table',1); +INSERT INTO `migrations` VALUES (77,'2018_07_03_091314_create_pdb_ix_peers_table',1); +INSERT INTO `migrations` VALUES (78,'2018_07_03_091314_create_pdb_ix_table',1); +INSERT INTO `migrations` VALUES (79,'2018_07_03_091314_create_perf_times_table',1); +INSERT INTO `migrations` VALUES (80,'2018_07_03_091314_create_plugins_table',1); +INSERT INTO `migrations` VALUES (81,'2018_07_03_091314_create_poller_cluster_stats_table',1); +INSERT INTO `migrations` VALUES (82,'2018_07_03_091314_create_poller_cluster_table',1); +INSERT INTO `migrations` VALUES (83,'2018_07_03_091314_create_poller_groups_table',1); +INSERT INTO `migrations` VALUES (84,'2018_07_03_091314_create_pollers_table',1); +INSERT INTO `migrations` VALUES (85,'2018_07_03_091314_create_ports_adsl_table',1); +INSERT INTO `migrations` VALUES (86,'2018_07_03_091314_create_ports_fdb_table',1); +INSERT INTO `migrations` VALUES (87,'2018_07_03_091314_create_ports_nac_table',1); +INSERT INTO `migrations` VALUES (88,'2018_07_03_091314_create_ports_perms_table',1); +INSERT INTO `migrations` VALUES (89,'2018_07_03_091314_create_ports_stack_table',1); +INSERT INTO `migrations` VALUES (90,'2018_07_03_091314_create_ports_statistics_table',1); +INSERT INTO `migrations` VALUES (91,'2018_07_03_091314_create_ports_stp_table',1); +INSERT INTO `migrations` VALUES (92,'2018_07_03_091314_create_ports_table',1); +INSERT INTO `migrations` VALUES (93,'2018_07_03_091314_create_ports_vlans_table',1); +INSERT INTO `migrations` VALUES (94,'2018_07_03_091314_create_processes_table',1); +INSERT INTO `migrations` VALUES (95,'2018_07_03_091314_create_processors_table',1); +INSERT INTO `migrations` VALUES (96,'2018_07_03_091314_create_proxmox_ports_table',1); +INSERT INTO `migrations` VALUES (97,'2018_07_03_091314_create_proxmox_table',1); +INSERT INTO `migrations` VALUES (98,'2018_07_03_091314_create_pseudowires_table',1); +INSERT INTO `migrations` VALUES (99,'2018_07_03_091314_create_route_table',1); +INSERT INTO `migrations` VALUES (100,'2018_07_03_091314_create_sensors_table',1); +INSERT INTO `migrations` VALUES (101,'2018_07_03_091314_create_sensors_to_state_indexes_table',1); +INSERT INTO `migrations` VALUES (102,'2018_07_03_091314_create_services_table',1); +INSERT INTO `migrations` VALUES (103,'2018_07_03_091314_create_session_table',1); +INSERT INTO `migrations` VALUES (104,'2018_07_03_091314_create_slas_table',1); +INSERT INTO `migrations` VALUES (105,'2018_07_03_091314_create_state_indexes_table',1); +INSERT INTO `migrations` VALUES (106,'2018_07_03_091314_create_state_translations_table',1); +INSERT INTO `migrations` VALUES (107,'2018_07_03_091314_create_storage_table',1); +INSERT INTO `migrations` VALUES (108,'2018_07_03_091314_create_stp_table',1); +INSERT INTO `migrations` VALUES (109,'2018_07_03_091314_create_syslog_table',1); +INSERT INTO `migrations` VALUES (110,'2018_07_03_091314_create_tnmsneinfo_table',1); +INSERT INTO `migrations` VALUES (111,'2018_07_03_091314_create_toner_table',1); +INSERT INTO `migrations` VALUES (112,'2018_07_03_091314_create_transport_group_transport_table',1); +INSERT INTO `migrations` VALUES (113,'2018_07_03_091314_create_ucd_diskio_table',1); +INSERT INTO `migrations` VALUES (114,'2018_07_03_091314_create_users_prefs_table',1); +INSERT INTO `migrations` VALUES (115,'2018_07_03_091314_create_users_table',1); +INSERT INTO `migrations` VALUES (116,'2018_07_03_091314_create_users_widgets_table',1); +INSERT INTO `migrations` VALUES (117,'2018_07_03_091314_create_vlans_table',1); +INSERT INTO `migrations` VALUES (118,'2018_07_03_091314_create_vminfo_table',1); +INSERT INTO `migrations` VALUES (119,'2018_07_03_091314_create_vrf_lite_cisco_table',1); +INSERT INTO `migrations` VALUES (120,'2018_07_03_091314_create_vrfs_table',1); +INSERT INTO `migrations` VALUES (121,'2018_07_03_091314_create_widgets_table',1); +INSERT INTO `migrations` VALUES (122,'2018_07_03_091314_create_wireless_sensors_table',1); +INSERT INTO `migrations` VALUES (123,'2018_07_03_091322_add_foreign_keys_to_component_prefs_table',1); +INSERT INTO `migrations` VALUES (124,'2018_07_03_091322_add_foreign_keys_to_component_statuslog_table',1); +INSERT INTO `migrations` VALUES (125,'2018_07_03_091322_add_foreign_keys_to_device_group_device_table',1); +INSERT INTO `migrations` VALUES (126,'2018_07_03_091322_add_foreign_keys_to_device_relationships_table',1); +INSERT INTO `migrations` VALUES (127,'2018_07_03_091322_add_foreign_keys_to_sensors_table',1); +INSERT INTO `migrations` VALUES (128,'2018_07_03_091322_add_foreign_keys_to_sensors_to_state_indexes_table',1); +INSERT INTO `migrations` VALUES (129,'2018_07_03_091322_add_foreign_keys_to_wireless_sensors_table',1); +INSERT INTO `migrations` VALUES (130,'2019_01_16_132200_add_vlan_and_elapsed_to_nac',1); +INSERT INTO `migrations` VALUES (131,'2019_01_16_195644_add_vrf_id_and_bgpLocalAs',1); +INSERT INTO `migrations` VALUES (132,'2019_02_05_140857_remove_config_definition_from_db',1); +INSERT INTO `migrations` VALUES (133,'2019_02_10_220000_add_dates_to_fdb',1); +INSERT INTO `migrations` VALUES (134,'2019_04_22_220000_update_route_table',1); +INSERT INTO `migrations` VALUES (135,'2019_05_12_202407_create_mpls_lsps_table',1); +INSERT INTO `migrations` VALUES (136,'2019_05_12_202408_create_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (137,'2019_05_30_225937_device_groups_rewrite',1); +INSERT INTO `migrations` VALUES (138,'2019_06_30_190400_create_mpls_sdps_table',1); +INSERT INTO `migrations` VALUES (139,'2019_06_30_190401_create_mpls_sdp_binds_table',1); +INSERT INTO `migrations` VALUES (140,'2019_06_30_190402_create_mpls_services_table',1); +INSERT INTO `migrations` VALUES (141,'2019_07_03_132417_create_mpls_saps_table',1); +INSERT INTO `migrations` VALUES (142,'2019_07_09_150217_update_users_widgets_settings',1); +INSERT INTO `migrations` VALUES (143,'2019_08_10_223200_add_enabled_to_users',1); +INSERT INTO `migrations` VALUES (144,'2019_08_28_105051_fix-template-linefeeds',1); +INSERT INTO `migrations` VALUES (145,'2019_09_05_153524_create_notifications_attribs_index',1); +INSERT INTO `migrations` VALUES (146,'2019_09_29_114433_change_default_mempool_perc_warn_in_mempools_table',1); +INSERT INTO `migrations` VALUES (147,'2019_10_03_211702_serialize_config',1); +INSERT INTO `migrations` VALUES (148,'2019_10_21_105350_devices_group_perms',1); +INSERT INTO `migrations` VALUES (149,'2019_11_30_191013_create_mpls_tunnel_ar_hops_table',1); +INSERT INTO `migrations` VALUES (150,'2019_11_30_191013_create_mpls_tunnel_c_hops_table',1); +INSERT INTO `migrations` VALUES (151,'2019_12_01_165514_add_indexes_to_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (152,'2019_12_05_164700_alerts_disable_on_update_current_timestamp',1); +INSERT INTO `migrations` VALUES (153,'2019_12_16_140000_create_customoids_table',1); +INSERT INTO `migrations` VALUES (154,'2019_12_17_151314_add_invert_map_to_alert_rules',1); +INSERT INTO `migrations` VALUES (155,'2019_12_28_180000_add_overwrite_ip_to_devices',1); +INSERT INTO `migrations` VALUES (156,'2020_01_09_1300_migrate_devices_attribs_table',1); +INSERT INTO `migrations` VALUES (157,'2020_01_10_075852_alter_mpls_lsp_paths_table',1); +INSERT INTO `migrations` VALUES (158,'2020_02_05_093457_add_inserted_to_devices',1); +INSERT INTO `migrations` VALUES (159,'2020_02_05_224042_device_inserted_null',1); +INSERT INTO `migrations` VALUES (160,'2020_02_10_223323_create_alert_location_map_table',1); +INSERT INTO `migrations` VALUES (161,'2020_03_24_0844_add_primary_key_to_device_graphs',1); +INSERT INTO `migrations` VALUES (162,'2020_03_25_165300_add_column_to_ports',1); +INSERT INTO `migrations` VALUES (163,'2020_04_06_001048_the_great_index_rename',1); +INSERT INTO `migrations` VALUES (164,'2020_04_08_172357_alert_schedule_utc',1); +INSERT INTO `migrations` VALUES (165,'2020_04_13_150500_add_last_error_fields_to_bgp_peers',1); +INSERT INTO `migrations` VALUES (166,'2020_04_19_010532_eventlog_sensor_reference_cleanup',1); +INSERT INTO `migrations` VALUES (167,'2020_05_22_020303_alter_metric_column',1); +INSERT INTO `migrations` VALUES (168,'2020_05_24_212054_poller_cluster_settings',1); +INSERT INTO `migrations` VALUES (169,'2020_05_30_162638_remove_mib_polling_tables',1); +INSERT INTO `migrations` VALUES (170,'2020_06_06_222222_create_device_outages_table',1); +INSERT INTO `migrations` VALUES (171,'2020_06_23_00522_alter_availability_perc_column',1); +INSERT INTO `migrations` VALUES (172,'2020_07_27_00522_alter_devices_snmp_algo_columns',1); +INSERT INTO `migrations` VALUES (173,'2020_07_29_143221_add_device_perf_index',1); +INSERT INTO `migrations` VALUES (174,'2020_08_28_212054_drop_uptime_column_outages',1); +INSERT INTO `migrations` VALUES (175,'2020_09_18_223431_create_cache_table',1); +INSERT INTO `migrations` VALUES (176,'2020_09_22_172321_add_alert_log_index',1); +INSERT INTO `migrations` VALUES (177,'2020_09_24_000500_create_cache_locks_table',1); +INSERT INTO `migrations` VALUES (178,'2020_10_03_1000_add_primary_key_bill_perms',1); +INSERT INTO `migrations` VALUES (179,'2020_10_03_1000_add_primary_key_bill_ports',1); +INSERT INTO `migrations` VALUES (180,'2020_10_03_1000_add_primary_key_devices_perms',1); +INSERT INTO `migrations` VALUES (181,'2020_10_03_1000_add_primary_key_entPhysical_state',1); +INSERT INTO `migrations` VALUES (182,'2020_10_03_1000_add_primary_key_ipv4_mac',1); +INSERT INTO `migrations` VALUES (183,'2020_10_03_1000_add_primary_key_juniAtmVp',1); +INSERT INTO `migrations` VALUES (184,'2020_10_03_1000_add_primary_key_loadbalancer_vservers',1); +INSERT INTO `migrations` VALUES (185,'2020_10_03_1000_add_primary_key_ports_perms',1); +INSERT INTO `migrations` VALUES (186,'2020_10_03_1000_add_primary_key_processes',1); +INSERT INTO `migrations` VALUES (187,'2020_10_03_1000_add_primary_key_transport_group_transport',1); +INSERT INTO `migrations` VALUES (188,'2020_10_21_124101_allow_nullable_ospf_columns',1); diff --git a/database/schema/testing_persistent-schema.dump b/database/schema/testing_persistent-schema.dump new file mode 100644 index 0000000000..16ba006bb0 --- /dev/null +++ b/database/schema/testing_persistent-schema.dump @@ -0,0 +1,481 @@ +CREATE TABLE IF NOT EXISTS "migrations" ("id" integer not null primary key autoincrement, "migration" varchar not null, "batch" integer not null); +CREATE TABLE IF NOT EXISTS "access_points" ("accesspoint_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "radio_number" integer null, "type" varchar not null, "mac_addr" varchar not null, "deleted" tinyint(1) not null default '0', "channel" integer not null default '0', "txpow" integer not null default '0', "radioutil" integer not null default '0', "numasoclients" integer not null default '0', "nummonclients" integer not null default '0', "numactbssid" integer not null default '0', "nummonbssid" integer not null default '0', "interference" integer not null); +CREATE INDEX "name" on "access_points" ("name", "radio_number"); +CREATE INDEX "access_points_deleted_index" on "access_points" ("deleted"); +CREATE TABLE IF NOT EXISTS "alert_device_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "device_id" integer not null); +CREATE UNIQUE INDEX "alert_device_map_rule_id_device_id_unique" on "alert_device_map" ("rule_id", "device_id"); +CREATE TABLE IF NOT EXISTS "alert_group_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "group_id" integer not null); +CREATE UNIQUE INDEX "alert_group_map_rule_id_group_id_unique" on "alert_group_map" ("rule_id", "group_id"); +CREATE TABLE IF NOT EXISTS "alert_log" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "device_id" integer not null, "state" integer not null, "details" blob null, "time_logged" datetime default CURRENT_TIMESTAMP not null); +CREATE INDEX "alert_log_rule_id_index" on "alert_log" ("rule_id"); +CREATE INDEX "alert_log_device_id_index" on "alert_log" ("device_id"); +CREATE INDEX "alert_log_time_logged_index" on "alert_log" ("time_logged"); +CREATE TABLE IF NOT EXISTS "alert_rules" ("id" integer not null primary key autoincrement, "rule" text not null, "severity" varchar check ("severity" in ('ok', 'warning', 'critical')) not null, "extra" varchar not null, "disabled" tinyint(1) not null, "name" varchar not null, "query" text not null, "builder" text not null, "proc" varchar null, "invert_map" tinyint(1) not null default '0'); +CREATE UNIQUE INDEX "alert_rules_name_unique" on "alert_rules" ("name"); +CREATE TABLE IF NOT EXISTS "alert_schedulables" ("item_id" integer not null primary key autoincrement, "schedule_id" integer not null, "alert_schedulable_id" integer not null, "alert_schedulable_type" varchar not null); +CREATE INDEX "schedulable_morph_index" on "alert_schedulables" ("alert_schedulable_type", "alert_schedulable_id"); +CREATE INDEX "alert_schedulables_schedule_id_index" on "alert_schedulables" ("schedule_id"); +CREATE TABLE IF NOT EXISTS "alert_template_map" ("id" integer not null primary key autoincrement, "alert_templates_id" integer not null, "alert_rule_id" integer not null); +CREATE INDEX "alert_templates_id" on "alert_template_map" ("alert_templates_id", "alert_rule_id"); +CREATE TABLE IF NOT EXISTS "alert_templates" ("id" integer not null primary key autoincrement, "name" varchar not null, "template" text not null, "title" varchar null, "title_rec" varchar null); +CREATE TABLE IF NOT EXISTS "alert_transport_groups" ("transport_group_id" integer not null primary key autoincrement, "transport_group_name" varchar not null); +CREATE TABLE IF NOT EXISTS "alert_transport_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "transport_or_group_id" integer not null, "target_type" varchar not null); +CREATE TABLE IF NOT EXISTS "alert_transports" ("transport_id" integer not null primary key autoincrement, "transport_name" varchar not null, "transport_type" varchar not null default 'mail', "is_default" tinyint(1) not null default '0', "transport_config" text null); +CREATE TABLE IF NOT EXISTS "alerts" ("id" integer not null primary key autoincrement, "device_id" integer not null, "rule_id" integer not null, "state" integer not null, "alerted" integer not null, "open" integer not null, "note" text null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "info" text not null); +CREATE UNIQUE INDEX "alerts_device_id_rule_id_unique" on "alerts" ("device_id", "rule_id"); +CREATE INDEX "alerts_device_id_index" on "alerts" ("device_id"); +CREATE INDEX "alerts_rule_id_index" on "alerts" ("rule_id"); +CREATE TABLE IF NOT EXISTS "api_tokens" ("id" integer not null primary key autoincrement, "user_id" integer not null, "token_hash" varchar null, "description" varchar not null, "disabled" tinyint(1) not null default '0'); +CREATE UNIQUE INDEX "api_tokens_token_hash_unique" on "api_tokens" ("token_hash"); +CREATE TABLE IF NOT EXISTS "applications" ("app_id" integer not null primary key autoincrement, "device_id" integer not null, "app_type" varchar not null, "app_state" varchar not null default 'UNKNOWN', "discovered" integer not null default '0', "app_state_prev" varchar null, "app_status" varchar not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "app_instance" varchar not null); +CREATE UNIQUE INDEX "applications_device_id_app_type_unique" on "applications" ("device_id", "app_type"); +CREATE TABLE IF NOT EXISTS "authlog" ("id" integer not null primary key autoincrement, "datetime" datetime default CURRENT_TIMESTAMP not null, "user" text not null, "address" text not null, "result" text not null); +CREATE TABLE IF NOT EXISTS "bgpPeers_cbgp" ("device_id" integer not null, "bgpPeerIdentifier" varchar not null, "afi" varchar not null, "safi" varchar not null, "AcceptedPrefixes" integer not null, "DeniedPrefixes" integer not null, "PrefixAdminLimit" integer not null, "PrefixThreshold" integer not null, "PrefixClearThreshold" integer not null, "AdvertisedPrefixes" integer not null, "SuppressedPrefixes" integer not null, "WithdrawnPrefixes" integer not null, "AcceptedPrefixes_delta" integer not null, "AcceptedPrefixes_prev" integer not null, "DeniedPrefixes_delta" integer not null, "DeniedPrefixes_prev" integer not null, "AdvertisedPrefixes_delta" integer not null, "AdvertisedPrefixes_prev" integer not null, "SuppressedPrefixes_delta" integer not null, "SuppressedPrefixes_prev" integer not null, "WithdrawnPrefixes_delta" integer not null, "WithdrawnPrefixes_prev" integer not null, "context_name" varchar null); +CREATE UNIQUE INDEX "bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique" on "bgpPeers_cbgp" ("device_id", "bgpPeerIdentifier", "afi", "safi"); +CREATE INDEX "bgppeers_cbgp_device_id_bgppeeridentifier_context_name_index" on "bgpPeers_cbgp" ("device_id", "bgpPeerIdentifier", "context_name"); +CREATE TABLE IF NOT EXISTS "bgpPeers" ("bgpPeer_id" integer not null primary key autoincrement, "device_id" integer not null, "astext" varchar not null, "bgpPeerIdentifier" text not null, "bgpPeerRemoteAs" integer not null, "bgpPeerState" text not null, "bgpPeerAdminStatus" text not null, "bgpLocalAddr" text not null, "bgpPeerRemoteAddr" text not null, "bgpPeerDescr" varchar not null default '', "bgpPeerInUpdates" integer not null, "bgpPeerOutUpdates" integer not null, "bgpPeerInTotalMessages" integer not null, "bgpPeerOutTotalMessages" integer not null, "bgpPeerFsmEstablishedTime" integer not null, "bgpPeerInUpdateElapsedTime" integer not null, "context_name" varchar null, "vrf_id" integer null, "bgpPeerLastErrorCode" integer null, "bgpPeerLastErrorSubCode" integer null, "bgpPeerLastErrorText" varchar null); +CREATE INDEX "bgppeers_device_id_context_name_index" on "bgpPeers" ("device_id", "context_name"); +CREATE TABLE IF NOT EXISTS "bill_data" ("bill_id" integer not null, "timestamp" datetime not null, "period" integer not null, "delta" integer not null, "in_delta" integer not null, "out_delta" integer not null, primary key ("bill_id", "timestamp")); +CREATE INDEX "bill_data_bill_id_index" on "bill_data" ("bill_id"); +CREATE TABLE IF NOT EXISTS "bill_history" ("bill_hist_id" integer not null primary key autoincrement, "bill_id" integer not null, "updated" datetime default CURRENT_TIMESTAMP not null, "bill_datefrom" datetime not null, "bill_dateto" datetime not null, "bill_type" text not null, "bill_allowed" integer not null, "bill_used" integer not null, "bill_overuse" integer not null, "bill_percent" numeric not null, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "rate_average" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "traf_in" integer not null, "traf_out" integer not null, "traf_total" integer not null, "pdf" blob null); +CREATE UNIQUE INDEX "bill_history_bill_id_bill_datefrom_bill_dateto_unique" on "bill_history" ("bill_id", "bill_datefrom", "bill_dateto"); +CREATE INDEX "bill_history_bill_id_index" on "bill_history" ("bill_id"); +CREATE TABLE IF NOT EXISTS "bill_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "bill_id" integer not null); +CREATE TABLE IF NOT EXISTS "bill_port_counters" ("port_id" integer not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "in_counter" integer null, "in_delta" integer not null default '0', "out_counter" integer null, "out_delta" integer not null default '0', "bill_id" integer not null, primary key ("port_id", "bill_id")); +CREATE TABLE IF NOT EXISTS "bill_ports" ("id" integer not null primary key autoincrement, "bill_id" integer not null, "port_id" integer not null, "bill_port_autoadded" tinyint(1) not null default '0'); +CREATE TABLE IF NOT EXISTS "bills" ("bill_id" integer not null primary key autoincrement, "bill_name" text not null, "bill_type" text not null, "bill_cdr" integer null, "bill_day" integer not null default '1', "bill_quota" integer null, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "total_data" integer not null, "total_data_in" integer not null, "total_data_out" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "rate_average" integer not null, "bill_last_calc" datetime not null, "bill_custid" varchar not null, "bill_ref" varchar not null, "bill_notes" varchar not null, "bill_autoadded" tinyint(1) not null); +CREATE TABLE IF NOT EXISTS "callback" ("callback_id" integer not null primary key autoincrement, "name" varchar not null, "value" varchar not null); +CREATE TABLE IF NOT EXISTS "cef_switching" ("cef_switching_id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" integer not null, "afi" varchar not null, "cef_index" integer not null, "cef_path" varchar not null, "drop" integer not null, "punt" integer not null, "punt2host" integer not null, "drop_prev" integer not null, "punt_prev" integer not null, "punt2host_prev" integer not null, "updated" integer not null, "updated_prev" integer not null); +CREATE UNIQUE INDEX "cef_switching_device_id_entphysicalindex_afi_cef_index_unique" on "cef_switching" ("device_id", "entPhysicalIndex", "afi", "cef_index"); +CREATE TABLE IF NOT EXISTS "ciscoASA" ("ciscoASA_id" integer not null primary key autoincrement, "device_id" integer not null, "oid" varchar not null, "data" integer not null, "high_alert" integer not null, "low_alert" integer not null, "disabled" integer not null default '0'); +CREATE INDEX "ciscoasa_device_id_index" on "ciscoASA" ("device_id"); +CREATE TABLE IF NOT EXISTS "component_prefs" ("id" integer not null primary key autoincrement, "component" integer not null, "attribute" varchar not null, "value" text not null); +CREATE INDEX "component_prefs_component_index" on "component_prefs" ("component"); +CREATE TABLE IF NOT EXISTS "component_statuslog" ("id" integer not null primary key autoincrement, "component_id" integer not null, "status" tinyint(1) not null default '0', "message" text null, "timestamp" datetime default CURRENT_TIMESTAMP not null); +CREATE INDEX "component_statuslog_component_id_index" on "component_statuslog" ("component_id"); +CREATE TABLE IF NOT EXISTS "component" ("id" integer not null primary key autoincrement, "device_id" integer not null, "type" varchar not null, "label" varchar null, "status" tinyint(1) not null default '0', "disabled" tinyint(1) not null default '0', "ignore" tinyint(1) not null default '0', "error" varchar null); +CREATE INDEX "component_device_id_index" on "component" ("device_id"); +CREATE INDEX "component_type_index" on "component" ("type"); +CREATE TABLE IF NOT EXISTS "customers" ("customer_id" integer not null primary key autoincrement, "username" varchar not null, "password" varchar not null, "string" varchar not null, "level" integer not null default '0'); +CREATE UNIQUE INDEX "customers_username_unique" on "customers" ("username"); +CREATE TABLE IF NOT EXISTS "dashboards" ("dashboard_id" integer not null primary key autoincrement, "user_id" integer not null default '0', "dashboard_name" varchar not null, "access" tinyint(1) not null default '0'); +CREATE TABLE IF NOT EXISTS "dbSchema" ("version" integer not null default '0', primary key ("version")); +CREATE TABLE IF NOT EXISTS "device_graphs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "graph" varchar null); +CREATE INDEX "device_graphs_device_id_index" on "device_graphs" ("device_id"); +CREATE TABLE IF NOT EXISTS "device_group_device" ("device_group_id" integer not null, "device_id" integer not null, primary key ("device_group_id", "device_id")); +CREATE INDEX "device_group_device_device_group_id_index" on "device_group_device" ("device_group_id"); +CREATE INDEX "device_group_device_device_id_index" on "device_group_device" ("device_id"); +CREATE TABLE IF NOT EXISTS "device_perf" ("id" integer not null primary key autoincrement, "device_id" integer not null, "timestamp" datetime not null, "xmt" integer not null, "rcv" integer not null, "loss" integer not null, "min" float not null, "max" float not null, "avg" float not null, "debug" text null); +CREATE INDEX "device_perf_device_id_index" on "device_perf" ("device_id"); +CREATE TABLE IF NOT EXISTS "device_relationships" ("parent_device_id" integer not null default '0', "child_device_id" integer not null, primary key ("parent_device_id", "child_device_id")); +CREATE INDEX "device_relationships_child_device_id_index" on "device_relationships" ("child_device_id"); +CREATE TABLE IF NOT EXISTS "devices_attribs" ("attrib_id" integer not null primary key autoincrement, "device_id" integer not null, "attrib_type" varchar not null, "attrib_value" text not null, "updated" datetime default CURRENT_TIMESTAMP not null); +CREATE INDEX "devices_attribs_device_id_index" on "devices_attribs" ("device_id"); +CREATE TABLE IF NOT EXISTS "devices_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "device_id" integer not null); +CREATE INDEX "devices_perms_user_id_index" on "devices_perms" ("user_id"); +CREATE TABLE IF NOT EXISTS "entPhysical_state" ("id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" varchar not null, "subindex" varchar null, "group" varchar not null, "key" varchar not null, "value" varchar not null); +CREATE INDEX "device_id_index" on "entPhysical_state" ("device_id", "entPhysicalIndex"); +CREATE TABLE IF NOT EXISTS "entPhysical" ("entPhysical_id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" integer not null, "entPhysicalDescr" text not null, "entPhysicalClass" text not null, "entPhysicalName" text not null, "entPhysicalHardwareRev" varchar null, "entPhysicalFirmwareRev" varchar null, "entPhysicalSoftwareRev" varchar null, "entPhysicalAlias" varchar null, "entPhysicalAssetID" varchar null, "entPhysicalIsFRU" varchar null, "entPhysicalModelName" text not null, "entPhysicalVendorType" text null, "entPhysicalSerialNum" text not null, "entPhysicalContainedIn" integer not null, "entPhysicalParentRelPos" integer not null, "entPhysicalMfgName" text not null, "ifIndex" integer null); +CREATE INDEX "entphysical_device_id_index" on "entPhysical" ("device_id"); +CREATE TABLE IF NOT EXISTS "entityState" ("entity_state_id" integer not null primary key autoincrement, "device_id" integer null, "entPhysical_id" integer null, "entStateLastChanged" datetime null, "entStateAdmin" integer null, "entStateOper" integer null, "entStateUsage" integer null, "entStateAlarm" text null, "entStateStandby" integer null); +CREATE INDEX "entitystate_device_id_index" on "entityState" ("device_id"); +CREATE TABLE IF NOT EXISTS "eventlog" ("event_id" integer not null primary key autoincrement, "device_id" integer null, "datetime" datetime not null default '1970-01-02 00:00:01', "message" text null, "type" varchar null, "reference" varchar null, "username" varchar null, "severity" integer not null default '2'); +CREATE INDEX "eventlog_device_id_index" on "eventlog" ("device_id"); +CREATE INDEX "eventlog_datetime_index" on "eventlog" ("datetime"); +CREATE TABLE IF NOT EXISTS "graph_types" ("graph_type" varchar not null, "graph_subtype" varchar not null, "graph_section" varchar not null, "graph_descr" varchar null, "graph_order" integer not null, primary key ("graph_type", "graph_subtype", "graph_section")); +CREATE INDEX "graph_types_graph_type_index" on "graph_types" ("graph_type"); +CREATE INDEX "graph_types_graph_subtype_index" on "graph_types" ("graph_subtype"); +CREATE INDEX "graph_types_graph_section_index" on "graph_types" ("graph_section"); +CREATE TABLE IF NOT EXISTS "hrDevice" ("hrDevice_id" integer not null primary key autoincrement, "device_id" integer not null, "hrDeviceIndex" integer not null, "hrDeviceDescr" text not null, "hrDeviceType" text not null, "hrDeviceErrors" integer not null default '0', "hrDeviceStatus" text not null, "hrProcessorLoad" integer null); +CREATE INDEX "hrdevice_device_id_index" on "hrDevice" ("device_id"); +CREATE TABLE IF NOT EXISTS "ipsec_tunnels" ("tunnel_id" integer not null primary key autoincrement, "device_id" integer not null, "peer_port" integer not null, "peer_addr" varchar not null, "local_addr" varchar not null, "local_port" integer not null, "tunnel_name" varchar not null, "tunnel_status" varchar not null); +CREATE UNIQUE INDEX "ipsec_tunnels_device_id_peer_addr_unique" on "ipsec_tunnels" ("device_id", "peer_addr"); +CREATE TABLE IF NOT EXISTS "ipv4_addresses" ("ipv4_address_id" integer not null primary key autoincrement, "ipv4_address" varchar not null, "ipv4_prefixlen" integer not null, "ipv4_network_id" varchar not null, "port_id" integer not null, "context_name" varchar null); +CREATE INDEX "ipv4_addresses_port_id_index" on "ipv4_addresses" ("port_id"); +CREATE TABLE IF NOT EXISTS "ipv4_mac" ("id" integer not null primary key autoincrement, "port_id" integer not null, "device_id" integer null, "mac_address" varchar not null, "ipv4_address" varchar not null, "context_name" varchar not null); +CREATE INDEX "ipv4_mac_port_id_index" on "ipv4_mac" ("port_id"); +CREATE INDEX "ipv4_mac_mac_address_index" on "ipv4_mac" ("mac_address"); +CREATE TABLE IF NOT EXISTS "ipv4_networks" ("ipv4_network_id" integer not null primary key autoincrement, "ipv4_network" varchar not null, "context_name" varchar null); +CREATE TABLE IF NOT EXISTS "ipv6_addresses" ("ipv6_address_id" integer not null primary key autoincrement, "ipv6_address" varchar not null, "ipv6_compressed" varchar not null, "ipv6_prefixlen" integer not null, "ipv6_origin" varchar not null, "ipv6_network_id" varchar not null, "port_id" integer not null, "context_name" varchar null); +CREATE INDEX "ipv6_addresses_port_id_index" on "ipv6_addresses" ("port_id"); +CREATE TABLE IF NOT EXISTS "ipv6_networks" ("ipv6_network_id" integer not null primary key autoincrement, "ipv6_network" varchar not null, "context_name" varchar null); +CREATE TABLE IF NOT EXISTS "juniAtmVp" ("id" integer not null primary key autoincrement, "juniAtmVp_id" integer not null, "port_id" integer not null, "vp_id" integer not null, "vp_descr" varchar not null); +CREATE INDEX "juniatmvp_port_id_index" on "juniAtmVp" ("port_id"); +CREATE TABLE IF NOT EXISTS "links" ("id" integer not null primary key autoincrement, "local_port_id" integer null, "local_device_id" integer not null, "remote_port_id" integer null, "active" tinyint(1) not null default '1', "protocol" varchar null, "remote_hostname" varchar not null, "remote_device_id" integer not null, "remote_port" varchar not null, "remote_platform" varchar null, "remote_version" varchar not null); +CREATE INDEX "local_device_id" on "links" ("local_device_id", "remote_device_id"); +CREATE INDEX "links_local_port_id_index" on "links" ("local_port_id"); +CREATE INDEX "links_remote_port_id_index" on "links" ("remote_port_id"); +CREATE TABLE IF NOT EXISTS "loadbalancer_rservers" ("rserver_id" integer not null primary key autoincrement, "farm_id" varchar not null, "device_id" integer not null, "StateDescr" varchar not null); +CREATE TABLE IF NOT EXISTS "loadbalancer_vservers" ("id" integer not null primary key autoincrement, "classmap_id" integer not null, "classmap" varchar not null, "serverstate" varchar not null, "device_id" integer not null); +CREATE INDEX "loadbalancer_vservers_device_id_index" on "loadbalancer_vservers" ("device_id"); +CREATE TABLE IF NOT EXISTS "locations" ("id" integer not null primary key autoincrement, "location" varchar not null, "lat" float null, "lng" float null, "timestamp" datetime not null); +CREATE UNIQUE INDEX "locations_location_unique" on "locations" ("location"); +CREATE TABLE IF NOT EXISTS "mac_accounting" ("ma_id" integer not null primary key autoincrement, "port_id" integer not null, "mac" varchar not null, "in_oid" varchar not null, "out_oid" varchar not null, "bps_out" integer not null, "bps_in" integer not null, "cipMacHCSwitchedBytes_input" integer null, "cipMacHCSwitchedBytes_input_prev" integer null, "cipMacHCSwitchedBytes_input_delta" integer null, "cipMacHCSwitchedBytes_input_rate" integer null, "cipMacHCSwitchedBytes_output" integer null, "cipMacHCSwitchedBytes_output_prev" integer null, "cipMacHCSwitchedBytes_output_delta" integer null, "cipMacHCSwitchedBytes_output_rate" integer null, "cipMacHCSwitchedPkts_input" integer null, "cipMacHCSwitchedPkts_input_prev" integer null, "cipMacHCSwitchedPkts_input_delta" integer null, "cipMacHCSwitchedPkts_input_rate" integer null, "cipMacHCSwitchedPkts_output" integer null, "cipMacHCSwitchedPkts_output_prev" integer null, "cipMacHCSwitchedPkts_output_delta" integer null, "cipMacHCSwitchedPkts_output_rate" integer null, "poll_time" integer null, "poll_prev" integer null, "poll_period" integer null); +CREATE INDEX "mac_accounting_port_id_index" on "mac_accounting" ("port_id"); +CREATE TABLE IF NOT EXISTS "mefinfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "mefID" integer not null, "mefType" varchar not null, "mefIdent" varchar not null, "mefMTU" integer not null default '1500', "mefAdmState" varchar not null, "mefRowState" varchar not null); +CREATE INDEX "mefinfo_device_id_index" on "mefinfo" ("device_id"); +CREATE INDEX "mefinfo_mefid_index" on "mefinfo" ("mefID"); +CREATE TABLE IF NOT EXISTS "munin_plugins_ds" ("mplug_id" integer not null, "ds_name" varchar not null, "ds_type" varchar check ("ds_type" in ('COUNTER', 'ABSOLUTE', 'DERIVE', 'GAUGE')) not null default 'GAUGE', "ds_label" varchar not null, "ds_cdef" varchar not null, "ds_draw" varchar not null, "ds_graph" varchar check ("ds_graph" in ('no', 'yes')) not null default 'yes', "ds_info" varchar not null, "ds_extinfo" text not null, "ds_max" varchar not null, "ds_min" varchar not null, "ds_negative" varchar not null, "ds_warning" varchar not null, "ds_critical" varchar not null, "ds_colour" varchar not null, "ds_sum" text not null, "ds_stack" text not null, "ds_line" varchar not null); +CREATE UNIQUE INDEX "munin_plugins_ds_mplug_id_ds_name_unique" on "munin_plugins_ds" ("mplug_id", "ds_name"); +CREATE TABLE IF NOT EXISTS "munin_plugins" ("mplug_id" integer not null primary key autoincrement, "device_id" integer not null, "mplug_type" varchar not null, "mplug_instance" varchar null, "mplug_category" varchar null, "mplug_title" varchar null, "mplug_info" text null, "mplug_vlabel" varchar null, "mplug_args" varchar null, "mplug_total" tinyint(1) not null default '0', "mplug_graph" tinyint(1) not null default '1'); +CREATE UNIQUE INDEX "munin_plugins_device_id_mplug_type_unique" on "munin_plugins" ("device_id", "mplug_type"); +CREATE INDEX "munin_plugins_device_id_index" on "munin_plugins" ("device_id"); +CREATE TABLE IF NOT EXISTS "netscaler_vservers" ("vsvr_id" integer not null primary key autoincrement, "device_id" integer not null, "vsvr_name" varchar not null, "vsvr_ip" varchar not null, "vsvr_port" integer not null, "vsvr_type" varchar not null, "vsvr_state" varchar not null, "vsvr_clients" integer not null, "vsvr_server" integer not null, "vsvr_req_rate" integer not null, "vsvr_bps_in" integer not null, "vsvr_bps_out" integer not null); +CREATE TABLE IF NOT EXISTS "notifications_attribs" ("attrib_id" integer not null primary key autoincrement, "notifications_id" integer not null, "user_id" integer not null, "key" varchar not null default '', "value" varchar not null default ''); +CREATE TABLE IF NOT EXISTS "notifications" ("notifications_id" integer not null primary key autoincrement, "title" varchar not null default '', "body" text not null, "severity" integer null default '0', "source" varchar not null default '', "checksum" varchar not null, "datetime" datetime not null default '1970-01-02 00:00:00'); +CREATE INDEX "notifications_severity_index" on "notifications" ("severity"); +CREATE UNIQUE INDEX "notifications_checksum_unique" on "notifications" ("checksum"); +CREATE TABLE IF NOT EXISTS "ospf_instances" ("id" integer not null primary key autoincrement, "device_id" integer not null, "ospf_instance_id" integer not null, "ospfRouterId" varchar not null, "ospfAdminStat" varchar not null, "ospfVersionNumber" varchar not null, "ospfAreaBdrRtrStatus" varchar not null, "ospfASBdrRtrStatus" varchar not null, "ospfExternLsaCount" integer not null, "ospfExternLsaCksumSum" integer not null, "ospfTOSSupport" varchar not null, "ospfOriginateNewLsas" integer not null, "ospfRxNewLsas" integer not null, "ospfExtLsdbLimit" integer null, "ospfMulticastExtensions" integer null, "ospfExitOverflowInterval" integer null, "ospfDemandExtensions" varchar null, "context_name" varchar null); +CREATE UNIQUE INDEX "ospf_instances_device_id_ospf_instance_id_context_name_unique" on "ospf_instances" ("device_id", "ospf_instance_id", "context_name"); +CREATE TABLE IF NOT EXISTS "ospf_nbrs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer null, "ospf_nbr_id" varchar not null, "ospfNbrIpAddr" varchar not null, "ospfNbrAddressLessIndex" integer not null, "ospfNbrRtrId" varchar not null, "ospfNbrOptions" integer not null, "ospfNbrPriority" integer not null, "ospfNbrState" varchar not null, "ospfNbrEvents" integer not null, "ospfNbrLsRetransQLen" integer not null, "ospfNbmaNbrStatus" varchar not null, "ospfNbmaNbrPermanence" varchar not null, "ospfNbrHelloSuppressed" varchar not null, "context_name" varchar null); +CREATE UNIQUE INDEX "ospf_nbrs_device_id_ospf_nbr_id_context_name_unique" on "ospf_nbrs" ("device_id", "ospf_nbr_id", "context_name"); +CREATE TABLE IF NOT EXISTS "ospf_ports" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "ospf_port_id" varchar not null, "ospfIfIpAddress" varchar not null, "ospfAddressLessIf" integer not null, "ospfIfAreaId" varchar not null, "ospfIfType" varchar null, "ospfIfAdminStat" varchar null, "ospfIfRtrPriority" integer null, "ospfIfTransitDelay" integer null, "ospfIfRetransInterval" integer null, "ospfIfHelloInterval" integer null, "ospfIfRtrDeadInterval" integer null, "ospfIfPollInterval" integer null, "ospfIfState" varchar null, "ospfIfDesignatedRouter" varchar null, "ospfIfBackupDesignatedRouter" varchar null, "ospfIfEvents" integer null, "ospfIfAuthKey" varchar null, "ospfIfStatus" varchar null, "ospfIfMulticastForwarding" varchar null, "ospfIfDemand" varchar null, "ospfIfAuthType" varchar null, "context_name" varchar null); +CREATE UNIQUE INDEX "ospf_ports_device_id_ospf_port_id_context_name_unique" on "ospf_ports" ("device_id", "ospf_port_id", "context_name"); +CREATE TABLE IF NOT EXISTS "packages" ("pkg_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "manager" varchar not null default '1', "status" tinyint(1) not null, "version" varchar not null, "build" varchar not null, "arch" varchar not null, "size" integer null); +CREATE UNIQUE INDEX "packages_device_id_name_manager_arch_version_build_unique" on "packages" ("device_id", "name", "manager", "arch", "version", "build"); +CREATE INDEX "packages_device_id_index" on "packages" ("device_id"); +CREATE TABLE IF NOT EXISTS "pdb_ix_peers" ("pdb_ix_peers_id" integer not null primary key autoincrement, "ix_id" integer not null, "peer_id" integer not null, "remote_asn" integer not null, "remote_ipaddr4" varchar null, "remote_ipaddr6" varchar null, "name" varchar null, "timestamp" integer null); +CREATE TABLE IF NOT EXISTS "pdb_ix" ("pdb_ix_id" integer not null primary key autoincrement, "ix_id" integer not null, "name" varchar not null, "asn" integer not null, "timestamp" integer not null); +CREATE TABLE IF NOT EXISTS "perf_times" ("id" integer not null primary key autoincrement, "type" varchar not null, "doing" varchar not null, "start" integer not null, "duration" float not null, "devices" integer not null, "poller" varchar not null); +CREATE INDEX "perf_times_type_index" on "perf_times" ("type"); +CREATE TABLE IF NOT EXISTS "plugins" ("plugin_id" integer not null primary key autoincrement, "plugin_name" varchar not null, "plugin_active" integer not null); +CREATE TABLE IF NOT EXISTS "poller_cluster_stats" ("id" integer not null primary key autoincrement, "parent_poller" integer not null default '0', "poller_type" varchar not null default '', "depth" integer not null, "devices" integer not null, "worker_seconds" float not null, "workers" integer not null, "frequency" integer not null); +CREATE UNIQUE INDEX "poller_cluster_stats_parent_poller_poller_type_unique" on "poller_cluster_stats" ("parent_poller", "poller_type"); +CREATE TABLE IF NOT EXISTS "poller_cluster" ("id" integer not null primary key autoincrement, "node_id" varchar not null, "poller_name" varchar not null, "poller_version" varchar not null default '', "poller_groups" varchar not null default '', "last_report" datetime not null, "master" tinyint(1) not null, "poller_enabled" tinyint(1) null, "poller_frequency" integer null, "poller_workers" integer null, "poller_down_retry" integer null, "discovery_enabled" tinyint(1) null, "discovery_frequency" integer null, "discovery_workers" integer null, "services_enabled" tinyint(1) null, "services_frequency" integer null, "services_workers" integer null, "billing_enabled" tinyint(1) null, "billing_frequency" integer null, "billing_calculate_frequency" integer null, "alerting_enabled" tinyint(1) null, "alerting_frequency" integer null, "ping_enabled" tinyint(1) null, "ping_frequency" integer null, "update_enabled" tinyint(1) null, "update_frequency" integer null, "loglevel" varchar null, "watchdog_enabled" tinyint(1) null, "watchdog_log" varchar null); +CREATE UNIQUE INDEX "poller_cluster_node_id_unique" on "poller_cluster" ("node_id"); +CREATE TABLE IF NOT EXISTS "poller_groups" ("id" integer not null primary key autoincrement, "group_name" varchar not null, "descr" varchar not null); +CREATE TABLE IF NOT EXISTS "pollers" ("id" integer not null primary key autoincrement, "poller_name" varchar not null, "last_polled" datetime not null, "devices" integer not null, "time_taken" float not null); +CREATE UNIQUE INDEX "pollers_poller_name_unique" on "pollers" ("poller_name"); +CREATE TABLE IF NOT EXISTS "ports_adsl" ("port_id" integer not null, "port_adsl_updated" datetime default CURRENT_TIMESTAMP not null, "adslLineCoding" varchar not null, "adslLineType" varchar not null, "adslAtucInvVendorID" varchar not null, "adslAtucInvVersionNumber" varchar not null, "adslAtucCurrSnrMgn" numeric not null, "adslAtucCurrAtn" numeric not null, "adslAtucCurrOutputPwr" numeric not null, "adslAtucCurrAttainableRate" integer not null, "adslAtucChanCurrTxRate" integer not null, "adslAturInvSerialNumber" varchar not null, "adslAturInvVendorID" varchar not null, "adslAturInvVersionNumber" varchar not null, "adslAturChanCurrTxRate" integer not null, "adslAturCurrSnrMgn" numeric not null, "adslAturCurrAtn" numeric not null, "adslAturCurrOutputPwr" numeric not null, "adslAturCurrAttainableRate" integer not null); +CREATE UNIQUE INDEX "ports_adsl_port_id_unique" on "ports_adsl" ("port_id"); +CREATE TABLE IF NOT EXISTS "ports_fdb" ("ports_fdb_id" integer not null primary key autoincrement, "port_id" integer not null, "mac_address" varchar not null, "vlan_id" integer not null, "device_id" integer not null, "created_at" datetime null, "updated_at" datetime null); +CREATE INDEX "ports_fdb_port_id_index" on "ports_fdb" ("port_id"); +CREATE INDEX "ports_fdb_mac_address_index" on "ports_fdb" ("mac_address"); +CREATE INDEX "ports_fdb_vlan_id_index" on "ports_fdb" ("vlan_id"); +CREATE INDEX "ports_fdb_device_id_index" on "ports_fdb" ("device_id"); +CREATE TABLE IF NOT EXISTS "ports_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "port_id" integer not null); +CREATE TABLE IF NOT EXISTS "ports_stack" ("device_id" integer not null, "port_id_high" integer not null, "port_id_low" integer not null, "ifStackStatus" varchar not null); +CREATE UNIQUE INDEX "ports_stack_device_id_port_id_high_port_id_low_unique" on "ports_stack" ("device_id", "port_id_high", "port_id_low"); +CREATE TABLE IF NOT EXISTS "ports_statistics" ("port_id" integer not null, "ifInNUcastPkts" integer null, "ifInNUcastPkts_prev" integer null, "ifInNUcastPkts_delta" integer null, "ifInNUcastPkts_rate" integer null, "ifOutNUcastPkts" integer null, "ifOutNUcastPkts_prev" integer null, "ifOutNUcastPkts_delta" integer null, "ifOutNUcastPkts_rate" integer null, "ifInDiscards" integer null, "ifInDiscards_prev" integer null, "ifInDiscards_delta" integer null, "ifInDiscards_rate" integer null, "ifOutDiscards" integer null, "ifOutDiscards_prev" integer null, "ifOutDiscards_delta" integer null, "ifOutDiscards_rate" integer null, "ifInUnknownProtos" integer null, "ifInUnknownProtos_prev" integer null, "ifInUnknownProtos_delta" integer null, "ifInUnknownProtos_rate" integer null, "ifInBroadcastPkts" integer null, "ifInBroadcastPkts_prev" integer null, "ifInBroadcastPkts_delta" integer null, "ifInBroadcastPkts_rate" integer null, "ifOutBroadcastPkts" integer null, "ifOutBroadcastPkts_prev" integer null, "ifOutBroadcastPkts_delta" integer null, "ifOutBroadcastPkts_rate" integer null, "ifInMulticastPkts" integer null, "ifInMulticastPkts_prev" integer null, "ifInMulticastPkts_delta" integer null, "ifInMulticastPkts_rate" integer null, "ifOutMulticastPkts" integer null, "ifOutMulticastPkts_prev" integer null, "ifOutMulticastPkts_delta" integer null, "ifOutMulticastPkts_rate" integer null, primary key ("port_id")); +CREATE TABLE IF NOT EXISTS "ports_stp" ("port_stp_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "priority" integer not null, "state" varchar not null, "enable" varchar not null, "pathCost" integer not null, "designatedRoot" varchar not null, "designatedCost" integer not null, "designatedBridge" varchar not null, "designatedPort" integer not null, "forwardTransitions" integer not null); +CREATE UNIQUE INDEX "ports_stp_device_id_port_id_unique" on "ports_stp" ("device_id", "port_id"); +CREATE TABLE IF NOT EXISTS "ports" ("port_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "port_descr_type" varchar null, "port_descr_descr" varchar null, "port_descr_circuit" varchar null, "port_descr_speed" varchar null, "port_descr_notes" varchar null, "ifDescr" varchar null, "ifName" varchar null, "portName" varchar null, "ifIndex" integer null default '0', "ifSpeed" integer null, "ifConnectorPresent" varchar null, "ifPromiscuousMode" varchar null, "ifHighSpeed" integer null, "ifOperStatus" varchar null, "ifOperStatus_prev" varchar null, "ifAdminStatus" varchar null, "ifAdminStatus_prev" varchar null, "ifDuplex" varchar null, "ifMtu" integer null, "ifType" text null, "ifAlias" text null, "ifPhysAddress" text null, "ifHardType" varchar null, "ifLastChange" integer not null default '0', "ifVlan" varchar not null default '', "ifTrunk" varchar null, "ifVrf" integer not null default '0', "counter_in" integer null, "counter_out" integer 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 null, "pagpPortState" varchar null, "pagpPartnerDeviceId" varchar null, "pagpPartnerLearnMethod" varchar null, "pagpPartnerIfIndex" integer null, "pagpPartnerGroupIfIndex" integer null, "pagpPartnerDeviceName" varchar null, "pagpEthcOperationMode" varchar null, "pagpDeviceId" varchar null, "pagpGroupIfIndex" integer null, "ifInUcastPkts" integer null, "ifInUcastPkts_prev" integer null, "ifInUcastPkts_delta" integer null, "ifInUcastPkts_rate" integer null, "ifOutUcastPkts" integer null, "ifOutUcastPkts_prev" integer null, "ifOutUcastPkts_delta" integer null, "ifOutUcastPkts_rate" integer null, "ifInErrors" integer null, "ifInErrors_prev" integer null, "ifInErrors_delta" integer null, "ifInErrors_rate" integer null, "ifOutErrors" integer null, "ifOutErrors_prev" integer null, "ifOutErrors_delta" integer null, "ifOutErrors_rate" integer null, "ifInOctets" integer null, "ifInOctets_prev" integer null, "ifInOctets_delta" integer null, "ifInOctets_rate" integer null, "ifOutOctets" integer null, "ifOutOctets_prev" integer null, "ifOutOctets_delta" integer null, "ifOutOctets_rate" integer null, "poll_time" integer null, "poll_prev" integer null, "poll_period" integer null, "ifSpeed_prev" integer null, "ifHighSpeed_prev" integer null); +CREATE UNIQUE INDEX "ports_device_id_ifindex_unique" on "ports" ("device_id", "ifIndex"); +CREATE INDEX "ports_ifdescr_index" on "ports" ("ifDescr"); +CREATE TABLE IF NOT EXISTS "ports_vlans" ("port_vlan_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "vlan" integer not null, "baseport" integer not null, "priority" integer not null, "state" varchar not null, "cost" integer not null, "untagged" tinyint(1) not null default '0'); +CREATE UNIQUE INDEX "ports_vlans_device_id_port_id_vlan_unique" on "ports_vlans" ("device_id", "port_id", "vlan"); +CREATE TABLE IF NOT EXISTS "processes" ("id" integer not null primary key autoincrement, "device_id" integer not null, "pid" integer not null, "vsz" integer not null, "rss" integer not null, "cputime" varchar not null, "user" varchar not null, "command" text not null); +CREATE INDEX "processes_device_id_index" on "processes" ("device_id"); +CREATE TABLE IF NOT EXISTS "processors" ("processor_id" integer not null primary key autoincrement, "entPhysicalIndex" integer not null default '0', "hrDeviceIndex" integer null, "device_id" integer not null, "processor_oid" varchar not null, "processor_index" varchar not null, "processor_type" varchar not null, "processor_usage" integer not null, "processor_descr" varchar not null, "processor_precision" integer not null default '1', "processor_perc_warn" integer null default '75'); +CREATE INDEX "processors_device_id_index" on "processors" ("device_id"); +CREATE TABLE IF NOT EXISTS "proxmox_ports" ("id" integer not null primary key autoincrement, "vm_id" integer not null, "port" varchar not null, "last_seen" datetime default CURRENT_TIMESTAMP not null); +CREATE UNIQUE INDEX "proxmox_ports_vm_id_port_unique" on "proxmox_ports" ("vm_id", "port"); +CREATE TABLE IF NOT EXISTS "proxmox" ("id" integer not null primary key autoincrement, "device_id" integer not null default '0', "vmid" integer not null, "cluster" varchar not null, "description" varchar null, "last_seen" datetime default CURRENT_TIMESTAMP not null); +CREATE UNIQUE INDEX "proxmox_cluster_vmid_unique" on "proxmox" ("cluster", "vmid"); +CREATE TABLE IF NOT EXISTS "pseudowires" ("pseudowire_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "peer_device_id" integer not null, "peer_ldp_id" integer not null, "cpwVcID" integer not null, "cpwOid" integer not null, "pw_type" varchar not null, "pw_psntype" varchar not null, "pw_local_mtu" integer not null, "pw_peer_mtu" integer not null, "pw_descr" varchar not null); +CREATE TABLE IF NOT EXISTS "sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "poller_type" varchar not null default 'snmp', "sensor_oid" varchar not null, "sensor_index" varchar null, "sensor_type" varchar not null, "sensor_descr" varchar null, "group" varchar null, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_current" float null, "sensor_limit" float null, "sensor_limit_warn" float null, "sensor_limit_low" float null, "sensor_limit_low_warn" float null, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar null, "entPhysicalIndex_measured" varchar null, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_prev" float null, "user_func" varchar null); +CREATE INDEX "sensors_sensor_class_index" on "sensors" ("sensor_class"); +CREATE INDEX "sensors_device_id_index" on "sensors" ("device_id"); +CREATE INDEX "sensors_sensor_type_index" on "sensors" ("sensor_type"); +CREATE TABLE IF NOT EXISTS "sensors_to_state_indexes" ("sensors_to_state_translations_id" integer not null primary key autoincrement, "sensor_id" integer not null, "state_index_id" integer not null); +CREATE UNIQUE INDEX "sensors_to_state_indexes_sensor_id_state_index_id_unique" on "sensors_to_state_indexes" ("sensor_id", "state_index_id"); +CREATE INDEX "sensors_to_state_indexes_state_index_id_index" on "sensors_to_state_indexes" ("state_index_id"); +CREATE TABLE IF NOT EXISTS "services" ("service_id" integer not null primary key autoincrement, "device_id" integer not null, "service_ip" text not null, "service_type" varchar not null, "service_desc" text not null, "service_param" text not null, "service_ignore" tinyint(1) not null, "service_status" integer not null default '0', "service_changed" integer not null default '0', "service_message" text not null, "service_disabled" tinyint(1) not null default '0', "service_ds" text not null); +CREATE INDEX "services_device_id_index" on "services" ("device_id"); +CREATE TABLE IF NOT EXISTS "session" ("session_id" integer not null primary key autoincrement, "session_username" varchar not null, "session_value" varchar not null, "session_token" varchar not null, "session_auth" varchar not null, "session_expiry" integer not null); +CREATE UNIQUE INDEX "session_session_value_unique" on "session" ("session_value"); +CREATE TABLE IF NOT EXISTS "slas" ("sla_id" integer not null primary key autoincrement, "device_id" integer not null, "sla_nr" integer not null, "owner" varchar not null, "tag" varchar not null, "rtt_type" varchar not null, "status" tinyint(1) not null, "opstatus" tinyint(1) not null default '0', "deleted" tinyint(1) not null default '0'); +CREATE UNIQUE INDEX "slas_device_id_sla_nr_unique" on "slas" ("device_id", "sla_nr"); +CREATE INDEX "slas_device_id_index" on "slas" ("device_id"); +CREATE TABLE IF NOT EXISTS "state_indexes" ("state_index_id" integer not null primary key autoincrement, "state_name" varchar not null); +CREATE UNIQUE INDEX "state_indexes_state_name_unique" on "state_indexes" ("state_name"); +CREATE TABLE IF NOT EXISTS "state_translations" ("state_translation_id" integer not null primary key autoincrement, "state_index_id" integer not null, "state_descr" varchar not null, "state_draw_graph" tinyint(1) not null, "state_value" integer not null default '0', "state_generic_value" tinyint(1) not null, "state_lastupdated" datetime default CURRENT_TIMESTAMP not null); +CREATE UNIQUE INDEX "state_translations_state_index_id_state_value_unique" on "state_translations" ("state_index_id", "state_value"); +CREATE TABLE IF NOT EXISTS "storage" ("storage_id" integer not null primary key autoincrement, "device_id" integer not null, "storage_mib" varchar not null, "storage_index" varchar null, "storage_type" varchar null, "storage_descr" text not null, "storage_size" integer not null, "storage_units" integer not null, "storage_used" integer not null default '0', "storage_free" integer not null default '0', "storage_perc" integer not null default '0', "storage_perc_warn" integer null default '60', "storage_deleted" tinyint(1) not null default '0'); +CREATE UNIQUE INDEX "storage_device_id_storage_mib_storage_index_unique" on "storage" ("device_id", "storage_mib", "storage_index"); +CREATE INDEX "storage_device_id_index" on "storage" ("device_id"); +CREATE TABLE IF NOT EXISTS "stp" ("stp_id" integer not null primary key autoincrement, "device_id" integer not null, "rootBridge" tinyint(1) not null, "bridgeAddress" varchar not null, "protocolSpecification" varchar not null, "priority" integer not null, "timeSinceTopologyChange" varchar not null, "topChanges" integer not null, "designatedRoot" varchar not null, "rootCost" integer not null, "rootPort" integer null, "maxAge" integer not null, "helloTime" integer not null, "holdTime" integer not null, "forwardDelay" integer not null, "bridgeMaxAge" integer not null, "bridgeHelloTime" integer not null, "bridgeForwardDelay" integer not null); +CREATE INDEX "stp_device_id_index" on "stp" ("device_id"); +CREATE TABLE IF NOT EXISTS "syslog" ("device_id" integer null, "facility" varchar null, "priority" varchar null, "level" varchar null, "tag" varchar null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "program" varchar null, "msg" text null, "seq" integer not null primary key autoincrement); +CREATE INDEX "syslog_priority_level_index" on "syslog" ("priority", "level"); +CREATE INDEX "syslog_device_id_timestamp_index" on "syslog" ("device_id", "timestamp"); +CREATE INDEX "syslog_device_id_index" on "syslog" ("device_id"); +CREATE INDEX "syslog_timestamp_index" on "syslog" ("timestamp"); +CREATE INDEX "syslog_program_index" on "syslog" ("program"); +CREATE TABLE IF NOT EXISTS "tnmsneinfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "neID" integer not null, "neType" varchar not null, "neName" varchar not null, "neLocation" varchar not null, "neAlarm" varchar not null, "neOpMode" varchar not null, "neOpState" varchar not null); +CREATE INDEX "tnmsneinfo_device_id_index" on "tnmsneinfo" ("device_id"); +CREATE INDEX "tnmsneinfo_neid_index" on "tnmsneinfo" ("neID"); +CREATE TABLE IF NOT EXISTS "toner" ("toner_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "toner_index" integer not null, "toner_type" varchar not null, "toner_oid" varchar not null, "toner_descr" varchar not null default '', "toner_capacity" integer not null default '0', "toner_current" integer not null default '0', "toner_capacity_oid" varchar null); +CREATE INDEX "toner_device_id_index" on "toner" ("device_id"); +CREATE TABLE IF NOT EXISTS "transport_group_transport" ("id" integer not null primary key autoincrement, "transport_group_id" integer not null, "transport_id" integer not null); +CREATE TABLE IF NOT EXISTS "ucd_diskio" ("diskio_id" integer not null primary key autoincrement, "device_id" integer not null, "diskio_index" integer not null, "diskio_descr" varchar not null); +CREATE INDEX "ucd_diskio_device_id_index" on "ucd_diskio" ("device_id"); +CREATE TABLE IF NOT EXISTS "users_prefs" ("user_id" integer not null, "pref" varchar not null, "value" varchar not null); +CREATE UNIQUE INDEX "users_prefs_user_id_pref_unique" on "users_prefs" ("user_id", "pref"); +CREATE TABLE IF NOT EXISTS "users" ("user_id" integer not null primary key autoincrement, "auth_type" varchar null, "auth_id" integer null, "username" varchar not null, "password" varchar null, "realname" varchar not null, "email" varchar not null, "descr" varchar not null, "level" integer not null default '0', "can_modify_passwd" tinyint(1) not null default '1', "created_at" datetime not null default '1970-01-02 00:00:01', "updated_at" datetime default CURRENT_TIMESTAMP not null, "remember_token" varchar null, "enabled" tinyint(1) not null default '1'); +CREATE UNIQUE INDEX "users_auth_type_username_unique" on "users" ("auth_type", "username"); +CREATE TABLE IF NOT EXISTS "users_widgets" ("user_widget_id" integer not null primary key autoincrement, "user_id" integer not null, "widget_id" integer not null, "col" integer not null, "row" integer not null, "size_x" integer not null, "size_y" integer not null, "title" varchar not null, "refresh" integer not null default '60', "settings" text not null, "dashboard_id" integer not null); +CREATE INDEX "user_id" on "users_widgets" ("user_id", "widget_id"); +CREATE TABLE IF NOT EXISTS "vlans" ("vlan_id" integer not null primary key autoincrement, "device_id" integer null, "vlan_vlan" integer null, "vlan_domain" integer null, "vlan_name" varchar null, "vlan_type" varchar null, "vlan_mtu" integer null); +CREATE INDEX "device_id" on "vlans" ("device_id", "vlan_vlan"); +CREATE TABLE IF NOT EXISTS "vminfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "vm_type" varchar not null default 'vmware', "vmwVmVMID" integer not null, "vmwVmDisplayName" varchar not null, "vmwVmGuestOS" varchar not null, "vmwVmMemSize" integer not null, "vmwVmCpus" integer not null, "vmwVmState" varchar not null); +CREATE INDEX "vminfo_device_id_index" on "vminfo" ("device_id"); +CREATE INDEX "vminfo_vmwvmvmid_index" on "vminfo" ("vmwVmVMID"); +CREATE TABLE IF NOT EXISTS "vrf_lite_cisco" ("vrf_lite_cisco_id" integer not null primary key autoincrement, "device_id" integer not null, "context_name" varchar not null, "intance_name" varchar null default '', "vrf_name" varchar null default 'Default'); +CREATE INDEX "vrf_lite_cisco_device_id_context_name_vrf_name_index" on "vrf_lite_cisco" ("device_id", "context_name", "vrf_name"); +CREATE INDEX "vrf_lite_cisco_device_id_index" on "vrf_lite_cisco" ("device_id"); +CREATE INDEX "vrf_lite_cisco_context_name_index" on "vrf_lite_cisco" ("context_name"); +CREATE INDEX "vrf_lite_cisco_vrf_name_index" on "vrf_lite_cisco" ("vrf_name"); +CREATE TABLE IF NOT EXISTS "vrfs" ("vrf_id" integer not null primary key autoincrement, "vrf_oid" varchar not null, "vrf_name" varchar null, "mplsVpnVrfRouteDistinguisher" varchar null, "mplsVpnVrfDescription" text not null, "device_id" integer not null, "bgpLocalAs" integer null); +CREATE INDEX "vrfs_device_id_index" on "vrfs" ("device_id"); +CREATE TABLE IF NOT EXISTS "widgets" ("widget_id" integer not null primary key autoincrement, "widget_title" varchar not null, "widget" varchar not null, "base_dimensions" varchar not null); +CREATE UNIQUE INDEX "widgets_widget_unique" on "widgets" ("widget"); +CREATE TABLE IF NOT EXISTS "wireless_sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "sensor_index" varchar null, "sensor_type" varchar not null, "sensor_descr" varchar null, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_aggregator" varchar not null default 'sum', "sensor_current" float null, "sensor_prev" float null, "sensor_limit" float null, "sensor_limit_warn" float null, "sensor_limit_low" float null, "sensor_limit_low_warn" float null, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar null, "entPhysicalIndex_measured" varchar null, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_oids" text not null, "access_point_id" integer null); +CREATE INDEX "wireless_sensors_sensor_class_index" on "wireless_sensors" ("sensor_class"); +CREATE INDEX "wireless_sensors_device_id_index" on "wireless_sensors" ("device_id"); +CREATE INDEX "wireless_sensors_sensor_type_index" on "wireless_sensors" ("sensor_type"); +CREATE TABLE ports_nac (ports_nac_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, auth_id VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, port_id INTEGER NOT NULL, domain VARCHAR(255) NOT NULL COLLATE BINARY, username VARCHAR(255) NOT NULL COLLATE BINARY, mac_address VARCHAR(255) NOT NULL COLLATE BINARY, ip_address VARCHAR(255) NOT NULL COLLATE BINARY, host_mode VARCHAR(255) NOT NULL COLLATE BINARY, authz_status VARCHAR(255) NOT NULL COLLATE BINARY, authz_by VARCHAR(255) NOT NULL COLLATE BINARY, authc_status VARCHAR(255) NOT NULL COLLATE BINARY, method VARCHAR(255) NOT NULL COLLATE BINARY, timeout VARCHAR(255) NOT NULL COLLATE BINARY, time_left VARCHAR(50) DEFAULT NULL COLLATE BINARY, "vlan" integer null, "time_elapsed" varchar null); +CREATE INDEX ports_nac_device_id_index ON ports_nac (device_id); +CREATE INDEX ports_nac_port_id_mac_address_index ON ports_nac (port_id, mac_address); +CREATE TABLE config (config_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, config_name VARCHAR(255) NOT NULL COLLATE BINARY, config_value VARCHAR(255) NOT NULL COLLATE BINARY); +CREATE UNIQUE INDEX config_config_name_unique ON config (config_name); +CREATE TABLE IF NOT EXISTS "route" ("route_id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "device_id" integer not null, "port_id" integer not null, "context_name" varchar null, "inetCidrRouteIfIndex" integer not null, "inetCidrRouteType" integer not null, "inetCidrRouteProto" integer not null, "inetCidrRouteNextHopAS" integer not null, "inetCidrRouteMetric1" integer not null, "inetCidrRouteDestType" varchar not null, "inetCidrRouteDest" varchar not null, "inetCidrRouteNextHopType" varchar not null, "inetCidrRouteNextHop" varchar not null, "inetCidrRoutePolicy" varchar not null, "inetCidrRoutePfxLen" integer not null); +CREATE TABLE IF NOT EXISTS "mpls_lsps" ("lsp_id" integer not null primary key autoincrement, "vrf_oid" integer not null, "lsp_oid" integer not null, "device_id" integer not null, "mplsLspRowStatus" varchar check ("mplsLspRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) not null, "mplsLspLastChange" integer null, "mplsLspName" varchar not null, "mplsLspAdminState" varchar check ("mplsLspAdminState" in ('noop', 'inService', 'outOfService')) not null, "mplsLspOperState" varchar check ("mplsLspOperState" in ('unknown', 'inService', 'outOfService', 'transition')) not null, "mplsLspFromAddr" varchar not null, "mplsLspToAddr" varchar not null, "mplsLspType" varchar check ("mplsLspType" in ('unknown', 'dynamic', 'static', 'bypassOnly', 'p2mpLsp', 'p2mpAuto', 'mplsTp', 'meshP2p', 'oneHopP2p', 'srTe', 'meshP2pSrTe', 'oneHopP2pSrTe')) not null, "mplsLspFastReroute" varchar check ("mplsLspFastReroute" in ('true', 'false')) not null, "mplsLspAge" integer null, "mplsLspTimeUp" integer null, "mplsLspTimeDown" integer null, "mplsLspPrimaryTimeUp" integer null, "mplsLspTransitions" integer null, "mplsLspLastTransition" integer null, "mplsLspConfiguredPaths" integer null, "mplsLspStandbyPaths" integer null, "mplsLspOperationalPaths" integer null); +CREATE INDEX "mpls_lsps_device_id_index" on "mpls_lsps" ("device_id"); +CREATE TABLE device_groups (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, "desc" VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, pattern CLOB DEFAULT NULL COLLATE BINARY); +CREATE UNIQUE INDEX device_groups_name_unique ON device_groups (name); +CREATE TABLE IF NOT EXISTS "mpls_sdps" ("sdp_id" integer not null primary key autoincrement, "sdp_oid" integer not null, "device_id" integer not null, "sdpRowStatus" varchar check ("sdpRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sdpDelivery" varchar check ("sdpDelivery" in ('gre', 'mpls', 'l2tpv3', 'greethbridged')) null, "sdpDescription" varchar null, "sdpAdminStatus" varchar check ("sdpAdminStatus" in ('up', 'down')) null, "sdpOperStatus" varchar check ("sdpOperStatus" in ('up', 'notAlive', 'notReady', 'invalidEgressInterface', 'transportTunnelDown', 'down')) null, "sdpAdminPathMtu" integer null, "sdpOperPathMtu" integer null, "sdpLastMgmtChange" integer null, "sdpLastStatusChange" integer null, "sdpActiveLspType" varchar check ("sdpActiveLspType" in ('not-applicable', 'rsvp', 'ldp', 'bgp', 'none', 'mplsTp', 'srIsis', 'srOspf', 'srTeLsp', 'fpe')) null, "sdpFarEndInetAddressType" varchar check ("sdpFarEndInetAddressType" in ('ipv4', 'ipv6')) null, "sdpFarEndInetAddress" varchar null); +CREATE INDEX "mpls_sdps_device_id_index" on "mpls_sdps" ("device_id"); +CREATE TABLE IF NOT EXISTS "mpls_sdp_binds" ("bind_id" integer not null primary key autoincrement, "sdp_id" integer not null, "svc_id" integer not null, "sdp_oid" integer not null, "svc_oid" integer not null, "device_id" integer not null, "sdpBindRowStatus" varchar check ("sdpBindRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sdpBindAdminStatus" varchar check ("sdpBindAdminStatus" in ('up', 'down')) null, "sdpBindOperStatus" varchar check ("sdpBindOperStatus" in ('up', 'down')) null, "sdpBindLastMgmtChange" integer null, "sdpBindLastStatusChange" integer null, "sdpBindType" varchar check ("sdpBindType" in ('spoke', 'mesh')) null, "sdpBindVcType" varchar check ("sdpBindVcType" in ('undef', 'ether', 'vlan', 'mirrior', 'atmSduatmCell', 'atmVcc', 'atmVpc', 'frDlci', 'ipipe', 'satopE1', 'satopT1', 'satopE3', 'satopT3', 'cesopsn', 'cesopsnCas')) null, "sdpBindBaseStatsIngFwdPackets" integer null, "sdpBindBaseStatsIngFwdOctets" integer null, "sdpBindBaseStatsEgrFwdPackets" integer null, "sdpBindBaseStatsEgrFwdOctets" integer null); +CREATE INDEX "mpls_sdp_binds_device_id_index" on "mpls_sdp_binds" ("device_id"); +CREATE TABLE IF NOT EXISTS "mpls_services" ("svc_id" integer not null primary key autoincrement, "svc_oid" integer not null, "device_id" integer not null, "svcRowStatus" varchar check ("svcRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "svcType" varchar check ("svcType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')) null, "svcCustId" integer null, "svcAdminStatus" varchar check ("svcAdminStatus" in ('up', 'down')) null, "svcOperStatus" varchar check ("svcOperStatus" in ('up', 'down')) null, "svcDescription" varchar null, "svcMtu" integer null, "svcNumSaps" integer null, "svcNumSdps" integer null, "svcLastMgmtChange" integer null, "svcLastStatusChange" integer null, "svcVRouterId" integer null, "svcTlsMacLearning" varchar check ("svcTlsMacLearning" in ('enabled', 'disabled')) null, "svcTlsStpAdminStatus" varchar check ("svcTlsStpAdminStatus" in ('enabled', 'disabled')) null, "svcTlsStpOperStatus" varchar check ("svcTlsStpOperStatus" in ('up', 'down')) null, "svcTlsFdbTableSize" integer null, "svcTlsFdbNumEntries" integer null); +CREATE INDEX "mpls_services_device_id_index" on "mpls_services" ("device_id"); +CREATE TABLE IF NOT EXISTS "mpls_saps" ("sap_id" integer not null primary key autoincrement, "svc_id" integer not null, "svc_oid" integer not null, "sapPortId" integer not null, "ifName" varchar null, "device_id" integer not null, "sapEncapValue" varchar null, "sapRowStatus" varchar check ("sapRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sapType" varchar check ("sapType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')) null, "sapDescription" varchar null, "sapAdminStatus" varchar check ("sapAdminStatus" in ('up', 'down')) null, "sapOperStatus" varchar check ("sapOperStatus" in ('up', 'down')) null, "sapLastMgmtChange" integer null, "sapLastStatusChange" integer null); +CREATE INDEX "mpls_saps_device_id_index" on "mpls_saps" ("device_id"); +CREATE INDEX "notifications_attribs_notifications_id_user_id_index" on "notifications_attribs" ("notifications_id", "user_id"); +CREATE TABLE mempools (mempool_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, mempool_index VARCHAR(255) NOT NULL COLLATE BINARY, entPhysicalIndex INTEGER DEFAULT NULL, hrDeviceIndex INTEGER DEFAULT NULL, mempool_type VARCHAR(255) NOT NULL COLLATE BINARY, mempool_precision INTEGER DEFAULT 1 NOT NULL, mempool_descr VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, mempool_perc INTEGER NOT NULL, mempool_used INTEGER NOT NULL, mempool_free INTEGER NOT NULL, mempool_total INTEGER NOT NULL, mempool_largestfree INTEGER DEFAULT NULL, mempool_lowestfree INTEGER DEFAULT NULL, mempool_deleted BOOLEAN DEFAULT '0' NOT NULL, mempool_perc_warn INTEGER DEFAULT NULL); +CREATE INDEX mempools_device_id_index ON mempools (device_id); +CREATE TABLE IF NOT EXISTS "devices_group_perms" ("user_id" integer not null, "device_group_id" integer not null, primary key ("device_group_id", "user_id")); +CREATE INDEX "devices_group_perms_user_id_index" on "devices_group_perms" ("user_id"); +CREATE INDEX "devices_group_perms_device_group_id_index" on "devices_group_perms" ("device_group_id"); +CREATE TABLE IF NOT EXISTS "mpls_tunnel_ar_hops" ("ar_hop_id" integer not null primary key autoincrement, "mplsTunnelARHopListIndex" integer not null, "mplsTunnelARHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer not null, "mplsTunnelARHopAddrType" varchar check ("mplsTunnelARHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')) null, "mplsTunnelARHopIpv4Addr" varchar null, "mplsTunnelARHopIpv6Addr" varchar null, "mplsTunnelARHopAsNumber" integer null, "mplsTunnelARHopStrictOrLoose" varchar check ("mplsTunnelARHopStrictOrLoose" in ('strict', 'loose')) null, "mplsTunnelARHopRouterId" varchar null, "localProtected" varchar check ("localProtected" in ('false', 'true')) not null default 'false', "linkProtectionInUse" varchar check ("linkProtectionInUse" in ('false', 'true')) not null default 'false', "bandwidthProtected" varchar check ("bandwidthProtected" in ('false', 'true')) not null default 'false', "nextNodeProtected" varchar check ("nextNodeProtected" in ('false', 'true')) not null default 'false'); +CREATE INDEX "mpls_tunnel_ar_hops_device_id_index" on "mpls_tunnel_ar_hops" ("device_id"); +CREATE TABLE IF NOT EXISTS "mpls_tunnel_c_hops" ("c_hop_id" integer not null primary key autoincrement, "mplsTunnelCHopListIndex" integer not null, "mplsTunnelCHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer null, "mplsTunnelCHopAddrType" varchar check ("mplsTunnelCHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')) null, "mplsTunnelCHopIpv4Addr" varchar null, "mplsTunnelCHopIpv6Addr" varchar null, "mplsTunnelCHopAsNumber" integer null, "mplsTunnelCHopStrictOrLoose" varchar check ("mplsTunnelCHopStrictOrLoose" in ('strict', 'loose')) null, "mplsTunnelCHopRouterId" varchar null); +CREATE INDEX "mpls_tunnel_c_hops_device_id_index" on "mpls_tunnel_c_hops" ("device_id"); +CREATE TABLE IF NOT EXISTS "customoids" ("customoid_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "customoid_descr" varchar null default '', "customoid_deleted" integer not null default '0', "customoid_current" float null, "customoid_prev" float null, "customoid_oid" varchar null, "customoid_datatype" varchar not null default 'GAUGE', "customoid_unit" varchar null, "customoid_divisor" integer not null default '1', "customoid_multiplier" integer not null default '1', "customoid_limit" float null, "customoid_limit_warn" float null, "customoid_limit_low" float null, "customoid_limit_low_warn" float null, "customoid_alert" integer not null default '0', "customoid_passed" integer not null default '0', "lastupdate" datetime default CURRENT_TIMESTAMP not null, "user_func" varchar null); +CREATE TABLE mpls_lsp_paths (lsp_path_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, lsp_id INTEGER NOT NULL, path_oid INTEGER NOT NULL, device_id INTEGER NOT NULL, mplsLspPathRowStatus VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathLastChange INTEGER NOT NULL, mplsLspPathType VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathBandwidth INTEGER NOT NULL, mplsLspPathOperBandwidth INTEGER NOT NULL, mplsLspPathAdminState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathOperState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathFailCode VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathFailNodeAddr VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathMetric INTEGER NOT NULL, mplsLspPathOperMetric INTEGER UNSIGNED DEFAULT NULL, mplsLspPathTimeUp INTEGER DEFAULT NULL, mplsLspPathTimeDown INTEGER DEFAULT NULL, mplsLspPathTransitionCount INTEGER DEFAULT NULL, mplsLspPathTunnelARHopListIndex INTEGER DEFAULT NULL, mplsLspPathTunnelCHopListIndex INTEGER DEFAULT NULL); +CREATE INDEX mpls_lsp_paths_device_id_index ON mpls_lsp_paths (device_id); +CREATE TABLE IF NOT EXISTS "alert_location_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "location_id" integer not null); +CREATE UNIQUE INDEX "alert_location_map_rule_id_location_id_uindex" on "alert_location_map" ("rule_id", "location_id"); +CREATE TABLE alert_schedule (schedule_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, recurring BOOLEAN DEFAULT '0' NOT NULL, start DATETIME DEFAULT '1970-01-02 00:00:01' NOT NULL, "end" DATETIME DEFAULT '1970-01-02 00:00:01' NOT NULL, recurring_day VARCHAR(255) DEFAULT NULL COLLATE BINARY, title VARCHAR(255) NOT NULL COLLATE BINARY, notes CLOB NOT NULL COLLATE BINARY); +CREATE TABLE application_metrics (app_id INTEGER NOT NULL, value DOUBLE PRECISION DEFAULT NULL, value_prev DOUBLE PRECISION DEFAULT NULL, metric VARCHAR(64) NOT NULL COLLATE BINARY); +CREATE UNIQUE INDEX application_metrics_app_id_metric_unique ON application_metrics (app_id, metric); +CREATE TABLE availability (availability_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, device_id INTEGER NOT NULL, duration INTEGER NOT NULL, availability_perc NUMERIC(9, 6) DEFAULT '0' NOT NULL); +CREATE INDEX availability_device_id_index ON availability (device_id); +CREATE UNIQUE INDEX availability_device_id_duration_unique ON availability (device_id, duration); +CREATE TABLE devices (device_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, hostname VARCHAR(255) NOT NULL COLLATE BINARY, sysName VARCHAR(255) DEFAULT NULL COLLATE BINARY, ip BLOB DEFAULT NULL, community VARCHAR(255) DEFAULT NULL COLLATE BINARY, authlevel VARCHAR(255) DEFAULT NULL COLLATE BINARY, authname VARCHAR(255) DEFAULT NULL COLLATE BINARY, authpass VARCHAR(255) DEFAULT NULL COLLATE BINARY, cryptopass VARCHAR(255) DEFAULT NULL COLLATE BINARY, snmpver VARCHAR(255) DEFAULT 'v2c' NOT NULL COLLATE BINARY, port INTEGER DEFAULT 161 NOT NULL, transport VARCHAR(255) DEFAULT 'udp' NOT NULL COLLATE BINARY, timeout INTEGER DEFAULT NULL, retries INTEGER DEFAULT NULL, snmp_disable BOOLEAN DEFAULT '0' NOT NULL, bgpLocalAs INTEGER DEFAULT NULL, sysObjectID VARCHAR(255) DEFAULT NULL COLLATE BINARY, sysDescr CLOB DEFAULT NULL COLLATE BINARY, sysContact CLOB DEFAULT NULL COLLATE BINARY, version CLOB DEFAULT NULL COLLATE BINARY, hardware CLOB DEFAULT NULL COLLATE BINARY, features CLOB DEFAULT NULL COLLATE BINARY, location_id INTEGER DEFAULT NULL, os VARCHAR(255) DEFAULT NULL COLLATE BINARY, status BOOLEAN DEFAULT '0' NOT NULL, status_reason VARCHAR(255) NOT NULL COLLATE BINARY, "ignore" BOOLEAN DEFAULT '0' NOT NULL, disabled BOOLEAN DEFAULT '0' NOT NULL, uptime INTEGER DEFAULT NULL, agent_uptime INTEGER DEFAULT 0 NOT NULL, last_polled DATETIME DEFAULT NULL, last_poll_attempted DATETIME DEFAULT NULL, last_polled_timetaken DOUBLE PRECISION DEFAULT NULL, last_discovered_timetaken DOUBLE PRECISION DEFAULT NULL, last_discovered DATETIME DEFAULT NULL, last_ping DATETIME DEFAULT NULL, last_ping_timetaken DOUBLE PRECISION DEFAULT NULL, purpose CLOB DEFAULT NULL COLLATE BINARY, type VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, serial CLOB DEFAULT NULL COLLATE BINARY, icon VARCHAR(255) DEFAULT NULL COLLATE BINARY, poller_group INTEGER DEFAULT 0 NOT NULL, override_sysLocation BOOLEAN DEFAULT '0', notes CLOB DEFAULT NULL COLLATE BINARY, port_association_mode INTEGER DEFAULT 1 NOT NULL, max_depth INTEGER DEFAULT 0 NOT NULL, overwrite_ip VARCHAR(255) DEFAULT NULL COLLATE BINARY, disable_notify BOOLEAN DEFAULT '0' NOT NULL, inserted DATETIME DEFAULT NULL, authalgo VARCHAR(10) DEFAULT NULL COLLATE BINARY, cryptoalgo VARCHAR(10) DEFAULT NULL COLLATE BINARY); +CREATE INDEX devices_hostname_index ON devices (hostname); +CREATE INDEX devices_sysname_index ON devices (sysName); +CREATE INDEX devices_os_index ON devices (os); +CREATE INDEX devices_status_index ON devices (status); +CREATE INDEX devices_last_polled_index ON devices (last_polled); +CREATE INDEX devices_last_poll_attempted_index ON devices (last_poll_attempted); +CREATE INDEX "device_perf_device_id_timestamp_index" on "device_perf" ("device_id", "timestamp"); +CREATE TABLE device_outages (device_id INTEGER NOT NULL, going_down INTEGER NOT NULL, up_again INTEGER DEFAULT NULL); +CREATE INDEX device_outages_device_id_index ON device_outages (device_id); +CREATE UNIQUE INDEX device_outages_device_id_going_down_unique ON device_outages (device_id, going_down); +CREATE TABLE IF NOT EXISTS "cache" ("key" varchar not null, "value" text not null, "expiration" integer not null); +CREATE UNIQUE INDEX "cache_key_unique" on "cache" ("key"); +CREATE INDEX "alert_log_rule_id_device_id_index" on "alert_log" ("rule_id", "device_id"); +CREATE INDEX "alert_log_rule_id_device_id_state_index" on "alert_log" ("rule_id", "device_id", "state"); +CREATE TABLE IF NOT EXISTS "cache_locks" ("key" varchar not null, "owner" varchar not null, "expiration" integer not null, primary key ("key")); +CREATE TABLE ospf_areas (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, device_id INTEGER NOT NULL, ospfAreaId VARCHAR(255) NOT NULL COLLATE BINARY, ospfAuthType VARCHAR(64) DEFAULT NULL COLLATE BINARY, ospfImportAsExtern VARCHAR(255) NOT NULL COLLATE BINARY, ospfSpfRuns INTEGER NOT NULL, ospfAreaBdrRtrCount INTEGER NOT NULL, ospfAsBdrRtrCount INTEGER NOT NULL, ospfAreaLsaCount INTEGER NOT NULL, ospfAreaLsaCksumSum INTEGER NOT NULL, ospfAreaSummary VARCHAR(255) NOT NULL COLLATE BINARY, ospfAreaStatus VARCHAR(255) NOT NULL COLLATE BINARY, context_name VARCHAR(255) DEFAULT NULL COLLATE BINARY); +CREATE UNIQUE INDEX ospf_areas_device_id_ospfareaid_context_name_unique ON ospf_areas (device_id, ospfAreaId, context_name); +INSERT INTO migrations VALUES(1,'2018_07_03_091314_create_access_points_table',1); +INSERT INTO migrations VALUES(2,'2018_07_03_091314_create_alert_device_map_table',1); +INSERT INTO migrations VALUES(3,'2018_07_03_091314_create_alert_group_map_table',1); +INSERT INTO migrations VALUES(4,'2018_07_03_091314_create_alert_log_table',1); +INSERT INTO migrations VALUES(5,'2018_07_03_091314_create_alert_rules_table',1); +INSERT INTO migrations VALUES(6,'2018_07_03_091314_create_alert_schedulables_table',1); +INSERT INTO migrations VALUES(7,'2018_07_03_091314_create_alert_schedule_table',1); +INSERT INTO migrations VALUES(8,'2018_07_03_091314_create_alert_template_map_table',1); +INSERT INTO migrations VALUES(9,'2018_07_03_091314_create_alert_templates_table',1); +INSERT INTO migrations VALUES(10,'2018_07_03_091314_create_alert_transport_groups_table',1); +INSERT INTO migrations VALUES(11,'2018_07_03_091314_create_alert_transport_map_table',1); +INSERT INTO migrations VALUES(12,'2018_07_03_091314_create_alert_transports_table',1); +INSERT INTO migrations VALUES(13,'2018_07_03_091314_create_alerts_table',1); +INSERT INTO migrations VALUES(14,'2018_07_03_091314_create_api_tokens_table',1); +INSERT INTO migrations VALUES(15,'2018_07_03_091314_create_application_metrics_table',1); +INSERT INTO migrations VALUES(16,'2018_07_03_091314_create_applications_table',1); +INSERT INTO migrations VALUES(17,'2018_07_03_091314_create_authlog_table',1); +INSERT INTO migrations VALUES(18,'2018_07_03_091314_create_bgpPeers_cbgp_table',1); +INSERT INTO migrations VALUES(19,'2018_07_03_091314_create_bgpPeers_table',1); +INSERT INTO migrations VALUES(20,'2018_07_03_091314_create_bill_data_table',1); +INSERT INTO migrations VALUES(21,'2018_07_03_091314_create_bill_history_table',1); +INSERT INTO migrations VALUES(22,'2018_07_03_091314_create_bill_perms_table',1); +INSERT INTO migrations VALUES(23,'2018_07_03_091314_create_bill_port_counters_table',1); +INSERT INTO migrations VALUES(24,'2018_07_03_091314_create_bill_ports_table',1); +INSERT INTO migrations VALUES(25,'2018_07_03_091314_create_bills_table',1); +INSERT INTO migrations VALUES(26,'2018_07_03_091314_create_callback_table',1); +INSERT INTO migrations VALUES(27,'2018_07_03_091314_create_cef_switching_table',1); +INSERT INTO migrations VALUES(28,'2018_07_03_091314_create_ciscoASA_table',1); +INSERT INTO migrations VALUES(29,'2018_07_03_091314_create_component_prefs_table',1); +INSERT INTO migrations VALUES(30,'2018_07_03_091314_create_component_statuslog_table',1); +INSERT INTO migrations VALUES(31,'2018_07_03_091314_create_component_table',1); +INSERT INTO migrations VALUES(32,'2018_07_03_091314_create_config_table',1); +INSERT INTO migrations VALUES(33,'2018_07_03_091314_create_customers_table',1); +INSERT INTO migrations VALUES(34,'2018_07_03_091314_create_dashboards_table',1); +INSERT INTO migrations VALUES(35,'2018_07_03_091314_create_dbSchema_table',1); +INSERT INTO migrations VALUES(36,'2018_07_03_091314_create_device_graphs_table',1); +INSERT INTO migrations VALUES(37,'2018_07_03_091314_create_device_group_device_table',1); +INSERT INTO migrations VALUES(38,'2018_07_03_091314_create_device_groups_table',1); +INSERT INTO migrations VALUES(39,'2018_07_03_091314_create_device_mibs_table',1); +INSERT INTO migrations VALUES(40,'2018_07_03_091314_create_device_oids_table',1); +INSERT INTO migrations VALUES(41,'2018_07_03_091314_create_device_perf_table',1); +INSERT INTO migrations VALUES(42,'2018_07_03_091314_create_device_relationships_table',1); +INSERT INTO migrations VALUES(43,'2018_07_03_091314_create_devices_attribs_table',1); +INSERT INTO migrations VALUES(44,'2018_07_03_091314_create_devices_perms_table',1); +INSERT INTO migrations VALUES(45,'2018_07_03_091314_create_devices_table',1); +INSERT INTO migrations VALUES(46,'2018_07_03_091314_create_entPhysical_state_table',1); +INSERT INTO migrations VALUES(47,'2018_07_03_091314_create_entPhysical_table',1); +INSERT INTO migrations VALUES(48,'2018_07_03_091314_create_entityState_table',1); +INSERT INTO migrations VALUES(49,'2018_07_03_091314_create_eventlog_table',1); +INSERT INTO migrations VALUES(50,'2018_07_03_091314_create_graph_types_table',1); +INSERT INTO migrations VALUES(51,'2018_07_03_091314_create_hrDevice_table',1); +INSERT INTO migrations VALUES(52,'2018_07_03_091314_create_ipsec_tunnels_table',1); +INSERT INTO migrations VALUES(53,'2018_07_03_091314_create_ipv4_addresses_table',1); +INSERT INTO migrations VALUES(54,'2018_07_03_091314_create_ipv4_mac_table',1); +INSERT INTO migrations VALUES(55,'2018_07_03_091314_create_ipv4_networks_table',1); +INSERT INTO migrations VALUES(56,'2018_07_03_091314_create_ipv6_addresses_table',1); +INSERT INTO migrations VALUES(57,'2018_07_03_091314_create_ipv6_networks_table',1); +INSERT INTO migrations VALUES(58,'2018_07_03_091314_create_juniAtmVp_table',1); +INSERT INTO migrations VALUES(59,'2018_07_03_091314_create_links_table',1); +INSERT INTO migrations VALUES(60,'2018_07_03_091314_create_loadbalancer_rservers_table',1); +INSERT INTO migrations VALUES(61,'2018_07_03_091314_create_loadbalancer_vservers_table',1); +INSERT INTO migrations VALUES(62,'2018_07_03_091314_create_locations_table',1); +INSERT INTO migrations VALUES(63,'2018_07_03_091314_create_mac_accounting_table',1); +INSERT INTO migrations VALUES(64,'2018_07_03_091314_create_mefinfo_table',1); +INSERT INTO migrations VALUES(65,'2018_07_03_091314_create_mempools_table',1); +INSERT INTO migrations VALUES(66,'2018_07_03_091314_create_mibdefs_table',1); +INSERT INTO migrations VALUES(67,'2018_07_03_091314_create_munin_plugins_ds_table',1); +INSERT INTO migrations VALUES(68,'2018_07_03_091314_create_munin_plugins_table',1); +INSERT INTO migrations VALUES(69,'2018_07_03_091314_create_netscaler_vservers_table',1); +INSERT INTO migrations VALUES(70,'2018_07_03_091314_create_notifications_attribs_table',1); +INSERT INTO migrations VALUES(71,'2018_07_03_091314_create_notifications_table',1); +INSERT INTO migrations VALUES(72,'2018_07_03_091314_create_ospf_areas_table',1); +INSERT INTO migrations VALUES(73,'2018_07_03_091314_create_ospf_instances_table',1); +INSERT INTO migrations VALUES(74,'2018_07_03_091314_create_ospf_nbrs_table',1); +INSERT INTO migrations VALUES(75,'2018_07_03_091314_create_ospf_ports_table',1); +INSERT INTO migrations VALUES(76,'2018_07_03_091314_create_packages_table',1); +INSERT INTO migrations VALUES(77,'2018_07_03_091314_create_pdb_ix_peers_table',1); +INSERT INTO migrations VALUES(78,'2018_07_03_091314_create_pdb_ix_table',1); +INSERT INTO migrations VALUES(79,'2018_07_03_091314_create_perf_times_table',1); +INSERT INTO migrations VALUES(80,'2018_07_03_091314_create_plugins_table',1); +INSERT INTO migrations VALUES(81,'2018_07_03_091314_create_poller_cluster_stats_table',1); +INSERT INTO migrations VALUES(82,'2018_07_03_091314_create_poller_cluster_table',1); +INSERT INTO migrations VALUES(83,'2018_07_03_091314_create_poller_groups_table',1); +INSERT INTO migrations VALUES(84,'2018_07_03_091314_create_pollers_table',1); +INSERT INTO migrations VALUES(85,'2018_07_03_091314_create_ports_adsl_table',1); +INSERT INTO migrations VALUES(86,'2018_07_03_091314_create_ports_fdb_table',1); +INSERT INTO migrations VALUES(87,'2018_07_03_091314_create_ports_nac_table',1); +INSERT INTO migrations VALUES(88,'2018_07_03_091314_create_ports_perms_table',1); +INSERT INTO migrations VALUES(89,'2018_07_03_091314_create_ports_stack_table',1); +INSERT INTO migrations VALUES(90,'2018_07_03_091314_create_ports_statistics_table',1); +INSERT INTO migrations VALUES(91,'2018_07_03_091314_create_ports_stp_table',1); +INSERT INTO migrations VALUES(92,'2018_07_03_091314_create_ports_table',1); +INSERT INTO migrations VALUES(93,'2018_07_03_091314_create_ports_vlans_table',1); +INSERT INTO migrations VALUES(94,'2018_07_03_091314_create_processes_table',1); +INSERT INTO migrations VALUES(95,'2018_07_03_091314_create_processors_table',1); +INSERT INTO migrations VALUES(96,'2018_07_03_091314_create_proxmox_ports_table',1); +INSERT INTO migrations VALUES(97,'2018_07_03_091314_create_proxmox_table',1); +INSERT INTO migrations VALUES(98,'2018_07_03_091314_create_pseudowires_table',1); +INSERT INTO migrations VALUES(99,'2018_07_03_091314_create_route_table',1); +INSERT INTO migrations VALUES(100,'2018_07_03_091314_create_sensors_table',1); +INSERT INTO migrations VALUES(101,'2018_07_03_091314_create_sensors_to_state_indexes_table',1); +INSERT INTO migrations VALUES(102,'2018_07_03_091314_create_services_table',1); +INSERT INTO migrations VALUES(103,'2018_07_03_091314_create_session_table',1); +INSERT INTO migrations VALUES(104,'2018_07_03_091314_create_slas_table',1); +INSERT INTO migrations VALUES(105,'2018_07_03_091314_create_state_indexes_table',1); +INSERT INTO migrations VALUES(106,'2018_07_03_091314_create_state_translations_table',1); +INSERT INTO migrations VALUES(107,'2018_07_03_091314_create_storage_table',1); +INSERT INTO migrations VALUES(108,'2018_07_03_091314_create_stp_table',1); +INSERT INTO migrations VALUES(109,'2018_07_03_091314_create_syslog_table',1); +INSERT INTO migrations VALUES(110,'2018_07_03_091314_create_tnmsneinfo_table',1); +INSERT INTO migrations VALUES(111,'2018_07_03_091314_create_toner_table',1); +INSERT INTO migrations VALUES(112,'2018_07_03_091314_create_transport_group_transport_table',1); +INSERT INTO migrations VALUES(113,'2018_07_03_091314_create_ucd_diskio_table',1); +INSERT INTO migrations VALUES(114,'2018_07_03_091314_create_users_prefs_table',1); +INSERT INTO migrations VALUES(115,'2018_07_03_091314_create_users_table',1); +INSERT INTO migrations VALUES(116,'2018_07_03_091314_create_users_widgets_table',1); +INSERT INTO migrations VALUES(117,'2018_07_03_091314_create_vlans_table',1); +INSERT INTO migrations VALUES(118,'2018_07_03_091314_create_vminfo_table',1); +INSERT INTO migrations VALUES(119,'2018_07_03_091314_create_vrf_lite_cisco_table',1); +INSERT INTO migrations VALUES(120,'2018_07_03_091314_create_vrfs_table',1); +INSERT INTO migrations VALUES(121,'2018_07_03_091314_create_widgets_table',1); +INSERT INTO migrations VALUES(122,'2018_07_03_091314_create_wireless_sensors_table',1); +INSERT INTO migrations VALUES(123,'2018_07_03_091322_add_foreign_keys_to_component_prefs_table',1); +INSERT INTO migrations VALUES(124,'2018_07_03_091322_add_foreign_keys_to_component_statuslog_table',1); +INSERT INTO migrations VALUES(125,'2018_07_03_091322_add_foreign_keys_to_device_group_device_table',1); +INSERT INTO migrations VALUES(126,'2018_07_03_091322_add_foreign_keys_to_device_relationships_table',1); +INSERT INTO migrations VALUES(127,'2018_07_03_091322_add_foreign_keys_to_sensors_table',1); +INSERT INTO migrations VALUES(128,'2018_07_03_091322_add_foreign_keys_to_sensors_to_state_indexes_table',1); +INSERT INTO migrations VALUES(129,'2018_07_03_091322_add_foreign_keys_to_wireless_sensors_table',1); +INSERT INTO migrations VALUES(130,'2019_01_16_132200_add_vlan_and_elapsed_to_nac',1); +INSERT INTO migrations VALUES(131,'2019_01_16_195644_add_vrf_id_and_bgpLocalAs',1); +INSERT INTO migrations VALUES(132,'2019_02_05_140857_remove_config_definition_from_db',1); +INSERT INTO migrations VALUES(133,'2019_02_10_220000_add_dates_to_fdb',1); +INSERT INTO migrations VALUES(134,'2019_04_22_220000_update_route_table',1); +INSERT INTO migrations VALUES(135,'2019_05_12_202407_create_mpls_lsps_table',1); +INSERT INTO migrations VALUES(136,'2019_05_12_202408_create_mpls_lsp_paths_table',1); +INSERT INTO migrations VALUES(137,'2019_05_30_225937_device_groups_rewrite',1); +INSERT INTO migrations VALUES(138,'2019_06_30_190400_create_mpls_sdps_table',1); +INSERT INTO migrations VALUES(139,'2019_06_30_190401_create_mpls_sdp_binds_table',1); +INSERT INTO migrations VALUES(140,'2019_06_30_190402_create_mpls_services_table',1); +INSERT INTO migrations VALUES(141,'2019_07_03_132417_create_mpls_saps_table',1); +INSERT INTO migrations VALUES(142,'2019_07_09_150217_update_users_widgets_settings',1); +INSERT INTO migrations VALUES(143,'2019_08_10_223200_add_enabled_to_users',1); +INSERT INTO migrations VALUES(144,'2019_08_28_105051_fix-template-linefeeds',1); +INSERT INTO migrations VALUES(145,'2019_09_05_153524_create_notifications_attribs_index',1); +INSERT INTO migrations VALUES(146,'2019_09_29_114433_change_default_mempool_perc_warn_in_mempools_table',1); +INSERT INTO migrations VALUES(147,'2019_10_03_211702_serialize_config',1); +INSERT INTO migrations VALUES(148,'2019_10_21_105350_devices_group_perms',1); +INSERT INTO migrations VALUES(149,'2019_11_30_191013_create_mpls_tunnel_ar_hops_table',1); +INSERT INTO migrations VALUES(150,'2019_11_30_191013_create_mpls_tunnel_c_hops_table',1); +INSERT INTO migrations VALUES(151,'2019_12_01_165514_add_indexes_to_mpls_lsp_paths_table',1); +INSERT INTO migrations VALUES(152,'2019_12_05_164700_alerts_disable_on_update_current_timestamp',1); +INSERT INTO migrations VALUES(153,'2019_12_16_140000_create_customoids_table',1); +INSERT INTO migrations VALUES(154,'2019_12_17_151314_add_invert_map_to_alert_rules',1); +INSERT INTO migrations VALUES(155,'2019_12_28_180000_add_overwrite_ip_to_devices',1); +INSERT INTO migrations VALUES(156,'2020_01_09_1300_migrate_devices_attribs_table',1); +INSERT INTO migrations VALUES(157,'2020_01_10_075852_alter_mpls_lsp_paths_table',1); +INSERT INTO migrations VALUES(158,'2020_02_05_093457_add_inserted_to_devices',1); +INSERT INTO migrations VALUES(159,'2020_02_05_224042_device_inserted_null',1); +INSERT INTO migrations VALUES(160,'2020_02_10_223323_create_alert_location_map_table',1); +INSERT INTO migrations VALUES(161,'2020_03_24_0844_add_primary_key_to_device_graphs',1); +INSERT INTO migrations VALUES(162,'2020_03_25_165300_add_column_to_ports',1); +INSERT INTO migrations VALUES(163,'2020_04_06_001048_the_great_index_rename',1); +INSERT INTO migrations VALUES(164,'2020_04_08_172357_alert_schedule_utc',1); +INSERT INTO migrations VALUES(165,'2020_04_13_150500_add_last_error_fields_to_bgp_peers',1); +INSERT INTO migrations VALUES(166,'2020_04_19_010532_eventlog_sensor_reference_cleanup',1); +INSERT INTO migrations VALUES(167,'2020_05_22_020303_alter_metric_column',1); +INSERT INTO migrations VALUES(168,'2020_05_24_212054_poller_cluster_settings',1); +INSERT INTO migrations VALUES(169,'2020_05_30_162638_remove_mib_polling_tables',1); +INSERT INTO migrations VALUES(170,'2020_06_06_222222_create_device_outages_table',1); +INSERT INTO migrations VALUES(171,'2020_06_23_00522_alter_availability_perc_column',1); +INSERT INTO migrations VALUES(172,'2020_07_27_00522_alter_devices_snmp_algo_columns',1); +INSERT INTO migrations VALUES(173,'2020_07_29_143221_add_device_perf_index',1); +INSERT INTO migrations VALUES(174,'2020_08_28_212054_drop_uptime_column_outages',1); +INSERT INTO migrations VALUES(175,'2020_09_18_223431_create_cache_table',1); +INSERT INTO migrations VALUES(176,'2020_09_22_172321_add_alert_log_index',1); +INSERT INTO migrations VALUES(177,'2020_09_24_000500_create_cache_locks_table',1); +INSERT INTO migrations VALUES(178,'2020_10_03_1000_add_primary_key_bill_perms',1); +INSERT INTO migrations VALUES(179,'2020_10_03_1000_add_primary_key_bill_ports',1); +INSERT INTO migrations VALUES(180,'2020_10_03_1000_add_primary_key_devices_perms',1); +INSERT INTO migrations VALUES(181,'2020_10_03_1000_add_primary_key_entPhysical_state',1); +INSERT INTO migrations VALUES(182,'2020_10_03_1000_add_primary_key_ipv4_mac',1); +INSERT INTO migrations VALUES(183,'2020_10_03_1000_add_primary_key_juniAtmVp',1); +INSERT INTO migrations VALUES(184,'2020_10_03_1000_add_primary_key_loadbalancer_vservers',1); +INSERT INTO migrations VALUES(185,'2020_10_03_1000_add_primary_key_ports_perms',1); +INSERT INTO migrations VALUES(186,'2020_10_03_1000_add_primary_key_processes',1); +INSERT INTO migrations VALUES(187,'2020_10_03_1000_add_primary_key_transport_group_transport',1); +INSERT INTO migrations VALUES(188,'2020_10_21_124101_allow_nullable_ospf_columns',1); diff --git a/includes/functions.php b/includes/functions.php index b1df240c15..91071a6999 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2186,83 +2186,6 @@ function cache_peeringdb() } } -/** - * Dump the database schema to an array. - * The top level will be a list of tables - * Each table contains the keys Columns and Indexes. - * - * Each entry in the Columns array contains these keys: Field, Type, Null, Default, Extra - * Each entry in the Indexes array contains these keys: Name, Columns(array), Unique - * - * @param string $connection use a specific connection - * @return array - */ -function dump_db_schema($connection = null) -{ - $output = []; - $db_name = DB::connection($connection)->getDatabaseName(); - - foreach (DB::connection($connection)->select(DB::raw("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$db_name' ORDER BY TABLE_NAME;")) as $table) { - $table = $table->TABLE_NAME; - foreach (DB::connection($connection)->select(DB::raw("SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_DEFAULT, EXTRA FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$db_name' AND TABLE_NAME='$table'")) as $data) { - $def = [ - 'Field' => $data->COLUMN_NAME, - 'Type' => preg_replace('/int\([0-9]+\)/', 'int', $data->COLUMN_TYPE), - 'Null' => $data->IS_NULLABLE === 'YES', - 'Extra' => str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $data->EXTRA), - ]; - - if (isset($data->COLUMN_DEFAULT) && $data->COLUMN_DEFAULT != 'NULL') { - $default = trim($data->COLUMN_DEFAULT, "'"); - $def['Default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $default); - } - // MySQL 8 fix, remove DEFAULT_GENERATED from timestamp extra columns - if ($def['Type'] == 'timestamp') { - $def['Extra'] = preg_replace('/DEFAULT_GENERATED[ ]*/', '', $def['Extra']); - } - - $output[$table]['Columns'][] = $def; - } - - $keys = DB::connection($connection)->select(DB::raw("SHOW INDEX FROM `$table`")); - usort($keys, function ($a, $b) { - return $a->Key_name <=> $b->Key_name; - }); - foreach ($keys as $key) { - $key_name = $key->Key_name; - if (isset($output[$table]['Indexes'][$key_name])) { - $output[$table]['Indexes'][$key_name]['Columns'][] = $key->Column_name; - } else { - $output[$table]['Indexes'][$key_name] = [ - 'Name' => $key->Key_name, - 'Columns' => [$key->Column_name], - 'Unique' => ! $key->Non_unique, - 'Type' => $key->Index_type, - ]; - } - } - - $create = DB::connection($connection)->select(DB::raw("SHOW CREATE TABLE `$table`"))[0]; - - if (isset($create->{'Create Table'})) { - $constraint_regex = '/CONSTRAINT `(?[A-Za-z_0-9]+)` FOREIGN KEY \(`(?[A-Za-z_0-9]+)`\) REFERENCES `(?
[A-Za-z_0-9]+)` \(`(?[A-Za-z_0-9]+)`\) ?(?[ A-Z]+)?/'; - $constraint_count = preg_match_all($constraint_regex, $create->{'Create Table'}, $constraints); - for ($i = 0; $i < $constraint_count; $i++) { - $constraint_name = $constraints['name'][$i]; - $output[$table]['Constraints'][$constraint_name] = [ - 'name' => $constraint_name, - 'foreign_key' => $constraints['foreign_key'][$i], - 'table' => $constraints['table'][$i], - 'key' => $constraints['key'][$i], - 'extra' => $constraints['extra'][$i], - ]; - } - } - } - - return $output; -} - /** * Get an array of the schema files. * schema_version => full_file_name diff --git a/scripts/build-schema.php b/scripts/build-schema.php deleted file mode 100755 index 601d4aad20..0000000000 --- a/scripts/build-schema.php +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env php -connection); + $current_schema = Schema::dump($this->connection); $message = "Schema does not match the expected schema defined by misc/db_schema.yaml\n"; - $message .= "If you have changed the schema, make sure you update it with ./scripts/build-schema.php\n"; + $message .= "If you have changed the schema, make sure you update it with: lnms schema:dump\n"; $this->assertEquals($master_schema, $current_schema, $message); }