f7d088ce289a7d4f4c666b3a3230f6e1f30de3b6
3 function renderInstallerHTML()
5 $stepfunc[1] = 'not_already_installed';
6 $stepfunc[2] = 'platform_is_ok';
7 $stepfunc[3] = 'init_config';
8 $stepfunc[4] = 'init_database_static';
9 $stepfunc[5] = 'init_database_dynamic';
10 $stepfunc[6] = 'congrats';
13 if (isset ($_REQUEST['step']))
14 $step = $_REQUEST['step'];
18 if ($step > count ($stepfunc))
20 $root = (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') ?
'http://' : 'https://';
21 $root .= isset ($_SERVER['HTTP_HOST']) ?
$_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80'?
'':$_SERVER['SERVER_PORT']));
22 // "Since PHP 4.3.0, you will often get a slash or a dot back from
23 // dirname() in situations where the older functionality would have given
24 // you the empty string."
25 // "On Windows, both slash (/) and backslash (\) are used as directory
26 // separator character."
27 $root .= strtr (dirname ($_SERVER['PHP_SELF']), '\\', '/');
28 if (substr ($root, -1) != '/')
30 header ("Location: ${root}");
33 $title = "RackTables installation: step ${step} of " . count ($stepfunc);
34 header ('Content-Type: text/html; charset=UTF-8');
35 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en" lang
="en">
37 <head
><title
><?php
echo $title; ?
></title
>
38 <style type
="text/css">
44 background
-color
: #80FF80;
48 background
-color
: #FFFF80;
52 background
-color
: #FF8080;
59 echo "<h1>${title}</h1><p>";
61 echo "</p><form method=post>\n";
62 $testres = $stepfunc[$step] ();
65 $next_step = $step +
1;
66 echo "<br><input type=submit value='proceed'>";
71 echo "<br><input type=submit value='retry'>";
73 echo "<input type=hidden name=step value='${next_step}'>\n";
84 // Check if the software is already installed.
85 function not_already_installed()
87 @include
('inc/secret.php');
90 echo 'Your configuration file exists and seems to hold necessary data already.<br>';
95 echo 'There seem to be no existing installation here, I am going to setup one now.<br>';
100 // Check that we can write to configuration file.
101 // If so, ask for DB connection paramaters and test
102 // the connection. Neither save the parameters nor allow
103 // going further until we succeed with the given
105 function init_config ()
107 if (!is_writable ('inc/secret.php'))
109 echo "The inc/secret.php file is not writable by web-server. Make sure it is.";
110 echo "The following commands should suffice:<pre>touch inc/secret.php; chmod 666 inc/secret.php</pre>";
111 echo 'Fedora Linux with SELinux may require this file to be owned by specific user (apache) and/or executing "setenforce 0" for the time of installation. ';
112 echo 'SELinux may be turned back on with "setenforce 1" command.<br>';
117 !isset ($_REQUEST['save_config']) or
118 empty ($_REQUEST['mysql_host']) or
119 empty ($_REQUEST['mysql_db']) or
120 empty ($_REQUEST['mysql_username']) or
121 empty ($_REQUEST['mysql_password'])
124 echo "<input type=hidden name=save_config value=1>\n";
125 echo '<h3>Hint on setting up a database:</h3><pre>';
126 echo "mysql>\nCREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;\n";
127 echo "GRANT ALL PRIVILEGES ON racktables_db.* TO racktables_user@localhost IDENTIFIED BY 'MY_SECRET_PASSWORD';\n</pre>";
129 echo "<tr><td><label for=mysql_host>MySQL host:</label></td>";
130 echo "<td><input type=text name=mysql_host id=mysql_host value=localhost></td></tr>\n";
131 echo "<tr><td><label for=mysql_host>database:</label></td>";
132 echo "<td><input type=text name=mysql_db id=mysql_db value=racktables_db></td></tr>\n";
133 echo "<tr><td><label for=mysql_username>username:</label></td>";
134 echo "<td><input type=text name=mysql_username value=racktables_user></td></tr>\n";
135 echo "<tr><td><label for=mysql_password>password:</label></td>";
136 echo "<td><input type=password name=mysql_password></td></tr>\n";
140 $pdo_dsn = 'mysql:host=' . $_REQUEST['mysql_host'] . ';dbname=' . $_REQUEST['mysql_db'];
143 $dbxlink = new PDO ($pdo_dsn, $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
145 catch (PDOException
$e)
147 echo "<input type=hidden name=save_config value=1>\n";
149 echo "<tr><td><label for=mysql_host>MySQL host:</label></td>";
150 echo "<td><input type=text name=mysql_host id=mysql_host value='" . $_REQUEST['mysql_host'] . "'></td></tr>\n";
151 echo "<tr><td><label for=mysql_host>database:</label></td>";
152 echo "<td><input type=text name=mysql_db id=mysql_db value='" . $_REQUEST['mysql_db'] . "'></td></tr>\n";
153 echo "<tr><td><label for=mysql_username>username:</label></td>";
154 echo "<td><input type=text name=mysql_username value='" . $_REQUEST['mysql_username'] . "'></td></tr>\n";
155 echo "<tr><td><label for=mysql_password>password:</label></td>";
156 echo "<td><input type=password name=mysql_password value='" . $_REQUEST['mysql_password'] . "'></td></tr>\n";
157 echo "<tr><td colspan=2>The above parameters did not work. Check and try again.</td></tr>\n";
162 $conf = fopen ('inc/secret.php', 'w+');
165 echo "Error: failed to open inc/secret.php for writing";
168 fwrite ($conf, "<?php\n/* This file has been generated automatically by RackTables installer.\n");
169 fwrite ($conf, " * you shouldn't normally edit it unless your database setup has changed.\n");
170 fwrite ($conf, " */\n");
171 fwrite ($conf, "\$pdo_dsn = '${pdo_dsn}';\n");
172 fwrite ($conf, "\$db_username = '" . $_REQUEST['mysql_username'] . "';\n");
173 fwrite ($conf, "\$db_password = '" . $_REQUEST['mysql_password'] . "';\n\n");
174 fwrite ($conf, <<<ENDOFTEXT
175 // Default setting is to authenticate users locally, but it is possible to
176 // employ existing LDAP or Apache userbase. Uncommenting below two lines MAY
177 // help in switching authentication to LDAP completely.
178 // More info: http://sourceforge.net/apps/mediawiki/racktables/index.php?title=RackTablesAdminGuide
179 #\$user_auth_src = 'ldap';
180 #\$require_local_account = FALSE;
182 // This is only necessary for 'ldap' authentication source
183 \$LDAP_options = array
185 'server' => 'some.server',
186 'domain' => 'some.domain',
187 # 'search_dn' => 'ou=people,O=YourCompany',
188 'search_attr' => 'uid',
189 # 'displayname_attrs' => 'givenname familyname',
191 // LDAP cache, values in seconds. Refresh, retry and expiry values are
192 // treated exactly as those for DNS SOA record. Example values 300-15-600:
193 // unconditionally remeber successful auth for 5 minutes, after that still
194 // permit user access, but try to revalidate username and password on the
195 // server (not more often, than once in 15 seconds). After 10 minutes of
196 // unsuccessful retries give up and deny access, so someone goes to fix
199 // Like in DNS, the following condition must be always met:
200 // cache_retry <= cache_refresh <= cache_expiry
202 // To disable LDAP cache completely, set cache_refresh, cache_retry and
203 // cache_expiry to 0.
204 'cache_refresh' => 300,
206 'cache_expiry' => 600,
207 // Uncomment line below to work around ActiveDirectory+PHP problem to perform
208 // search right in the base DN (not in one of OUs/CNs below).
209 # 'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3, LDAP_OPT_REFERRALS => 0),
215 fwrite ($conf, "?>\n");
217 echo "The configuration file has been written successfully.<br>";
221 function connect_to_db ()
223 require ('inc/secret.php');
227 $dbxlink = new PDO ($pdo_dsn, $db_username, $db_password);
229 catch (PDOException
$e)
231 die ('Error connecting to the database');
235 function init_database_static ()
239 if (!isInnoDBSupported())
241 echo 'InnoDB test failed! Please configure MySQL server properly and retry.';
244 $result = $dbxlink->query ('show tables');
245 $tables = $result->fetchAll (PDO
::FETCH_NUM
);
246 $result->closeCursor();
250 echo 'Your database is already holding ' . count ($tables);
251 echo ' tables, so I will stop here and let you check it yourself.<br>';
252 echo 'There is some important data there probably.<br>';
255 echo 'Initializing the database...<br>';
256 echo '<table border=1>';
257 echo "<tr><th>section</th><th>queries</th><th>errors</th></tr>";
259 foreach (array ('structure', 'dictbase') as $part)
261 echo "<tr><td>${part}</td>";
263 foreach (preg_split ("/;\s*\n/", get_pseudo_file ($part)) as $query)
265 $query = trim($query);
266 if (empty ($query) or '--' == substr ($query, 0, 2))
269 if ($dbxlink->exec ($query) === FALSE)
275 echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
277 // (re)load dictionary by pure PHP means w/o any external file
278 echo "<tr><td>dictionary</td>";
281 foreach (reloadDictionary() as $query)
284 if ($dbxlink->exec ($query) === FALSE)
290 echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
293 if (count ($errlist))
295 echo '<pre>The following queries failed:\n';
296 foreach ($errlist as $q)
304 function init_database_dynamic ()
308 if (!isset ($_REQUEST['password']) or empty ($_REQUEST['password']))
310 $result = $dbxlink->query ('select count(user_id) from UserAccount where user_id = 1');
311 $row = $result->fetch (PDO
::FETCH_NUM
);
313 $result->closeCursor();
316 echo '<table border=1>';
317 echo '<caption>Administrator password not set</caption>';
318 echo '<tr><td><input type=password name=password></td></tr>';
325 // Never send cleartext password over the wire.
326 $hash = sha1 ($_REQUEST['password']);
327 $query = "INSERT INTO `UserAccount` (`user_id`, `user_name`, `user_password_hash`, `user_realname`) " .
328 "VALUES (1,'admin','${hash}','RackTables Administrator')";
329 $result = $dbxlink->exec ($query);
330 echo "Administrator password has been set successfully.<br>";
337 echo 'Congratulations! RackTables installation is complete. After pressing Proceed you will ';
338 echo 'enter the system. Authenticate with <strong>admin</strong> username.<br>RackTables project has a ';
339 echo "<a href='http://sourceforge.net/apps/mediawiki/racktables/index.php?title=RackTablesAdminGuide'>";
340 echo "wiki</a> and a ";
341 echo "<a href='http://www.freelists.org/list/racktables-users'>mailing list</a> for users. Have fun.<br>";
345 function get_pseudo_file ($name)
350 return <<<END_OF_FILE
351 alter database character set utf8;
353 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
355 CREATE TABLE `Atom` (
356 `molecule_id` int(10) unsigned default NULL,
357 `rack_id` int(10) unsigned default NULL,
358 `unit_no` int(10) unsigned default NULL,
359 `atom` enum('front','interior','rear') default NULL
362 CREATE TABLE `Attribute` (
363 `id` int(10) unsigned NOT NULL auto_increment,
364 `type` enum('string','uint','float','dict') default NULL,
365 `name` char(64) default NULL,
367 UNIQUE KEY `name` (`name`)
368 ) ENGINE=MyISAM AUTO_INCREMENT=10000;
370 CREATE TABLE `AttributeMap` (
371 `objtype_id` int(10) unsigned NOT NULL default '1',
372 `attr_id` int(10) unsigned NOT NULL default '1',
373 `chapter_id` int(10) unsigned default NULL,
374 UNIQUE KEY `objtype_id` (`objtype_id`,`attr_id`)
377 CREATE TABLE `AttributeValue` (
378 `object_id` int(10) unsigned default NULL,
379 `attr_id` int(10) unsigned default NULL,
380 `string_value` char(128) default NULL,
381 `uint_value` int(10) unsigned default NULL,
382 `float_value` float default NULL,
383 UNIQUE KEY `object_id` (`object_id`,`attr_id`),
384 CONSTRAINT `AttributeValue-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
387 CREATE TABLE `CachedPAV` (
388 `object_id` int(10) unsigned NOT NULL,
389 `port_name` char(255) NOT NULL,
390 `vlan_id` int(10) unsigned NOT NULL default '0',
391 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
392 KEY `vlan_id` (`vlan_id`),
393 CONSTRAINT `CachedPAV-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `CachedPVM` (`object_id`, `port_name`) ON DELETE CASCADE,
394 CONSTRAINT `CachedPAV-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
397 CREATE TABLE `CachedPNV` (
398 `object_id` int(10) unsigned NOT NULL,
399 `port_name` char(255) NOT NULL,
400 `vlan_id` int(10) unsigned NOT NULL default '0',
401 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
402 UNIQUE KEY `port_id` (`object_id`,`port_name`),
403 CONSTRAINT `CachedPNV-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `CachedPAV` (`object_id`, `port_name`, `vlan_id`) ON DELETE CASCADE
406 CREATE TABLE `CachedPVM` (
407 `object_id` int(10) unsigned NOT NULL,
408 `port_name` char(255) NOT NULL,
409 `vlan_mode` enum('access','trunk') NOT NULL default 'access',
410 PRIMARY KEY (`object_id`,`port_name`),
411 CONSTRAINT `CachedPVM-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
414 CREATE TABLE `Chapter` (
415 `id` int(10) unsigned NOT NULL auto_increment,
416 `sticky` enum('yes','no') default 'no',
417 `name` char(128) NOT NULL,
419 UNIQUE KEY `name` (`name`)
420 ) ENGINE=MyISAM AUTO_INCREMENT=10000;
422 CREATE TABLE `Config` (
423 `varname` char(32) NOT NULL,
424 `varvalue` text NOT NULL,
425 `vartype` enum('string','uint') NOT NULL default 'string',
426 `emptyok` enum('yes','no') NOT NULL default 'no',
427 `is_hidden` enum('yes','no') NOT NULL default 'yes',
428 `is_userdefined` enum('yes','no') NOT NULL default 'no',
430 PRIMARY KEY (`varname`)
433 CREATE TABLE `Dictionary` (
434 `chapter_id` int(10) unsigned NOT NULL,
435 `dict_key` int(10) unsigned NOT NULL auto_increment,
436 `dict_value` char(255) default NULL,
437 PRIMARY KEY (`dict_key`),
438 UNIQUE KEY `chap_to_val` (`chapter_id`,`dict_value`)
439 ) ENGINE=MyISAM AUTO_INCREMENT=50000;
441 CREATE TABLE `EntityLink` (
442 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
443 `parent_entity_type` enum('ipv4net','ipv4rspool','ipv4vs','ipv6net','object','rack','user') NOT NULL,
444 `parent_entity_id` int(10) unsigned NOT NULL,
445 `child_entity_type` enum('file','object') NOT NULL,
446 `child_entity_id` int(10) unsigned NOT NULL,
448 UNIQUE KEY `EntityLink-unique` (`parent_entity_type`,`parent_entity_id`,`child_entity_type`,`child_entity_id`)
451 CREATE TABLE `File` (
452 `id` int(10) unsigned NOT NULL auto_increment,
453 `name` char(255) NOT NULL,
454 `type` char(255) NOT NULL,
455 `size` int(10) unsigned NOT NULL,
456 `ctime` datetime NOT NULL,
457 `mtime` datetime NOT NULL,
458 `atime` datetime NOT NULL,
459 `thumbnail` longblob,
460 `contents` longblob NOT NULL,
463 UNIQUE KEY `name` (`name`)
466 CREATE TABLE `FileLink` (
467 `id` int(10) unsigned NOT NULL auto_increment,
468 `file_id` int(10) unsigned NOT NULL,
469 `entity_type` enum('ipv4net','ipv4rspool','ipv4vs','object','rack','user','ipv6net') NOT NULL default 'object',
470 `entity_id` int(10) NOT NULL,
472 KEY `FileLink-file_id` (`file_id`),
473 UNIQUE KEY `FileLink-unique` (`file_id`,`entity_type`,`entity_id`),
474 CONSTRAINT `FileLink-File_fkey` FOREIGN KEY (`file_id`) REFERENCES `File` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
477 CREATE TABLE `IPv4Address` (
478 `ip` int(10) unsigned NOT NULL default '0',
479 `name` char(255) NOT NULL default '',
480 `reserved` enum('yes','no') default NULL,
484 CREATE TABLE `IPv4Allocation` (
485 `object_id` int(10) unsigned NOT NULL default '0',
486 `ip` int(10) unsigned NOT NULL default '0',
487 `name` char(255) NOT NULL default '',
488 `type` enum('regular','shared','virtual','router') default NULL,
489 PRIMARY KEY (`object_id`,`ip`),
491 CONSTRAINT `IPv4Allocation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
494 CREATE TABLE `IPv4LB` (
495 `object_id` int(10) unsigned default NULL,
496 `rspool_id` int(10) unsigned default NULL,
497 `vs_id` int(10) unsigned default NULL,
498 `prio` int(10) unsigned default NULL,
501 UNIQUE KEY `LB-VS` (`object_id`,`vs_id`),
502 KEY `IPv4LB-FK-rspool_id` (`rspool_id`),
503 KEY `IPv4LB-FK-vs_id` (`vs_id`),
504 CONSTRAINT `IPv4LB-FK-vs_id` FOREIGN KEY (`vs_id`) REFERENCES `IPv4VS` (`id`),
505 CONSTRAINT `IPv4LB-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`),
506 CONSTRAINT `IPv4LB-FK-rspool_id` FOREIGN KEY (`rspool_id`) REFERENCES `IPv4RSPool` (`id`)
509 CREATE TABLE `IPv4NAT` (
510 `object_id` int(10) unsigned NOT NULL default '0',
511 `proto` enum('TCP','UDP') NOT NULL default 'TCP',
512 `localip` int(10) unsigned NOT NULL default '0',
513 `localport` smallint(5) unsigned NOT NULL default '0',
514 `remoteip` int(10) unsigned NOT NULL default '0',
515 `remoteport` smallint(5) unsigned NOT NULL default '0',
516 `description` char(255) default NULL,
517 PRIMARY KEY (`object_id`,`proto`,`localip`,`localport`,`remoteip`,`remoteport`),
518 KEY `localip` (`localip`),
519 KEY `remoteip` (`remoteip`),
520 KEY `object_id` (`object_id`),
521 CONSTRAINT `IPv4NAT-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`)
524 CREATE TABLE `IPv4Network` (
525 `id` int(10) unsigned NOT NULL auto_increment,
526 `ip` int(10) unsigned NOT NULL default '0',
527 `mask` int(10) unsigned NOT NULL default '0',
528 `name` char(255) default NULL,
531 UNIQUE KEY `base-len` (`ip`,`mask`)
534 CREATE TABLE `IPv4RS` (
535 `id` int(10) unsigned NOT NULL auto_increment,
536 `inservice` enum('yes','no') NOT NULL default 'no',
537 `rsip` int(10) unsigned default NULL,
538 `rsport` smallint(5) unsigned default NULL,
539 `rspool_id` int(10) unsigned default NULL,
543 UNIQUE KEY `pool-endpoint` (`rspool_id`,`rsip`,`rsport`),
544 CONSTRAINT `IPv4RS-FK` FOREIGN KEY (`rspool_id`) REFERENCES `IPv4RSPool` (`id`) ON DELETE CASCADE
547 CREATE TABLE `IPv4RSPool` (
548 `id` int(10) unsigned NOT NULL auto_increment,
549 `name` char(255) default NULL,
555 CREATE TABLE `IPv4VS` (
556 `id` int(10) unsigned NOT NULL auto_increment,
557 `vip` int(10) unsigned default NULL,
558 `vport` smallint(5) unsigned default NULL,
559 `proto` enum('TCP','UDP') NOT NULL default 'TCP',
560 `name` char(255) default NULL,
567 CREATE TABLE `IPv6Address` (
568 `ip` binary(16) NOT NULL,
569 `name` char(255) NOT NULL default '',
570 `reserved` enum('yes','no') default NULL,
574 CREATE TABLE `IPv6Allocation` (
575 `object_id` int(10) unsigned NOT NULL default '0',
576 `ip` binary(16) NOT NULL,
577 `name` char(255) NOT NULL default '',
578 `type` enum('regular','shared','virtual','router') default NULL,
579 PRIMARY KEY (`object_id`,`ip`),
581 CONSTRAINT `IPv6Allocation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
584 CREATE TABLE `IPv6Network` (
585 `id` int(10) unsigned NOT NULL auto_increment,
586 `ip` binary(16) NOT NULL,
587 `mask` int(10) unsigned NOT NULL,
588 `last_ip` binary(16) NOT NULL,
589 `name` char(255) default NULL,
592 UNIQUE KEY `ip` (`ip`,`mask`)
595 CREATE TABLE `LDAPCache` (
596 `presented_username` char(64) NOT NULL,
597 `successful_hash` char(40) NOT NULL,
598 `first_success` timestamp NOT NULL default CURRENT_TIMESTAMP,
599 `last_retry` timestamp NOT NULL default '0000-00-00 00:00:00',
600 `displayed_name` char(128) default NULL,
602 UNIQUE KEY `presented_username` (`presented_username`),
603 KEY `scanidx` (`presented_username`,`successful_hash`)
606 CREATE TABLE `Link` (
607 `porta` int(10) unsigned NOT NULL default '0',
608 `portb` int(10) unsigned NOT NULL default '0',
609 `cable` char(64) DEFAULT NULL,
610 PRIMARY KEY (`porta`,`portb`),
611 UNIQUE KEY `porta` (`porta`),
612 UNIQUE KEY `portb` (`portb`),
613 CONSTRAINT `Link-FK-a` FOREIGN KEY (`porta`) REFERENCES `Port` (`id`) ON DELETE CASCADE,
614 CONSTRAINT `Link-FK-b` FOREIGN KEY (`portb`) REFERENCES `Port` (`id`) ON DELETE CASCADE
617 CREATE TABLE `Molecule` (
618 `id` int(10) unsigned NOT NULL auto_increment,
622 CREATE TABLE `MountOperation` (
623 `id` int(10) unsigned NOT NULL auto_increment,
624 `object_id` int(10) unsigned NOT NULL default '0',
625 `ctime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
626 `user_name` char(64) default NULL,
627 `old_molecule_id` int(10) unsigned default NULL,
628 `new_molecule_id` int(10) unsigned default NULL,
631 KEY `object_id` (`object_id`),
632 CONSTRAINT `MountOperation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
635 CREATE TABLE `ObjectLog` (
636 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
637 `object_id` int(10) unsigned NOT NULL,
638 `user` char(64) NOT NULL,
639 `date` datetime NOT NULL,
640 `content` text NOT NULL,
642 KEY `object_id` (`object_id`),
644 CONSTRAINT `ObjectLog-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
647 CREATE TABLE `ObjectParentCompat` (
648 `parent_objtype_id` int(10) unsigned NOT NULL,
649 `child_objtype_id` int(10) unsigned NOT NULL,
650 UNIQUE KEY `parent_child` (`parent_objtype_id`,`child_objtype_id`)
653 CREATE TABLE `Port` (
654 `id` int(10) unsigned NOT NULL auto_increment,
655 `object_id` int(10) unsigned NOT NULL default '0',
656 `name` char(255) NOT NULL default '',
657 `iif_id` int(10) unsigned NOT NULL,
658 `type` int(10) unsigned NOT NULL default '0',
659 `l2address` char(64) default NULL,
660 `reservation_comment` char(255) default NULL,
661 `label` char(255) default NULL,
663 UNIQUE KEY `object_iif_oif_name` (`object_id`,`iif_id`,`type`,`name`),
665 KEY `comment` (`reservation_comment`),
666 KEY `l2address` (`l2address`),
667 KEY `Port-FK-iif-oif` (`iif_id`,`type`),
668 CONSTRAINT `Port-FK-iif-oif` FOREIGN KEY (`iif_id`, `type`) REFERENCES `PortInterfaceCompat` (`iif_id`, `oif_id`),
669 CONSTRAINT `Port-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
672 CREATE TABLE `PortAllowedVLAN` (
673 `object_id` int(10) unsigned NOT NULL,
674 `port_name` char(255) NOT NULL,
675 `vlan_id` int(10) unsigned NOT NULL default '0',
676 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
677 KEY `vlan_id` (`vlan_id`),
678 CONSTRAINT `PortAllowedVLAN-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `PortVLANMode` (`object_id`, `port_name`) ON DELETE CASCADE,
679 CONSTRAINT `PortAllowedVLAN-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
682 CREATE TABLE `PortCompat` (
683 `type1` int(10) unsigned NOT NULL default '0',
684 `type2` int(10) unsigned NOT NULL default '0',
685 UNIQUE KEY `type1_2` (`type1`,`type2`),
686 KEY `type2` (`type2`)
689 CREATE TABLE `PortInnerInterface` (
690 `id` int(10) unsigned NOT NULL,
691 `iif_name` char(16) NOT NULL,
693 UNIQUE KEY `iif_name` (`iif_name`)
696 CREATE TABLE `PortInterfaceCompat` (
697 `iif_id` int(10) unsigned NOT NULL,
698 `oif_id` int(10) unsigned NOT NULL,
699 UNIQUE KEY `pair` (`iif_id`,`oif_id`),
700 CONSTRAINT `PortInterfaceCompat-FK-iif_id` FOREIGN KEY (`iif_id`) REFERENCES `PortInnerInterface` (`id`)
703 CREATE TABLE `PortNativeVLAN` (
704 `object_id` int(10) unsigned NOT NULL,
705 `port_name` char(255) NOT NULL,
706 `vlan_id` int(10) unsigned NOT NULL default '0',
707 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
708 UNIQUE KEY `port_id` (`object_id`,`port_name`),
709 CONSTRAINT `PortNativeVLAN-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `PortAllowedVLAN` (`object_id`, `port_name`, `vlan_id`) ON DELETE CASCADE
712 CREATE TABLE `PortVLANMode` (
713 `object_id` int(10) unsigned NOT NULL,
714 `port_name` char(255) NOT NULL,
715 `vlan_mode` enum('access','trunk') NOT NULL default 'access',
716 PRIMARY KEY (`object_id`,`port_name`),
717 CONSTRAINT `PortVLANMode-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `CachedPVM` (`object_id`, `port_name`)
720 CREATE TABLE `Rack` (
721 `id` int(10) unsigned NOT NULL auto_increment,
722 `name` char(255) default NULL,
723 `row_id` int(10) unsigned NOT NULL default '1',
724 `height` tinyint(3) unsigned NOT NULL default '42',
728 UNIQUE KEY `name_in_row` (`row_id`,`name`),
729 CONSTRAINT `Rack-FK-row_id` FOREIGN KEY (`row_id`) REFERENCES `RackRow` (`id`)
732 CREATE TABLE `RackHistory` (
733 `id` int(10) unsigned default NULL,
734 `name` char(255) default NULL,
735 `row_id` int(10) unsigned default NULL,
736 `height` tinyint(3) unsigned default NULL,
739 `ctime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
740 `user_name` char(64) default NULL
743 CREATE TABLE `RackObject` (
744 `id` int(10) unsigned NOT NULL auto_increment,
745 `name` char(255) default NULL,
746 `label` char(255) default NULL,
747 `objtype_id` int(10) unsigned NOT NULL default '1',
748 `asset_no` char(64) default NULL,
749 `has_problems` enum('yes','no') NOT NULL default 'no',
752 UNIQUE KEY `RackObject_asset_no` (`asset_no`),
753 UNIQUE KEY `name` (`name`)
756 CREATE TABLE `RackObjectHistory` (
757 `id` int(10) unsigned default NULL,
758 `name` char(255) default NULL,
759 `label` char(255) default NULL,
760 `objtype_id` int(10) unsigned default NULL,
761 `asset_no` char(64) default NULL,
762 `has_problems` enum('yes','no') NOT NULL default 'no',
764 `ctime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
765 `user_name` char(64) default NULL,
767 CONSTRAINT `RackObjectHistory-FK-object_id` FOREIGN KEY (`id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
770 CREATE TABLE `RackRow` (
771 `id` int(10) unsigned NOT NULL auto_increment,
772 `name` char(255) NOT NULL,
774 UNIQUE KEY `name` (`name`)
777 CREATE TABLE `RackSpace` (
778 `rack_id` int(10) unsigned NOT NULL default '0',
779 `unit_no` int(10) unsigned NOT NULL default '0',
780 `atom` enum('front','interior','rear') NOT NULL default 'interior',
781 `state` enum('A','U','T','W') NOT NULL default 'A',
782 `object_id` int(10) unsigned default NULL,
783 PRIMARY KEY (`rack_id`,`unit_no`,`atom`),
784 KEY `RackSpace_object_id` (`object_id`),
785 CONSTRAINT `RackSpace-FK-rack_id` FOREIGN KEY (`rack_id`) REFERENCES `Rack` (`id`),
786 CONSTRAINT `RackSpace-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`) ON DELETE CASCADE
789 CREATE TABLE `Script` (
790 `script_name` char(64) NOT NULL,
791 `script_text` longtext,
792 PRIMARY KEY (`script_name`)
795 CREATE TABLE `TagStorage` (
796 `entity_realm` enum('file','ipv4net','ipv4vs','ipv4rspool','object','rack','user','ipv6net') NOT NULL default 'object',
797 `entity_id` int(10) unsigned NOT NULL,
798 `tag_id` int(10) unsigned NOT NULL default '0',
799 UNIQUE KEY `entity_tag` (`entity_realm`,`entity_id`,`tag_id`),
800 KEY `entity_id` (`entity_id`),
801 KEY `TagStorage-FK-tag_id` (`tag_id`),
802 CONSTRAINT `TagStorage-FK-tag_id` FOREIGN KEY (`tag_id`) REFERENCES `TagTree` (`id`)
805 CREATE TABLE `TagTree` (
806 `id` int(10) unsigned NOT NULL auto_increment,
807 `parent_id` int(10) unsigned default NULL,
808 `tag` char(255) default NULL,
810 UNIQUE KEY `tag` (`tag`),
811 KEY `TagTree-K-parent_id` (`parent_id`),
812 CONSTRAINT `TagTree-K-parent_id` FOREIGN KEY (`parent_id`) REFERENCES `TagTree` (`id`)
815 CREATE TABLE `UserAccount` (
816 `user_id` int(10) unsigned NOT NULL auto_increment,
817 `user_name` char(64) NOT NULL default '',
818 `user_password_hash` char(40) default NULL,
819 `user_realname` char(64) default NULL,
820 PRIMARY KEY (`user_id`),
821 UNIQUE KEY `user_name` (`user_name`)
822 ) ENGINE=MyISAM AUTO_INCREMENT=10000;
824 CREATE TABLE `UserConfig` (
825 `varname` char(32) NOT NULL,
826 `varvalue` text NOT NULL,
827 `user` char(64) NOT NULL,
828 UNIQUE KEY `user_varname` (`user`,`varname`)
831 CREATE TABLE `VLANDescription` (
832 `domain_id` int(10) unsigned NOT NULL,
833 `vlan_id` int(10) unsigned NOT NULL default '0',
834 `vlan_type` enum('ondemand','compulsory','alien') NOT NULL default 'ondemand',
835 `vlan_descr` char(255) default NULL,
836 PRIMARY KEY (`domain_id`,`vlan_id`),
837 KEY `vlan_id` (`vlan_id`),
838 CONSTRAINT `VLANDescription-FK-domain_id` FOREIGN KEY (`domain_id`) REFERENCES `VLANDomain` (`id`) ON DELETE CASCADE,
839 CONSTRAINT `VLANDescription-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
842 CREATE TABLE `VLANDomain` (
843 `id` int(10) unsigned NOT NULL auto_increment,
844 `description` char(255) default NULL,
846 UNIQUE KEY `description` (`description`)
849 CREATE TABLE `VLANIPv4` (
850 `domain_id` int(10) unsigned NOT NULL,
851 `vlan_id` int(10) unsigned NOT NULL,
852 `ipv4net_id` int(10) unsigned NOT NULL,
853 UNIQUE KEY `network-domain` (`ipv4net_id`,`domain_id`),
854 KEY `VLANIPv4-FK-compound` (`domain_id`,`vlan_id`),
855 CONSTRAINT `VLANIPv4-FK-compound` FOREIGN KEY (`domain_id`, `vlan_id`) REFERENCES `VLANDescription` (`domain_id`, `vlan_id`) ON DELETE CASCADE,
856 CONSTRAINT `VLANIPv4-FK-ipv4net_id` FOREIGN KEY (`ipv4net_id`) REFERENCES `IPv4Network` (`id`) ON DELETE CASCADE
859 CREATE TABLE `VLANIPv6` (
860 `domain_id` int(10) unsigned NOT NULL,
861 `vlan_id` int(10) unsigned NOT NULL,
862 `ipv6net_id` int(10) unsigned NOT NULL,
863 UNIQUE KEY `network-domain` (`ipv6net_id`,`domain_id`),
864 KEY `VLANIPv6-FK-compound` (`domain_id`,`vlan_id`),
865 CONSTRAINT `VLANIPv6-FK-compound` FOREIGN KEY (`domain_id`, `vlan_id`) REFERENCES `VLANDescription` (`domain_id`, `vlan_id`) ON DELETE CASCADE,
866 CONSTRAINT `VLANIPv6-FK-ipv6net_id` FOREIGN KEY (`ipv6net_id`) REFERENCES `IPv6Network` (`id`) ON DELETE CASCADE
869 CREATE TABLE `VLANSTRule` (
870 `vst_id` int(10) unsigned NOT NULL,
871 `rule_no` int(10) unsigned NOT NULL,
872 `port_pcre` char(255) NOT NULL,
873 `port_role` enum('access','trunk','anymode','uplink','downlink','none') NOT NULL default 'none',
874 `wrt_vlans` char(255) default NULL,
875 `description` char(255) default NULL,
876 UNIQUE KEY `vst-rule` (`vst_id`,`rule_no`),
877 CONSTRAINT `VLANSTRule-FK-vst_id` FOREIGN KEY (`vst_id`) REFERENCES `VLANSwitchTemplate` (`id`) ON DELETE CASCADE
880 CREATE TABLE `VLANSwitch` (
881 `object_id` int(10) unsigned NOT NULL,
882 `domain_id` int(10) unsigned NOT NULL,
883 `template_id` int(10) unsigned NOT NULL,
884 `mutex_rev` int(10) unsigned NOT NULL default '0',
885 `out_of_sync` enum('yes','no') NOT NULL default 'yes',
886 `last_errno` int(10) unsigned NOT NULL default '0',
887 `last_change` timestamp NOT NULL default '0000-00-00 00:00:00',
888 `last_push_started` timestamp NOT NULL default '0000-00-00 00:00:00',
889 `last_push_finished` timestamp NOT NULL default '0000-00-00 00:00:00',
890 `last_error_ts` timestamp NOT NULL default '0000-00-00 00:00:00',
891 UNIQUE KEY `object_id` (`object_id`),
892 KEY `domain_id` (`domain_id`),
893 KEY `template_id` (`template_id`),
894 KEY `out_of_sync` (`out_of_sync`),
895 KEY `last_errno` (`last_errno`),
896 CONSTRAINT `VLANSwitch-FK-domain_id` FOREIGN KEY (`domain_id`) REFERENCES `VLANDomain` (`id`),
897 CONSTRAINT `VLANSwitch-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `RackObject` (`id`),
898 CONSTRAINT `VLANSwitch-FK-template_id` FOREIGN KEY (`template_id`) REFERENCES `VLANSwitchTemplate` (`id`)
901 CREATE TABLE `VLANSwitchTemplate` (
902 `id` int(10) unsigned NOT NULL auto_increment,
903 `mutex_rev` int(10) NOT NULL,
904 `description` char(255) default NULL,
905 `saved_by` char(64) NOT NULL,
907 UNIQUE KEY `description` (`description`)
910 CREATE TABLE `VLANValidID` (
911 `vlan_id` int(10) unsigned NOT NULL default '1',
912 PRIMARY KEY (`vlan_id`)
915 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
917 ##########################################################################
919 return <<<END_OF_FILE
920 INSERT INTO `Attribute` (`id`, `type`, `name`) VALUES
921 (1,'string','OEM S/N 1'),
922 (2,'dict','HW type'),
924 (4,'dict','SW type'),
925 (5,'string','SW version'),
926 (6,'uint','number of ports'),
927 (7,'float','max. current, Ampers'),
928 (8,'float','power load, percents'),
929 (14,'string','contact person'),
930 (13,'float','max power, Watts'),
931 (16,'uint','flash memory, MB'),
932 (17,'uint','DRAM, MB'),
933 (18,'uint','CPU, MHz'),
934 (20,'string','OEM S/N 2'),
935 (21,'string','support contract expiration'),
936 (22,'string','HW warranty expiration'),
937 (24,'string','SW warranty expiration'),
938 (25,'string','UUID'),
939 (26,'dict','Hypervisor');
941 INSERT INTO `AttributeMap` (`objtype_id`, `attr_id`, `chapter_id`) VALUES
1064 INSERT INTO `Chapter` (`id`, `sticky`, `name`) VALUES
1065 (1,'yes','RackObjectType'),
1066 (2,'yes','PortOuterInterface'),
1067 (11,'no','server models'),
1068 (12,'no','network switch models'),
1069 (13,'no','server OS type'),
1070 (14,'no','switch OS type'),
1071 (16,'no','router OS type'),
1072 (17,'no','router models'),
1073 (18,'no','disk array models'),
1074 (19,'no','tape library models'),
1075 (21,'no','KVM switch models'),
1076 (22,'no','multiplexer models'),
1077 (23,'no','console models'),
1078 (24,'no','network security models'),
1079 (25,'no','wireless models'),
1080 (26,'no','fibre channel switch models'),
1081 (27,'no','PDU models'),
1082 (28,'no','Voice/video hardware'),
1084 (30,'no','network chassis models'),
1085 (31,'no','server chassis models'),
1086 (32,'no','virtual switch models'),
1087 (33,'no','virtual switch OS type');
1089 INSERT INTO `PortInnerInterface` VALUES
1100 INSERT INTO `ObjectParentCompat` VALUES
1112 INSERT INTO `PortInterfaceCompat` VALUES
1113 (2,1208),(2,1195),(2,1196),(2,1197),(2,1198),(2,1199),(2,1200),(2,1201),
1114 (3,1078),(3,24),(3,34),(3,1202),(3,1203),(3,1204),(3,1205),(3,1206),(3,1207),
1115 (4,1077),(4,24),(4,34),(4,1202),(4,1203),(4,1204),(4,1205),(4,1206),(4,1207),
1116 (5,1079),(5,30),(5,35),(5,36),(5,37),(5,38),(5,39),(5,40),
1117 (6,1080),(6,30),(6,35),(6,36),(6,37),(6,38),(6,39),(6,40),
1118 (7,1081),(7,30),(7,35),(7,36),(7,37),(7,38),(7,39),(7,40),
1119 (8,1082),(8,30),(8,35),(8,36),(8,37),(8,38),(8,39),(8,40),
1120 (9,1084),(9,30),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),
1121 (1,16),(1,19),(1,24),(1,29),(1,31),(1,33),(1,446),(1,681),(1,682),(1,1322);
1123 INSERT INTO `PortCompat` (`type1`, `type2`) VALUES
1307 INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, is_userdefined, description) VALUES
1308 ('color_F','8fbfbf','string','no','yes','no','HSV: 180-25-75. Free atoms, they are available for allocation to objects.'),
1309 ('color_A','bfbfbf','string','no','yes','no','HSV: 0-0-75. Absent atoms.'),
1310 ('color_U','bf8f8f','string','no','yes','no','HSV: 0-25-75. Unusable atoms. Some problems keep them from being free.'),
1311 ('color_T','408080','string','no','yes','no','HSV: 180-50-50. Taken atoms, object_id should be set for such.'),
1312 ('color_Th','80ffff','string','no','yes','no','HSV: 180-50-100. Taken atoms with highlight. They are not stored in the database and are only used for highlighting.'),
1313 ('color_Tw','804040','string','no','yes','no','HSV: 0-50-50. Taken atoms with object problem. This is detected at runtime.'),
1314 ('color_Thw','ff8080','string','no','yes','no','HSV: 0-50-100. An object can be both current and problematic. We run highlightObject() first and markupObjectProblems() second.'),
1315 ('MASSCOUNT','8','uint','no','no','yes','"Fast" form is this many records tall'),
1316 ('MAXSELSIZE','30','uint','no','no','yes','<SELECT> lists height'),
1317 ('enterprise','MyCompanyName','string','no','no','no','Organization name'),
1318 ('ROW_SCALE','2','uint','no','no','yes','Picture scale for rack row display'),
1319 ('PORTS_PER_ROW','12','uint','no','no','yes','Ports per row in VLANs tab'),
1320 ('IPV4_ADDRS_PER_PAGE','256','uint','no','no','yes','IPv4 addresses per page'),
1321 ('DEFAULT_RACK_HEIGHT','42','uint','yes','no','yes','Default rack height'),
1322 ('DEFAULT_SLB_VS_PORT','','uint','yes','no','yes','Default port of SLB virtual service'),
1323 ('DEFAULT_SLB_RS_PORT','','uint','yes','no','yes','Default port of SLB real server'),
1324 ('DETECT_URLS','no','string','yes','no','yes','Detect URLs in text fields'),
1325 ('RACK_PRESELECT_THRESHOLD','1','uint','no','no','yes','Rack pre-selection threshold'),
1326 ('DEFAULT_IPV4_RS_INSERVICE','no','string','no','no','yes','Inservice status for new SLB real servers'),
1327 ('AUTOPORTS_CONFIG','4 = 1*33*kvm + 2*24*eth%u;15 = 1*446*kvm','string','yes','no','no','AutoPorts configuration'),
1328 ('DEFAULT_OBJECT_TYPE','4','uint','yes','no','yes','Default object type for new objects'),
1329 ('SHOW_EXPLICIT_TAGS','yes','string','no','no','yes','Show explicit tags'),
1330 ('SHOW_IMPLICIT_TAGS','yes','string','no','no','yes','Show implicit tags'),
1331 ('SHOW_AUTOMATIC_TAGS','no','string','no','no','yes','Show automatic tags'),
1332 ('IPV4_AUTO_RELEASE','1','uint','no','no','yes','Auto-release IPv4 addresses on allocation'),
1333 ('SHOW_LAST_TAB','no','string','yes','no','yes','Remember last tab shown for each page'),
1334 ('EXT_IPV4_VIEW','yes','string','no','no','yes','Extended IPv4 view'),
1335 ('TREE_THRESHOLD','25','uint','yes','no','yes','Tree view auto-collapse threshold'),
1336 ('IPV4_JAYWALK','no','string','no','no','no','Enable IPv4 address allocations w/o covering network'),
1337 ('ADDNEW_AT_TOP','yes','string','no','no','yes','Render "add new" line at top of the list'),
1338 ('IPV4_TREE_SHOW_USAGE','yes','string','no','no','yes','Show address usage in IPv4 tree'),
1339 ('PREVIEW_TEXT_MAXCHARS','10240','uint','yes','no','yes','Max chars for text file preview'),
1340 ('PREVIEW_TEXT_ROWS','25','uint','yes','no','yes','Rows for text file preview'),
1341 ('PREVIEW_TEXT_COLS','80','uint','yes','no','yes','Columns for text file preview'),
1342 ('PREVIEW_IMAGE_MAXPXS','320','uint','yes','no','yes','Max pixels per axis for image file preview'),
1343 ('VENDOR_SIEVE','','string','yes','no','yes','Vendor sieve configuration'),
1344 ('IPV4LB_LISTSRC','{\$typeid_4}','string','yes','no','no','List source: IPv4 load balancers'),
1345 ('IPV4OBJ_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8} or {\$typeid_12} or {\$typeid_445} or {\$typeid_447} or {\$typeid_798} or {\$typeid_1502} or {\$typeid_1503} or {\$typeid_1504} or {\$typeid_1507}','string','yes','no','no','List source: IPv4-enabled objects'),
1346 ('IPV4NAT_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8} or {\$typeid_798}','string','yes','no','no','List source: IPv4 NAT performers'),
1347 ('ASSETWARN_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8}','string','yes','no','no','List source: object, for which asset tag should be set'),
1348 ('NAMEWARN_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8}','string','yes','no','no','List source: object, for which common name should be set'),
1349 ('RACKS_PER_ROW','12','uint','yes','no','yes','Racks per row'),
1350 ('FILTER_PREDICATE_SIEVE','','string','yes','no','no','Predicate sieve regex(7)'),
1351 ('FILTER_DEFAULT_ANDOR','or','string','no','no','no','Default list filter boolean operation (or/and)'),
1352 ('FILTER_SUGGEST_ANDOR','yes','string','no','no','no','Suggest and/or selector in list filter'),
1353 ('FILTER_SUGGEST_TAGS','yes','string','no','no','no','Suggest tags in list filter'),
1354 ('FILTER_SUGGEST_PREDICATES','yes','string','no','no','no','Suggest predicates in list filter'),
1355 ('FILTER_SUGGEST_EXTRA','no','string','no','no','no','Suggest extra expression in list filter'),
1356 ('DEFAULT_SNMP_COMMUNITY','public','string','no','no','no','Default SNMP Community string'),
1357 ('IPV4_ENABLE_KNIGHT','yes','string','no','no','no','Enable IPv4 knight feature'),
1358 ('TAGS_TOPLIST_SIZE','50','uint','yes','no','no','Tags top list size'),
1359 ('TAGS_QUICKLIST_SIZE','20','uint','no','no','no','Tags quick list size'),
1360 ('TAGS_QUICKLIST_THRESHOLD','50','uint','yes','no','no','Tags quick list threshold'),
1361 ('ENABLE_MULTIPORT_FORM','no','string','no','no','no','Enable "Add/update multiple ports" form'),
1362 ('DEFAULT_PORT_IIF_ID','1','uint','no','no','no','Default port inner interface ID'),
1363 ('DEFAULT_PORT_OIF_IDS','1=24; 3=1078; 4=1077; 5=1079; 6=1080; 8=1082; 9=1084','string','no','no','no','Default port outer interface IDs'),
1364 ('IPV4_TREE_RTR_AS_CELL','yes','string','no','no','no','Show full router info for each network in IPv4 tree view'),
1365 ('PROXIMITY_RANGE','0','uint','yes','no','no','Proximity range (0 is current rack only)'),
1366 ('VLANSWITCH_LISTSRC', '', 'string', 'yes', 'no', 'yes', 'List of VLAN running switches'),
1367 ('VLANIPV4NET_LISTSRC', '', 'string', 'yes', 'no', 'yes', 'List of VLAN-based IPv4 networks'),
1368 ('IPV4_TREE_SHOW_VLAN','yes','string','no','no','yes','Show VLAN for each network in IPv4 tree'),
1369 ('DEFAULT_VDOM_ID','','uint','yes','no','yes','Default VLAN domain ID'),
1370 ('DEFAULT_VST_ID','','uint','yes','no','yes','Default VLAN switch template ID'),
1371 ('8021Q_DEPLOY_MINAGE','300','uint','no','no','no','802.1Q deploy minimum age'),
1372 ('8021Q_DEPLOY_MAXAGE','3600','uint','no','no','no','802.1Q deploy maximum age'),
1373 ('8021Q_DEPLOY_RETRY','10800','uint','no','no','no','802.1Q deploy retry timer'),
1374 ('8021Q_WRI_AFTER_CONFT_LISTSRC','false','string','no','no','no','802.1Q: save device configuration after deploy (RackCode)'),
1375 ('8021Q_INSTANT_DEPLOY','no','string','no','no','yes','802.1Q: instant deploy'),
1376 ('STATIC_FILTER','yes','string','no','no','yes','Enable Filter Caching'),
1377 ('ENABLE_BULKPORT_FORM','yes','string','no','no','yes','Enable "Bulk Port" form'),
1378 ('CDP_RUNNERS_LISTSRC', '', 'string', 'yes', 'no', 'no', 'List of devices running CDP'),
1379 ('LLDP_RUNNERS_LISTSRC', '', 'string', 'yes', 'no', 'no', 'List of devices running LLDP'),
1380 ('HNDP_RUNNERS_LISTSRC', '', 'string', 'yes', 'no', 'no', 'List of devices running HNDP (RackCode)'),
1381 ('SHRINK_TAG_TREE_ON_CLICK','yes','string','no','no','yes','Dynamically hide useless tags in tagtree'),
1382 ('MAX_UNFILTERED_ENTITIES','0','uint','no','no','yes','Max item count to display on unfiltered result page'),
1383 ('SYNCDOMAIN_MAX_PROCESSES','0','uint','yes','no', 'no', 'How many worker proceses syncdomain cron script should create'),
1384 ('PORT_EXCLUSION_LISTSRC','{\$typeid_3} or {\$typeid_10} or {\$typeid_11} or {\$typeid_1505} or {\$typeid_1506}','string','yes','no','no','List source: objects without ports'),
1385 ('FILTER_RACKLIST_BY_TAGS','yes','string','yes','no','yes','Rackspace: show only racks matching the current object\'s tags'),
1386 ('DB_VERSION','0.19.1','string','no','yes','no','Database version.');
1388 INSERT INTO `Script` VALUES ('RackCode','allow {\$userid_1}');
1390 INSERT INTO VLANValidID (vlan_id) VALUES