Imported Upstream version 3.2.0

This commit is contained in:
Mario Fetka
2017-05-22 11:24:21 +02:00
commit c4f4701ef1
381 changed files with 97590 additions and 0 deletions

453
install/css/install.css Normal file
View File

@@ -0,0 +1,453 @@
@charset "utf-8";
/**********************************************
/* CSS for Installation Wizard **************
/**********************************************
/*
/* NagiosQL
/*
/**********************************************
/*
/* Project : NagiosQL
/* Component: Installer CSS
/* Website : http://www.nagiosql.org
/* Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
/* Author : $LastChangedBy: martin $
/* Version : 3.1.1
/* Revision : $LastChangedRevision: 1237 $
/*
/**********************************************/
/**********************************************/
/* Body CSS
/**********************************************/
body {
background: #7fadd4 url(../images/body_background.png) repeat-x fixed left top;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
padding: 10px;
}
/**********************************************/
/* Page Common CSS
/**********************************************/
#page {
border: 5px solid #053056;
background: #FFFFFF;
}
#page_margins {
min-width: 740px;
max-width: 80em;
margin: 0 auto;
border: 0px #889 solid;
text-align:left;
}
#header, #main, #footer {
clear:both;
}
#header {
background: #FFFFFF url(../images/background.png) repeat-x left top;
position: relative;
padding: 5px;
text-align: center;
height: 120px;
}
#main {
background: #fff;
padding:10px 0;
}
#footer {
color:#666;
background: #f9f9f9;
padding: 15px;
text-align: center;
border-top: 5px #efefef solid;
}
/**********************************************/
/* Page Custom CSS
/**********************************************/
#header-logo {
background: transparent;
position: absolute;
text-align: center;
top: 30px;
left: 70px;
}
#documentation {
position:absolute;
left: 320px;
text-align:right;
top: 56px;
}
#langselector {
position:absolute;
left: 650px;
text-align:right;
top: 50px;
}
/**********************************************/
/* Step Rows
/**********************************************/
/* Installer Menu */
#installmenu {
width: 20%;
z-index: 3;
float: left;
}
#installmenu_content {
padding: 10px 10px 10px 20px;
z-index: 4;
}
.step1_active {
background: url(../images/step1_active.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.step1_active a,
.step1_active a:hover,
.step3_active a,
.step3_active a:hover,
.step2_active a,
.step2_active a:hover {
color: #FFFFFF;
}
.step1_deactive {
background: url(../images/step1_deactive.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.step2_active {
background: url(../images/step2_active.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.step2_deactive {
background: url(../images/step2_deactive.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.step3_active {
background: url(../images/step3_active.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.step3_deactive {
background: url(../images/step3_deactive.png) no-repeat;
height: 75px;
width: 150px;
color: #FFFFFF;
text-align: center;
font-weight: bold;
padding: 0px 0 0 0;
}
.textmiddle {
vertical-align:middle;
}
#installmain {
margin-left: 20%;
margin-right: 0;
z-index: 1;
}
#installmain_content {
padding: 10px 20px 10px 10px;
z-index: 2;
}
#install-next {
float: right;
text-align: center;
}
#install-back {
float: left;
text-align: center;
}
#install-center {
padding-left: 240px;
}
#install-button-index {
text-align:center;
position:relative;
}
.button-index {
overflow: auto;
width: 40%;
text-align: center;
margin: 0 auto;
padding: 0px;
}
.button-install {
float: left;
width: 100px;
padding: 5px;
width: 45%;
float: left;
}
.button-update {
float: left;
width:100px;
padding: 5px;
width: 45%;
float: right;
}
.button-skip {
width:100px;
text-align: center;
display: block;
padding: 5px;
}
/* Index */
#indexmain {
z-index: 1;
}
#indexmain_content {
padding: 0px 20px 10px 10px;
z-index: 2;
}
#installmain_content,
#installmenu_content,
#indexmain_content {
position: relative;
}
/* Hyperlinks */
A {
text-decoration: none;
font-weight: bold;
color: #0c4271;
}
A:hover {
text-decoration: underline;
font-weight: bold;
color: #0c4271;
}
/* Headlines */
h1,h2,h3 {
color: #0c4271;
}
h1 {
text-align: center;
font-size: 22px;
}
h2 {
font-size: 14px;
color: #1962a2;
}
h3 {
font-size: 14px;
font-style:italic;
}
/* Index Headlines */
.index-install {
padding: 10px 0 0 28px;
height: 25px;
background: url(../images/index-install.png) no-repeat left top;
margin: 10px 0 0 0;
}
.index-update {
padding: 10px 0 0 28px;
height: 25px;
background: url(../images/index-update.png) no-repeat left top;
}
/* Specials */
.attention {
color: #CC0000;
font-weight: bold;
}
.red {
font-weight:bold;
color:#FF0000
}
.green {
font-weight:bold;
color:#006600;
}
.yellow {
font-weight:bold;
color:#f2d409;
}
.steps {
text-align: center;
}
.clear {
overflow: hidden;
width: 100%;
}
.clearfix {
display: block;
}
#ie_clearing {
display:none;
}
.showfield {
}
.hidefield {
display:none;
}
/* Required fields validation */
input[type=text].required,input[type=password].required {
width:200px;
border: 1px solid #053056;
background: #941616 url(../images/inputmust.png);
font-family:Verdana, Helvetica, sans-serif;
color: #FFFFFF;
font-weight: bold;
font-size:12px;
height:18px;
}
input[type=text] {
width:200px;
border: 1px solid #053056;
background: #941616 url(../images/input.png);
font-family:Verdana, Helvetica, sans-serif;
color: #000000;
font-size:12px;
height:18px;
}
input[type=text].locked {
width:200px;
border: 1px solid #053056;
background: #666666 url(../images/inputlock.png);
font-family:Verdana, Helvetica, sans-serif;
color: #FFFFFF;
font-weight: bold;
font-size:12px;
height:18px;
}
input[type=submit] {
border:1px solid #6CF;
background: #d1e2fd url(../images/input.png);
font-family:Verdana, Helvetica, sans-serif;
font-size:12px;
color:#0c4271;
height:25px;
padding-left:10px;
padding-right:10px;
margin:0px;
padding-bottom:2px;
}
input[type=submit][disabled] {
border:1px solid #6CF;
background: #d1e2fd url(../images/input.png);
font-family:Verdana, Helvetica, sans-serif;
font-size:12px;
color:#999;
height:25px;
padding-left:10px;
padding-right:10px;
margin:0px;
padding-bottom:2px;
}
.validation-advice {
margin: 5px 0;
padding: 5px;
background-color: #FF3300;
color : #FFF;
font-weight: bold;
}
/* Text Styles */
.hint {
color: #666;
font-size: 0.95em;
}
/* Tooltip */
.yh_tt_div {
width: 200px;
background-color: #ffffff;
padding: 10px;
border: 1px solid #ff6600;
}
.yh_tooltip {
font-size: 11px;
font-face: arial,helvetica,sans-serif;
}
.tt_header {
position: relative;
width: 150px;
height: 19px;
background-image: url(../images/tip_header.gif);
margin-bottom: 3px;
}
.tooltip {
display: none;
}

View File

@@ -0,0 +1,48 @@
<?php
exit;
?>
;///////////////////////////////////////////////////////////////////////////////
;
; NagiosQL
;
;///////////////////////////////////////////////////////////////////////////////
;
; Project : NagiosQL
; Component: Initial configuration settings
; Website : http://www.nagiosql.org
; Date : May 27, 2011, 2:35 pm
; Version : 3.2.0
; $LastChangedRevision: 1058 $
;
; DO NOT USE THIS FILE AS NAGIOSQL SETTINGS FILE!
;
;///////////////////////////////////////////////////////////////////////////////
[db]
type = mysql
server = localhost
port = 3306
database = db_nagiosql_v32
username = nagiosql_user
password = nagiosql_pass
[path]
protocol = http
tempdir = /tmp
base_url = /
base_path = ''
[data]
locale = en_GB
encoding = utf-8
[security]
logofftime = 3600
wsauth = 0
[common]
pagelines = 15
seldisable = 1
tplcheck = 0
updcheck = 1
[network]
proxy = 0
proxyserver = ''
proxyuser = ''
proxypasswd = ''
onlineupdate = 0

View File

@@ -0,0 +1,915 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer Class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-12-08 07:35:31 +0100 (Do, 08. Dez 2011) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1141 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Class: Common install functions
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Includes all functions used by the installer
//
// Name: naginstall
//
///////////////////////////////////////////////////////////////////////////////////////////////
class naginstall {
// Define class variables
var $filTemplate = ""; // template file
///////////////////////////////////////////////////////////////////////////////////////////
// Class constructor
///////////////////////////////////////////////////////////////////////////////////////////
//
// Activities during class initialization
//
///////////////////////////////////////////////////////////////////////////////////////////
function naginstall() {
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Parse template
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: $arrTemplate Array including template replacements
// $strTplFile Template file
// $intMode Mode (0=admin user/1=NagiosQL user
//
// Return values: none
//
///////////////////////////////////////////////////////////////////////////////////////////
function parseTemplate($arrTemplate,$strTplFile) {
// Open template file
if (file_exists($strTplFile) && is_readable($strTplFile)) {
$strTemplate = "";
$datTplFile = fopen($strTplFile,'r');
while (!feof($datTplFile)) {
$strTemplate .= fgets($datTplFile);
}
foreach ($arrTemplate AS $key => $elem) {
if (substr_count($strTemplate,"{".$key."}") != 0) {
$strTemplate = str_replace("{".$key."}",$elem,$strTemplate);
}
}
return($strTemplate);
} else {
echo "File not found";
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connect to database server as administrator
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
// $intMode Mode (0=admin user/1=NagiosQL user
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function openAdmDBSrv(&$strStatusMessage,&$strErrorMessage,$intMode=0) {
if ($_SESSION['install']['dbtype'] == "mysql") {
$intStatus = 0;
// Connect to database server
if ($intMode == 1 ) {
$resDBSLink = @mysql_connect($_SESSION['install']['dbserver'].":".$_SESSION['install']['dbport'],$_SESSION['install']['dbuser'],$_SESSION['install']['dbpass']);
} else {
$resDBSLink = @mysql_connect($_SESSION['install']['dbserver'].":".$_SESSION['install']['dbport'],$_SESSION['install']['admuser'],$_SESSION['install']['admpass']);
}
if (!$resDBSLink) {
$strErrorMessage .= translate('Error while connecting to database:')."<br>".mysql_error()."<br>\n";
$intStatus = 1;
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
// Connect to database server
if ($intMode == 1 ) {
$resDBSLink = @pg_connect("host=".$_SESSION['install']['dbserver']." port=".$_SESSION['install']['dbport']." user=".$_SESSION['install']['dbuser']." password=".$_SESSION['install']['dbpass']);
} else {
$resDBSLink = @pg_connect("host=".$_SESSION['install']['dbserver']." port=".$_SESSION['install']['dbport']." user=".$_SESSION['install']['admuser']." password=".$_SESSION['install']['admpass']);
}
if (!$resDBSLink) {
$strErrorMessage .= translate('Error while connecting to database:')."<br>".pg_last_error()."<br>\n";
$intStatus = 1;
}
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($intStatus == 0) {
$strStatusMessage = "<span class=\"green\">".translate("passed")."</span>";
return(0);
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connect to database as administrator
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
// $intMode Mode (0=admin user/1=NagiosQL user
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function openDatabase(&$strStatusMessage,&$strErrorMessage,$intMode=0) {
if ($_SESSION['install']['dbtype'] == "mysql") {
$intStatus = 0;
// Connect to database
$resDBId = @mysql_select_db($_SESSION['install']['dbname']);
if (!$resDBId) {
$strErrorMessage .= translate('Error while connecting to database:')."<br>".mysql_error()."<br>\n";
$intStatus = 1;
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
// Connect to database
if ($intMode == 1 ) {
$resDBSLink = @pg_connect("host=".$_SESSION['install']['dbserver']." port=".$_SESSION['install']['dbport']." dbname=".$_SESSION['install']['dbname']." user=".$_SESSION['install']['dbuser']." password=".$_SESSION['install']['dbpass']);
} else {
$resDBSLink = @pg_connect("host=".$_SESSION['install']['dbserver']." port=".$_SESSION['install']['dbport']." dbname=".$_SESSION['install']['dbname']." user=".$_SESSION['install']['admuser']." password=".$_SESSION['install']['admpass']);
}
if (!$resDBSLink) {
$strErrorMessage .= translate('Error while connecting to database:')."<br>".pg_last_error()."<br>\n";
$intStatus = 1;
}
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($intStatus == 0) {
$strStatusMessage = "<span class=\"green\">".translate("passed")."</span>";
return(0);
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Check database version
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
// $strVersion Database version
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function checkDBVersion(&$strStatusMessage,&$strErrorMessage,&$setVersion) {
// Read version string from DB
if ($_SESSION['install']['dbtype'] == "mysql") {
$setVersion = @mysql_result(@mysql_query("SHOW VARIABLES LIKE 'version'"),0,1);
$strDBError = mysql_error();
$intVersion = version_compare($setVersion,"4.1.0");
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$setVersion = @pg_fetch_result(@pg_query("SHOW VARIABLES LIKE 'version'"),0,1);
$strDBError = pg_last_error();
$intVersion = version_compare($setVersion,"4.1.0");
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($strDBError == "") {
// Is the currrent version supported?
if ($intVersion >=0) {
$strStatusMessage = "<span class=\"green\">".translate("supported")."</span>";
return(0);
} else {
$strStatusMessage = "<span class=\"red\">".translate("not supported")."</span>";
return(1);
}
} else {
$strErrorMessage .= $strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$setVersion = "unknown";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Check NagiosQL version
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
// $arrUpdate Array including all update files
// $setVersion Current NagiosQL version string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function checkQLVersion(&$strStatusMessage,&$strErrorMessage,&$arrUpdate,&$setVersion) {
// Read version string from DB
if ($_SESSION['install']['dbtype'] == "mysql") {
$setVersion = @mysql_result(@mysql_query("SELECT `value` FROM `tbl_settings` WHERE `category`='db' AND `name`='version'"),0,0);
$strDBError = mysql_error();
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$setVersion = @pg_fetch_result(@pg_query("SELECT `value` FROM `tbl_settings` WHERE `category`='db' AND `name`='version'"),0,0);
$strDBError = pg_last_error();
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
// Process result
if (($strDBError == "") && ($setVersion != "")) {
// NagiosQL version supported?
$intVersionError = 0;
switch($setVersion) {
case '3.0.0': $arrUpdate[] = "sql/update_300_310.sql";
$arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.0.1': $arrUpdate[] = "sql/update_302_303.sql";
$arrUpdate[] = "sql/update_304_310.sql";
$arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.0.2': $arrUpdate[] = "sql/update_302_303.sql";
$arrUpdate[] = "sql/update_304_310.sql";
$arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.0.3': $arrUpdate[] = "sql/update_304_310.sql";
$arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.0.4': $arrUpdate[] = "sql/update_304_310.sql";
$arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.1.0': $arrUpdate[] = "sql/update_310_320.sql";
break;
case '3.1.1': $arrUpdate[] = "sql/update_311_320.sql";
break;
case '3.2.0': $intVersionError = 2;
break;
default: $intVersionError = 1;
break;
}
if ($intVersionError == 0) {
$strStatusMessage = "<span class=\"green\">".translate("supported")."</span> (".$setVersion.")";
return(0);
} else if ($intVersionError == 2) {
$strErrorMessage .= translate("Your NagiosQL installation is up to date - no further actions are needed!")."<br>\n";
$strStatusMessage = "<span class=\"green\">".translate("up-to-date")."</span> (".$setVersion.")";
return(1);
} else {
$strErrorMessage .= translate("Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!")."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span> (".$setVersion.")";
return(1);
}
} else {
$strErrorMessage .= translate("Error while selecting settings table.")."<br>\n";
$strErrorMessage .= $strDBError."<br>\n";
$strErrorMessage .= translate("Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!")."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Delete old NagiosQL database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function dropDB(&$strStatusMessage,&$strErrorMessage) {
// Drop database
if ($_SESSION['install']['dbtype'] == "mysql") {
$booReturn = @mysql_query("DROP DATABASE `".$_SESSION['install']['dbname']."`");
$strDBError = mysql_error();
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$setVersion = @pg_query("DROP DATABASE `".$_SESSION['install']['dbname']."`");
$strDBError = pg_last_error();
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($booReturn) {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span> (".$_SESSION['install']['dbname'].")";
return(0);
} else {
$strErrorMessage .= $strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span> (".$_SESSION['install']['dbname'].")";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Create NagiosQL database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function createDB(&$strStatusMessage,&$strErrorMessage) {
// Create database
if ($_SESSION['install']['dbtype'] == "mysql") {
$booReturn = @mysql_query("CREATE DATABASE `".$_SESSION['install']['dbname']."` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci");
$strDBError = mysql_error();
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$setVersion = @pg_query("CREATE DATABASE `".$_SESSION['install']['dbname']."` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci");
$strDBError = pg_last_error();
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($booReturn) {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span> (".$_SESSION['install']['dbname'].")";
return(0);
} else {
$strErrorMessage .= $strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span> (".$_SESSION['install']['dbname'].")";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Grant user to database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function grantDBUser(&$strStatusMessage,&$strErrorMessage) {
// Grant user
if ($_SESSION['install']['dbtype'] == "mysql") {
// does the user exist?
$intUserError = 0;
$resQuery = @mysql_query("FLUSH PRIVILEGES");
$resQuery1 = @mysql_query("SELECT * FROM `mysql`.`user` WHERE `Host`='".$_SESSION['install']['localsrv']."' AND `User`='".$_SESSION['install']['dbuser']."'");
if ($resQuery1 && (mysql_num_rows($resQuery1) == 0)) {
$resQuery2 = @mysql_query("CREATE USER '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."' IDENTIFIED BY '".$_SESSION['install']['dbpass']."'");
if (!$resQuery2) {
$intUserError = 1;
$strDBError = mysql_error();
}
} else if (mysql_error() == ""){
$intUserError = 2;
} else {
$intUserError = 1;
$strDBError = mysql_error();
}
if ($intUserError != 1) {
$resQuery = @mysql_query("FLUSH PRIVILEGES");
$resQuery = @mysql_query("GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON `".$_SESSION['install']['dbname']."`.* TO '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."'");
if (!$resQuery) {
$intUserError = 1;
$strDBError = mysql_error();
}
$resQuery = @mysql_query("FLUSH PRIVILEGES");
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
// does the user exist?
$intUserError = 0;
$resQuery = @pg_query("FLUSH PRIVILEGES");
$resQuery1 = @pg_query("SELECT * FROM `mysql`.`user WHERE `Host`='".$_SESSION['install']['localsrv']."' AND `User`='".$_SESSION['install']['dbuser']."'");
if ($resQuery1 && (pg_num_rows($resQuery) != 0)) {
$resQuery2 = @pg_query("CREATE USER '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."' IDENTIFIED BY '".$_SESSION['install']['dbpass']."'");
if (!$resQuery2) {
$intUserError = 1;
$strDBError = pg_last_error();
}
} else if (mysql_error() == ""){
$intUserError = 2;
} else {
$intUserError = 1;
$strDBError = pg_last_error();
}
if ($intUserError != 1) {
$resQuery = @pg_query("FLUSH PRIVILEGES");
$resQuery = @pg_query("GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON `".$_SESSION['install']['dbname']."`.* TO '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."'");
if (!$resQuery) {
$intUserError = 1;
$strDBError = pg_last_error();
}
$resQuery = @pg_query("FLUSH PRIVILEGES");
}
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($intUserError != 1) {
if ($intUserError == 2) {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span> (".translate("Only added rights to existing user").": ".$_SESSION['install']['dbuser'].")";
} else {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
}
return(0);
} else {
$strErrorMessage .= $strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Update NagiosQL database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
// $arrUpdate Array including all update files
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function updateQLDB(&$strStatusMessage,&$strErrorMessage,$arrUpdate) {
if (is_array($arrUpdate) && (count($arrUpdate) != 0)) {
$intUpdateOk = 0;
$intUpdateError = 0;
foreach($arrUpdate AS $elem) {
if ($intUpdateError == 0) {
if (is_readable($elem)) {
$filSqlNew = fopen($elem,"r");
if ($filSqlNew) {
$strSqlCommand = "";
$intSQLError = 0;
$intLineCount = 0;
if ($_SESSION['install']['dbtype'] == "mysql") $booReturn = @mysql_query("SET NAMES `utf8`");
if ($_SESSION['install']['dbtype'] == "pgsql") $booReturn = @pg_query("SET NAMES `utf8`");
while (!feof($filSqlNew)) {
$strLine = fgets($filSqlNew);
$strLine = trim($strLine);
if ($intSQLError == 1) continue; // skip if an error was found
$intLineCount++;
if ($strLine == "") continue; // skip empty lines
if (substr($strLine,0,2) == "--") continue; // skip comment lines
$strSqlCommand .= $strLine;
if (substr($strSqlCommand,-1) == ";") {
if ($_SESSION['install']['dbtype'] == "mysql") $booReturn = @mysql_query($strSqlCommand);
if ($_SESSION['install']['dbtype'] == "pgsql") $booReturn = @pg_query($strSqlCommand);
if (!$booReturn) {
$intSQLError = 1;
if ($_SESSION['install']['dbtype'] == "mysql") $strErrorMessage .= mysql_error()."<br>\n";
if ($_SESSION['install']['dbtype'] == "pgsql") $strErrorMessage .= pg_last_error()."<br>\n";
$intError = 1;
}
$strSqlCommand = "";
}
}
if ($intSQLError == 0) {
$intUpdateOk++;
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span> (Line: ".$intLineCount." in file: ".$elem.")";
$intUpdateError++;
}
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("SQL file is not readable or empty")." (".$elem.")<br>\n";
$intUpdateError++;
}
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("SQL file is not readable or empty")." (".$elem.")<br>\n";
$intUpdateError++;
}
}
}
if ($intUpdateError == 0) {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
return(1);
}
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("No SQL update files available")."<br>\n";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Create NagiosQL administrator
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function createNQLAdmin(&$strStatusMessage,&$strErrorMessage) {
// Create admin user
$strSQL = "SELECT `id` FROM `tbl_language` WHERE `locale`='".$_SESSION['install']['locale']."'";
$intLang = @mysql_result(@mysql_query($strSQL),0,0)+0;
if ($intLang == 0) $intLang = 1;
$strSQL = "INSERT INTO `tbl_user` (`id`, `username`, `alias`, `password`, `admin_enable`, `wsauth`, `active`, `nodelete`, `language`, `domain`, `last_login`, `last_modified`)
VALUES (1, '".$_SESSION['install']['qluser']."', 'Administrator', md5('".$_SESSION['install']['qlpass']."'), '1', '0', '1', '1', '".$intLang."', '1', '', NOW());";
if ($_SESSION['install']['dbtype'] == "mysql") {
$booReturn = @mysql_query($strSQL);
$strDBError = mysql_error();
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$setVersion = @pg_query($strSQL);
$strDBError = pg_last_error();
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($booReturn) {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
$strErrorMessage .= $strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Update settings database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function updateSettingsDB(&$strStatusMessage,&$strErrorMessage) {
// Checking initial settings
$arrInitial[] = array('category'=>'db','name'=>'version','value'=>$_SESSION['install']['version']);
$arrInitial[] = array('category'=>'db','name'=>'type','value'=>$_SESSION['install']['dbtype']);
foreach ($_SESSION['init_settings'] AS $key=>$elem) {
if ($key == 'db') continue; // do not store db values to database
foreach ($elem AS $key2=>$elem2) {
$arrInitial[] = array('category'=>$key,'name'=>$key2,'value'=>$elem2);
}
}
foreach ($arrInitial AS $elem) {
$strSQL1 = "SELECT `value` FROM `tbl_settings` WHERE `category`='".$elem['category']."' AND `name`='".$elem['name']."'";
$strSQL2 = "INSERT INTO `tbl_settings` (`category`, `name`, `value`) VALUES ('".$elem['category']."', '".$elem['name']."', '".$elem['value']."')";
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery1 = @mysql_query($strSQL1);
if ($resQuery1 && (mysql_num_rows($resQuery1) == 0)) {
$resQuery2 = @mysql_query($strSQL2);
if (!$resQuery2) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")."<br>".mysql_error()."<br>\n";
return(1);
}
} else if (!$resQuery1) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")." ".mysql_error()."<br>\n";
return(1);
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery1 = @pg_query($strSQL1);
if ($resQuery1 && (pg_num_rows($resQuery1) == 0)) {
$resQuery2 = @pg_query($strSQL2);
if (!$resQuery2) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")."<br>".pg_last_error()."<br>\n";
return(1);
}
} else if (!$resQuery1) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")." ".pg_last_error()."<br>\n";
return(1);
}
}
}
// Update some values
$arrSettings[] = array('category'=>'db','name'=>'version','value'=>$_SESSION['install']['version']);
if (substr_count($_SERVER['SERVER_PROTOCOL'],"HTTPS") != 0) {
$arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'https');
} else {
$arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'http');
}
$strBaseURL = str_replace("install/install.php","",$_SERVER["PHP_SELF"]);
$arrSettings[] = array('category'=>'path','name'=>'base_url','value'=>$strBaseURL);
$strBasePath = substr(realpath('.'),0,-7);
$arrSettings[] = array('category'=>'path','name'=>'base_path','value'=>$strBasePath);
$arrSettings[] = array('category'=>'data','name'=>'locale','value'=>$_SESSION['install']['locale']);
foreach ($arrSettings AS $elem) {
$strSQL = "UPDATE `tbl_settings` SET `value`='".$elem['value']."' WHERE `category` = '".$elem['category']."' AND `name` = '".$elem['name']."'";
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery = @mysql_query($strSQL);
if (mysql_error() != '') {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")." ".mysql_error()."<br>\n";
return(1);
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery = @pg_query($strSQL);
if (pg_last_error() != '') {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting initial data to settings database has failed:")." ".pg_last_error()."<br>\n";
return(1);
}
}
}
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Update settings file
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function updateSettingsFile(&$strStatusMessage,&$strErrorMessage) {
// open settings file
$strBaseURL = str_replace("install/install.php","",$_SERVER["PHP_SELF"]);
$strBasePath = substr(realpath('.'),0,-7);
$strE_ID = error_reporting();
error_reporting(0);
$filSettings = fopen($strBasePath."config/settings.php","w");
error_reporting($strE_ID);
if ($filSettings) {
// Write Database Configuration into settings.php
fwrite($filSettings,"<?php\n");
fwrite($filSettings,"exit;\n");
fwrite($filSettings,"?>\n");
fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n");
fwrite($filSettings,";\n");
fwrite($filSettings,"; NagiosQL\n");
fwrite($filSettings,";\n");
fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n");
fwrite($filSettings,";\n");
fwrite($filSettings,"; Project : NagiosQL\n");
fwrite($filSettings,"; Component: Database Configuration\n");
fwrite($filSettings,"; Website : http://www.nagiosql.org\n");
fwrite($filSettings,"; Date : ".date("F j, Y, g:i a")."\n");
fwrite($filSettings,"; Version : ".$_SESSION['install']['version']."\n");
fwrite($filSettings,";\n");
fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n");
fwrite($filSettings,"[db]\n");
fwrite($filSettings,"type = ".$_SESSION['install']['dbtype']."\n");
fwrite($filSettings,"server = ".$_SESSION['install']['dbserver']."\n");
fwrite($filSettings,"port = ".$_SESSION['install']['dbport']."\n");
fwrite($filSettings,"database = ".$_SESSION['install']['dbname']."\n");
fwrite($filSettings,"username = ".$_SESSION['install']['dbuser']."\n");
fwrite($filSettings,"password = ".$_SESSION['install']['dbpass']."\n");
fwrite($filSettings,"[path]\n");
fwrite($filSettings,"base_url = ".$strBaseURL."\n");
fwrite($filSettings,"base_path = ".$strBasePath."\n");
fclose($filSettings);
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Connot open/write to config/settings.php")."<br>\n";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Update settings database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function updateQLpath(&$strStatusMessage,&$strErrorMessage) {
// Update configuration target database
$strNagiosQLpath = str_replace("//","/",$_SESSION['install']['qlpath']."/");
$strNagiosPath = str_replace("//","/",$_SESSION['install']['nagpath']."/");
$strSQL = "UPDATE `tbl_configtarget` SET
`basedir`='".$strNagiosQLpath."',
`hostconfig`='".$strNagiosQLpath."hosts/',
`serviceconfig`='".$strNagiosQLpath."services/',
`backupdir`='".$strNagiosQLpath."backup/',
`hostbackup`='".$strNagiosQLpath."backup/hosts/',
`servicebackup`='".$strNagiosQLpath."backup/services/',
`nagiosbasedir`='".$strNagiosPath."',
`importdir`='".$strNagiosPath."objects/',
`conffile`='".$strNagiosPath."nagios.cfg',
`last_modified`=NOW()
WHERE `target`='localhost'";
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery1 = @mysql_query($strSQL);
if (!$resQuery1) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting path data to database has failed:")." ".mysql_error()."<br>\n";
return(1);
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery1 = @pg_query($strSQL);
if (!$resQuery1) {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("Inserting path data to database has failed:")." ".pg_last_error()."<br>\n";
return(1);
}
}
// Create real paths
if ($_SESSION['install']['createpath'] == 1) {
if (is_writable($strNagiosQLpath) && is_dir($strNagiosQLpath) && is_executable($strNagiosQLpath)) {
if (!file_exists($strNagiosQLpath."hosts")) mkdir($strNagiosQLpath."hosts",0755);
if (!file_exists($strNagiosQLpath."services")) mkdir($strNagiosQLpath."services",0755);
if (!file_exists($strNagiosQLpath."backup")) mkdir($strNagiosQLpath."backup",0755);
if (!file_exists($strNagiosQLpath."backup/hosts")) mkdir($strNagiosQLpath."backup/hosts",0755);
if (!file_exists($strNagiosQLpath."backup/services")) mkdir($strNagiosQLpath."backup/services",0755);
$strStatusMessage = "<span class=\"green\">".translate("done")."</span> (".translate("Check the permissions of the created paths!").")";
return(0);
} else {
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
$strErrorMessage .= translate("NagiosQL config path is not writeable - only database values updated")."<br>\n";
return(1);
}
}
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Converting NagiosQL database to utf-8
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function convQLDB(&$strStatusMessage,&$strErrorMessage) {
// Read version string from DB
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery = @mysql_query("ALTER DATABASE `".$_SESSION['install']['dbname']."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci");
$strDBError = mysql_error();
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery = @pg_query("ALTER DATABASE `".$_SESSION['install']['dbname']."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci");
$strDBError = pg_last_error();
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($strDBError == "") {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
$strErrorMessage .= translate("Database errors while converting to utf-8:")."<br>".$strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Converting NagiosQL database tables to utf-8
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function convQLDBTables(&$strStatusMessage,&$strErrorMessage) {
// Read version string from DB
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery = @mysql_query("SHOW TABLES FROM `".$_SESSION['install']['dbname']);
$strDBError = mysql_error();
if ($resQuery && ($strDBError == "")) {
while ($elem = mysql_fetch_row($resQuery)) {
if ($strDBError != "") continue;
$resQueryTable = @mysql_query("ALTER TABLE `".$elem[0]."` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
$strDBError .= mysql_error();
}
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery = @pg_query("SHOW TABLES FROM `".$_SESSION['install']['dbname']);
$strDBError = pg_last_error();
if ($resQuery && ($strDBError == "")) {
while ($elem = pg_fetch_row($resQuery)) {
if ($strDBError != "") continue;
$resQueryTable = @pg_query("ALTER TABLE `".$elem[0]."` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
$strDBError .= pg_last_error();
}
}
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($strDBError == "") {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
$strErrorMessage .= translate("Database errors while converting to utf-8:")."<br>".$strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Converting NagiosQL database tables to utf-8
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameter: strStatusMessage Array variable for status message
// $strErrorMessage Error string
//
// Return values: Status variable (0=ok,1=failed)
//
///////////////////////////////////////////////////////////////////////////////////////////
function convQLDBFields(&$strStatusMessage,&$strErrorMessage) {
// Read version string from DB
if ($_SESSION['install']['dbtype'] == "mysql") {
$resQuery = @mysql_query("SHOW TABLES FROM `".$_SESSION['install']['dbname']);
$strDBError = mysql_error();
if ($resQuery && ($strDBError == "")) {
while ($elem = mysql_fetch_row($resQuery)) {
if ($strDBError != "") continue;
$resQueryTable = @mysql_query("SHOW FULL FIELDS FROM `".$elem[0]."` WHERE (`Type` LIKE '%varchar%' OR `Type` LIKE '%enum%'
OR `Type` LIKE '%text%') AND Collation <> 'utf8_unicode_ci'");
$strDBError = mysql_error();
if ($resQueryTable && ($strDBError == "")) {
while ($elem2 = mysql_fetch_row($resQueryTable)) {
if ($strDBError != "") continue;
if (($elem2[5] === NULL) && ($elem2[3] == 'YES')){
$strDefault = "DEFAULT NULL";
} else if ($elem2[5] != '') {
$strDefault = "DEFAULT '".$elem2[5]."'";
} else {
$strDefault = "";
}
if ($elem2[3] == 'YES') { $strNull = 'NULL'; } else { $strNull = 'NOT NULL'; }
$strSQL = "ALTER TABLE `".$elem[0]."` CHANGE `".$elem2[0]."` `".$elem2[0]."` ".$elem2[1]." CHARACTER SET 'utf8'
COLLATE 'utf8_unicode_ci' $strNull $strDefault";
$resQueryField = @mysql_query($strSQL);
$strMySQLError = mysql_error();
if ($strMySQLError != "") {
if (substr_count($strMySQLError,"Specified key was too long") == 0) {
$strDBError .= "Table:".$elem[0]." - Field: ".$elem2[0]." ".mysql_error();
}
}
}
}
}
}
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
$resQuery = @pg_query("SHOW TABLES FROM `".$_SESSION['install']['dbname']);
$strDBError = pg_last_error();
if ($resQuery && ($strDBError == "")) {
while ($elem = pg_fetch_row($resQuery)) {
if ($strDBError != "") continue;
$resQueryTable = @pg_query("SHOW FULL FIELDS FROM `".$elem[0]."` WHERE `Type` LIKE '%varchar%' AND Collation <> 'utf8_unicode_ci'");
$strDBError = pg_last_error();
if ($resQueryTable && ($strDBError == "")) {
while ($elem2 = pg_fetch_row($resQueryTable)) {
if (($elem2[5] === NULL) && ($elem2[3] == 'YES')){
$strDefault = "DEFAULT NULL";
} else if ($elem2[5] != '') {
$strDefault = "DEFAULT '".$elem2[5]."'";
} else {
$strDefault = "";
}
if ($elem2[3] == 'YES') { $strNull = 'NULL'; } else { $strNull = 'NOT NULL'; }
$strSQL = "ALTER TABLE `".$elem[0]."` CHANGE `".$elem2[0]."` `".$elem2[0]."` ".$elem2[1]." CHARACTER SET 'utf8'
COLLATE 'utf8_unicode_ci' $strNull $strDefault";
if ($strDBError != "") continue;
$resQueryField = @pg_query($strSQL);
$strDBError .= pg_last_error();
}
}
$strDBError .= pg_last_error();
}
}
} else {
$strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
if ($strDBError == "") {
$strStatusMessage = "<span class=\"green\">".translate("done")."</span>";
return(0);
} else {
$strErrorMessage .= translate("Database errors while converting to utf-8:")."<br>".$strDBError."<br>\n";
$strStatusMessage = "<span class=\"red\">".translate("failed")."</span>";
return(1);
}
}
}
?>

View File

@@ -0,0 +1,36 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer preprocessing script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-01-04 15:40:03 +0100 (Mi, 04. Jan 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1154 $
//
///////////////////////////////////////////////////////////////////////////////
error_reporting(E_ALL);
//
// Define common variables
// =======================
$strErrorMessage = ""; // All error messages (red)
$strInfoMessage = ""; // All information messages (green)
//
// Start PHP session
// =================
session_start('nagiosql_install');
//
// Include external function/class files
// =====================================
include("functions/install_class.php");
//
// Initialize class
// ================
$myInstClass = new naginstall;
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
install/images/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

BIN
install/images/input.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

BIN
install/images/install.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
install/images/invalid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
install/images/nagiosql.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
install/images/next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

BIN
install/images/pixel.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

BIN
install/images/previous.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
install/images/reload.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
install/images/update.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
install/images/valid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
install/images/warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

194
install/index.php Normal file
View File

@@ -0,0 +1,194 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer main script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-28 18:14:54 +0100 (Tue, 28 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1261 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Define common variables
// =======================
$preContent = "templates/index.tpl.htm";
$preEncode = 'utf-8';
$preLocale = "../config/locale";
$filConfig = "../config/settings.php";
$preDBType = "mysql";
$strLangOpt = "";
$intError = 0;
$intUpdate = 0;
//
// Include preprocessing file
// ==========================
require("functions/prepend_install.php");
require("../functions/translator.php");
//
// Restart session
// ===============
session_destroy();
session_start('nagiosql_install');
//
// POST parameters
// ===============
$arrLocale = array("zh_CN","de_DE","da_DK","en_GB","fr_FR","it_IT","ja_JP","nl_NL","pl_PL","pt_BR","ru_RU","es_ES");
$chkLocale = (isset($_POST['selLanguage']) && in_array($_POST['selLanguage'],$arrLocale)) ? $_POST['selLanguage'] : "no";
//
// Language settings
// =================
if (extension_loaded('gettext')) {
if ($chkLocale == "no") {
if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2) == "de") {
$chkLocale = 'de_DE';
} else {
$chkLocale = 'en_GB';
}
}
putenv("LC_ALL=".$chkLocale.".".$preEncode);
putenv("LANG=".$chkLocale.".".$preEncode);
// GETTEXT domain
setlocale(LC_ALL, $chkLocale.".".$preEncode);
bindtextdomain($chkLocale, $preLocale);
bind_textdomain_codeset($chkLocale, $preEncode);
textdomain($chkLocale);
$arrTemplate['NAGIOS_FAQ'] = translate("Online Documentation");
// Language selection field
$arrTemplate['LANGUAGE'] = translate("Language");
foreach(getLanguageData() AS $key => $elem) {
$strLangOpt .= "<option value='".$key."' {sel}>".getLanguageNameFromCode($key,false)."</option>\n";
if ($key != $chkLocale) { $strLangOpt = str_replace(" {sel}","",$strLangOpt); } else { $strLangOpt = str_replace(" {sel}"," selected",$strLangOpt); }
}
$arrTemplate['LANG_OPTION'] = $strLangOpt;
} else {
$intError = 1;
$strErrorMessage .= "Installation cannot continue, please make sure you have the php-gettext extension loaded!";
}
//
// Checking current installation
// =============================
// Does the settings file exist?
$_SESSION['install']['dbtype'] = $preDBType;
if (file_exists($filConfig) && is_readable($filConfig)) {
$preSettings = parse_ini_file($filConfig,true);
// Are there any connection data?
if (isset($preSettings['db']) && isset($preSettings['db']['server']) && isset($preSettings['db']['port']) &&
isset($preSettings['db']['database']) && isset($preSettings['db']['username']) && isset($preSettings['db']['password'])) {
// Copy settings to session
$_SESSION['SETS'] = $preSettings;
// Existing postgres database?
if (isset($preSettings['db']['dbtype']) && ($preSettings['db']['dbtype'] == "postgres")) {
$preDBType = "pgsql";
$_SESSION['install']['dbtype'] = $preDBType;
}
if ($preDBType == "mysql") {
if (extension_loaded('mysql')) {
// Include mysql class
include("../functions/mysql_class.php");
// Initialize mysql class
$myDBClass = new mysqldb;
if ($myDBClass->error == true) {
$strErrorMessage .= translate("Database connection failed. Upgrade not available!")."<br>";
$strErrorMessage .= translate('Error while connecting to database:')."<br>".$myDBClass->strErrorMessage."<br>";
} else {
$strSQL = "SELECT `category`,`name`,`value` FROM `tbl_settings`";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount);
if ($booReturn == false) {
$strErrorMessage .= translate("Settings table not available or wrong. Upgrade not available!")."<br>";
$strErrorMessage .= translate('Error while selecting data from database:')."<br>".$myDBClass->strDBError."<br>";
} else if ($intDataCount != 0) {
foreach ($arrDataLines AS $elem) {
$preSettings[$elem['category']][$elem['name']] = $elem['value'];
}
$intUpdate = 1;
}
}
$_SESSION['install']['dbtype'] = $preDBType;
} else {
$strErrorMessage .= translate("Installation cannot continue, please make sure you have the mysql extension loaded!");
$intError = 1;
}
} else if ($preDBType == "pgsql") {
if (extension_loaded('pgsql')) {
$strErrorMessage .= translate("Installation cannot continue, postgres is not yet available in beta!");
$intError = 1;
} else {
$strErrorMessage .= translate("Installation cannot continue, please make sure you have the pgsql extension loaded!");
$intError = 1;
}
} else {
$strErrorMessage .= translate("Database type in settings file is wrong (config/settings.php). Upgrade not available!");
}
} else {
$strErrorMessage .= translate("Database values in settings file are missing (config/settings.php). Upgrade not available!");
}
} else {
$strErrorMessage .= translate("Settings file not found or not readable (config/settings.php). Upgrade not available!");
}
//
// Initial settings (new installation)
// ===================================
$filInit = "functions/initial_settings.php";
if (file_exists($filInit) && is_readable($filInit)) {
$preInit = parse_ini_file($filInit,true);
$_SESSION['init_settings'] = $preInit;
} else {
$strErrorMessage .= translate("Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!");
}
//
// Build content
// =============
$arrTemplate['PAGETITLE'] = "[NagiosQL] Installation Wizard";
$arrTemplate['MAIN_TITLE'] = translate("Welcome to the NagiosQL Installation Wizard");
$arrTemplate['TEXT_PART_1'] = translate("This wizard will help you to install and configure NagiosQL.");
$arrTemplate['TEXT_PART_2'] = translate("For questions please visit");
$arrTemplate['TEXT_PART_3'] = translate("First let's check your local environment and find out if everything NagiosQL needs is available.");
$arrTemplate['TEXT_PART_4'] = translate("The basic requirements are:");
$arrTemplate['TEXT_PART_5'] = translate("PHP 5.2.0 or greater including:");
$arrTemplate['TEXT_PHP_REQ_1'] = translate("PHP Module:")." Session";
$arrTemplate['TEXT_PHP_REQ_2'] = translate("PHP Module:")." gettext";
$arrTemplate['TEXT_PHP_REQ_3'] = translate("PHP Module:")." filter";
//$arrTemplate['TEXT_PHP_REQ_4'] = translate("PHP Module:")." XML";
//$arrTemplate['TEXT_PHP_REQ_5'] = translate("PHP Module:")." SimpleXML";
$arrTemplate['TEXT_PHP_REQ_6'] = translate("PHP Module:")." MySQL";
//$arrTemplate['TEXT_PHP_REQ_7'] = translate("PHP Module:")." PgSQL ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_8'] = translate("PHP Module:")." FTP ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_9'] = translate("PHP Module:")." curl ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_10'] = translate("PECL Extension:")." SSH ".translate("(optional)");
$arrTemplate['TEXT_PART_6'] = translate("php.ini options").":";
$arrTemplate['TEXT_INI_REQ_1'] = translate("file_uploads on (for upload features)");
$arrTemplate['TEXT_INI_REQ_2'] = translate("session.auto_start needs to be off");
$arrTemplate['TEXT_PART_7'] = translate("A MySQL database server");
$arrTemplate['TEXT_PART_8'] = translate("Nagios 2.x/3.x");
$arrTemplate['LOCALE'] = $chkLocale;
$arrTemplate['ONLINE_DOC'] = translate("Online Documentation");
//
// New installation or upgrade
// ===========================
$arrTemplate['NEW_INSTALLATION'] = translate("START INSTALLATION");
$arrTemplate['UPDATE'] = translate("START UPDATE");
$arrTemplate['DISABLE_NEW'] = "";
$arrTemplate['UPDATE_ERROR'] = "<font style=\"color:red;\">".$strErrorMessage."</font>";
if ($intUpdate == 1) {
$arrTemplate['DISABLE_UPDATE'] = "";
} else {
$arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\"";
}
if ($intError == 1) {
$arrTemplate['DISABLE_NEW'] = "disabled=\disabled\"";
$arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\"";
}
//
// Write content
// =============
$strContent = $myInstClass->parseTemplate($arrTemplate,$preContent);
echo $strContent;
?>

132
install/install.php Normal file
View File

@@ -0,0 +1,132 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - check page
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Actual database files
// =====================
$preSqlNewInstall = "sql/nagiosQL_v32_db_mysql.sql";
$preSqlUpdateLast = "sql/update_31x_320.sql";
$preNagiosQL_ver = "3.2.0";
//
// Define common variables
// =======================
$preContent = "templates/install.tpl.htm";
$preEncode = 'utf-8';
$preLocale = "../config/locale";
$intError = 0;
$chkModus = "none";
//
// Include preprocessing file
// ==========================
require("functions/prepend_install.php");
require("../functions/translator.php");
//
// Process initial value
// =====================
$strInitDBserver = isset($_SESSION['SETS']['db']['server']) ? $_SESSION['SETS']['db']['server'] : $_SESSION['init_settings']['db']['server'];
$strInitDBname = isset($_SESSION['SETS']['db']['database']) ? $_SESSION['SETS']['db']['database'] : $_SESSION['init_settings']['db']['database'];
$strInitDBuser = isset($_SESSION['SETS']['db']['username']) ? $_SESSION['SETS']['db']['username'] : $_SESSION['init_settings']['db']['username'];
$strInitDBpass = isset($_SESSION['SETS']['db']['password']) ? $_SESSION['SETS']['db']['password'] : $_SESSION['init_settings']['db']['password'];
$strInitDBport = isset($_SESSION['SETS']['db']['port']) ? $_SESSION['SETS']['db']['port'] : $_SESSION['init_settings']['db']['port'];
//
// Init session parameters
// =======================
if (!isset($_SESSION['install']['jscript'])) $_SESSION['install']['jscript'] = "no";
if (!isset($_SESSION['install']['locale'])) $_SESSION['install']['locale'] = "en_GB";
if (!isset($_SESSION['install']['dbserver'])) $_SESSION['install']['dbserver'] = $strInitDBserver;
if (!isset($_SESSION['install']['localsrv'])) $_SESSION['install']['localsrv'] = "";
if (!isset($_SESSION['install']['dbname'])) $_SESSION['install']['dbname'] = $strInitDBname;
if (!isset($_SESSION['install']['dbuser'])) $_SESSION['install']['dbuser'] = $strInitDBuser;
if (!isset($_SESSION['install']['dbpass'])) $_SESSION['install']['dbpass'] = $strInitDBpass;
if (!isset($_SESSION['install']['admuser'])) $_SESSION['install']['admuser'] = "root";
if (!isset($_SESSION['install']['admpass'])) $_SESSION['install']['admpass'] = "";
if (!isset($_SESSION['install']['qluser'])) $_SESSION['install']['qluser'] = "admin";
if (!isset($_SESSION['install']['qlpass'])) $_SESSION['install']['qlpass'] = "";
if (!isset($_SESSION['install']['dbport'])) $_SESSION['install']['dbport'] = $strInitDBport;
if (!isset($_SESSION['install']['dbdrop'])) $_SESSION['install']['dbdrop'] = 0;
if (!isset($_SESSION['install']['sample'])) $_SESSION['install']['sample'] = 0;
if (!isset($_SESSION['install']['version'])) $_SESSION['install']['version'] = $preNagiosQL_ver;
if (!isset($_SESSION['install']['createpath'])) $_SESSION['install']['createpath'] = 0;
if (!isset($_SESSION['install']['qlpath'])) $_SESSION['install']['qlpath'] = "/etc/nagiosql";
if (!isset($_SESSION['install']['nagpath'])) $_SESSION['install']['nagpath'] = "/etc/nagios";
//
// POST parameters
// ===============
$arrStep = array(1,2,3);
$chkStep = isset($_POST['hidStep']) ? $_POST['hidStep'] : "1";
if (isset($_GET['step']) && in_array($_GET['step'],$arrStep)) $chkStep = $_GET['step']+0;
if (!in_array($chkStep,$arrStep)) $arrStep = 1;
// Session values
$_SESSION['install']['locale'] = isset($_POST['hidLocale']) ? $_POST['hidLocale'] : $_SESSION['install']['locale'];
$_SESSION['install']['jscript'] = isset($_POST['hidJScript']) ? $_POST['hidJScript'] : $_SESSION['install']['jscript'];
$_SESSION['install']['dbserver'] = isset($_POST['tfDBserver']) ? $_POST['tfDBserver'] : $_SESSION['install']['dbserver'];
$_SESSION['install']['localsrv'] = isset($_POST['tfLocalSrv']) ? $_POST['tfLocalSrv'] : $_SESSION['install']['localsrv'];
$_SESSION['install']['dbname'] = isset($_POST['tfDBname']) ? $_POST['tfDBname'] : $_SESSION['install']['dbname'];
$_SESSION['install']['dbuser'] = isset($_POST['tfDBuser']) ? $_POST['tfDBuser'] : $_SESSION['install']['dbuser'];
$_SESSION['install']['dbpass'] = isset($_POST['tfDBpass']) ? $_POST['tfDBpass'] : $_SESSION['install']['dbpass'];
$_SESSION['install']['admuser'] = isset($_POST['tfDBprivUser']) ? $_POST['tfDBprivUser'] : $_SESSION['install']['admuser'];
$_SESSION['install']['admpass'] = isset($_POST['tfDBprivPass']) ? $_POST['tfDBprivPass'] : $_SESSION['install']['admpass'];
$_SESSION['install']['qluser'] = isset($_POST['tfQLuser']) ? $_POST['tfQLuser'] : $_SESSION['install']['qluser'];
$_SESSION['install']['qlpass'] = isset($_POST['tfQLpass']) ? $_POST['tfQLpass'] : $_SESSION['install']['qlpass'];
$_SESSION['install']['dbport'] = isset($_POST['tfDBport']) ? $_POST['tfDBport']+0 : $_SESSION['install']['dbport'];
$_SESSION['install']['dbdrop'] = isset($_POST['chbDrop']) ? $_POST['chbDrop']+0 : $_SESSION['install']['dbdrop'];
$_SESSION['install']['sample'] = isset($_POST['chbSample']) ? $_POST['chbSample']+0 : $_SESSION['install']['sample'];
$_SESSION['install']['createpath'] = isset($_POST['chbPath']) ? $_POST['chbPath']+0 : $_SESSION['install']['createpath'];
$_SESSION['install']['qlpath'] = isset($_POST['tfQLpath']) ? $_POST['tfQLpath'] : $_SESSION['install']['qlpath'];
$_SESSION['install']['nagpath'] = isset($_POST['tfNagiosPath']) ? $_POST['tfNagiosPath'] : $_SESSION['install']['nagpath'];
if (isset($_POST['butNewInstall'])) $chkModus = "Installation";
if (isset($_POST['butUpgrade'])) $chkModus = "Update";
if (!isset($_SESSION['install']['mode'])) $_SESSION['install']['mode'] = $chkModus;
//
// Store data to session parameters
// ================================
//
// Language settings
// =================
if (extension_loaded('gettext')) {
putenv("LC_ALL=".$_SESSION['install']['locale'].$preEncode);
putenv("LANG=".$_SESSION['install']['locale'].$preEncode);
// GETTEXT domain
setlocale(LC_ALL, $_SESSION['install']['locale'].".".$preEncode);
bindtextdomain($_SESSION['install']['locale'], $preLocale);
bind_textdomain_codeset($_SESSION['install']['locale'], $preEncode);
textdomain($_SESSION['install']['locale']);
}
//
// Content in buffer laden
// =======================
ob_start();
include "step".$chkStep.".php";
$strContent = ob_get_contents();
ob_end_clean();
//
// Build content
// =============
$arrTemplate['PAGETITLE'] = "[NagiosQL] Installation Wizard";
$arrTemplate['MAIN_TITLE'] = translate("Welcome to the NagiosQL Installation Wizard");
$arrTemplate['CONTENT'] = $strContent;
//
// Write content
// =============
$myInstClass->filTemplate = $preContent;
$strContent = $myInstClass->parseTemplate($arrTemplate,$preContent);
echo $strContent;
?>

View File

@@ -0,0 +1,224 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Import samples build from Nagios 3.0.5 configuration samples
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-24 10:22:28 +0100 (Fri, 24 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.2.0
-- Revision : $LastChangedRevision: 1248 $
-- SVN-ID : $Id: import_nagios_sample.sql 1248 2012-02-24 09:22:28Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET NAMES 'utf8';
--
--
-- Import commands
--
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, 'notify-host-by-email', '/usr/bin/printf "%b" "***** Nagios *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\nHost: $HOSTNAME$\\nState: $HOSTSTATE$\\nAddress: $HOSTADDRESS$\\nInfo: $HOSTOUTPUT$\\n\\nDate/Time: $LONGDATETIME$\\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$', 2, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(2, 'notify-service-by-email', '/usr/bin/printf "%b" "***** Nagios *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $LONGDATETIME$\\n\\nAdditional Info:\\n\\n$SERVICEOUTPUT$\\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$', 2, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(3, 'check-host-alive', '$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(4, 'check_local_disk', '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(5, 'check_local_load', '$USER1$/check_load -w $ARG1$ -c $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(6, 'check_local_procs', '$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(7, 'check_local_users', '$USER1$/check_users -w $ARG1$ -c $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(8, 'check_local_swap', '$USER1$/check_swap -w $ARG1$ -c $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(9, 'check_local_mrtgtraf', '$USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(10, 'check_ftp', '$USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', '2012-02-24 09:51:09', 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(11, 'check_hpjd', '$USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', '2012-02-24 09:51:12', 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(12, 'check_snmp', '$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(13, 'check_http', '$USER1$/check_http -I $HOSTADDRESS$ $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(14, 'check_ssh', '$USER1$/check_ssh $ARG1$ $HOSTADDRESS$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(15, 'check_dhcp', '$USER1$/check_dhcp $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(16, 'check_ping', '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(17, 'check_pop', '$USER1$/check_pop -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(18, 'check_imap', '$USER1$/check_imap -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(19, 'check_smtp', '$USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(20, 'check_tcp', '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(21, 'check_udp', '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(22, 'check_nt', '$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$', 1, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(23, 'process-host-perfdata', '/usr/bin/printf "%b" "$LASTHOSTCHECK$\\t$HOSTNAME$\\t$HOSTSTATE$\\t$HOSTATTEMPT$\\t$HOSTSTATETYPE$\\t$HOSTEXECUTIONTIME$\\t$HOSTOUTPUT$\\t$HOSTPERFDATA$\\n" >> /usr/local/nagios/var/host-perfdata.out', 2, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_command` (`id`, `command_name`, `command_line`, `command_type`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(24, 'process-service-perfdata', '/usr/bin/printf "%b" "$LASTSERVICECHECK$\\t$HOSTNAME$\\t$SERVICEDESC$\\t$SERVICESTATE$\\t$SERVICEATTEMPT$\\t$SERVICESTATETYPE$\\t$SERVICEEXECUTIONTIME$\\t$SERVICELATENCY$\\t$SERVICEOUTPUT$\\t$SERVICEPERFDATA$\\n" >> /usr/local/nagios/var/service-perfdata.out', 2, '1', '1', NOW(), 0, 1);
--
-- Import timedefinitions
--
INSERT INTO `tbl_lnkTimeperiodToTimeperiodUse` (`idMaster`, `idSlave`, `exclude`) VALUES (5, 4, 0);
--
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(28, 1, 'sunday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(27, 1, 'saturday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(26, 1, 'monday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(25, 1, 'friday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(46, 2, 'thursday', '09:00-17:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(45, 2, 'monday', '09:00-17:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(44, 2, 'friday', '09:00-17:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(41, 4, 'july 4', '00:00-00:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(40, 4, 'january 1', '00:00-00:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(39, 4, 'december 25', '00:00-00:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(35, 5, 'sunday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(34, 5, 'saturday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(33, 5, 'monday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(32, 5, 'friday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(29, 1, 'thursday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(30, 1, 'tuesday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(31, 1, 'wednesday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(36, 5, 'thursday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(37, 5, 'tuesday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(38, 5, 'wednesday', '00:00-24:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(42, 4, 'monday 1 september', '00:00-00:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(43, 4, 'thursday -1 november', '00:00-00:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(47, 2, 'tuesday', '09:00-17:00', NOW());
INSERT INTO `tbl_timedefinition` (`id`, `tipId`, `definition`, `range`, `last_modified`) VALUES(48, 2, 'wednesday', '09:00-17:00', NOW());
--
INSERT INTO `tbl_timeperiod` (`id`, `timeperiod_name`, `alias`, `exclude`, `use_template`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, '24x7', '24 Hours A Day, 7 Days A Week', 0, 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_timeperiod` (`id`, `timeperiod_name`, `alias`, `exclude`, `use_template`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(2, 'workhours', 'Normal Work Hours', 0, 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_timeperiod` (`id`, `timeperiod_name`, `alias`, `exclude`, `use_template`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(3, 'none', 'No Time Is A Good Time', 0, 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_timeperiod` (`id`, `timeperiod_name`, `alias`, `exclude`, `use_template`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(4, 'us-holidays', 'U.S. Holidays', 0, 0, 'us-holidays', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_timeperiod` (`id`, `timeperiod_name`, `alias`, `exclude`, `use_template`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(5, '24x7_sans_holidays', '24x7 Sans Holidays', 0, 1, '', '1', '1', NOW(), 0, 1);
--
-- Import contactgroup
--
INSERT INTO `tbl_contactgroup` (`id`, `contactgroup_name`, `alias`, `members`, `contactgroup_members`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, 'admins', 'Nagios Administrators', 1, 0, '1', '1', NOW(), 0, 1);
--
-- Import hostgroup
--
INSERT INTO `tbl_hostgroup` (`id`, `hostgroup_name`, `alias`, `members`, `hostgroup_members`, `notes`, `notes_url`, `action_url`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, 'windows-servers', 'Windows Servers', 1, 0, '', '', '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_hostgroup` (`id`, `hostgroup_name`, `alias`, `members`, `hostgroup_members`, `notes`, `notes_url`, `action_url`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(2, 'switches', 'Network Switches', 1, 0, '', '', '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_hostgroup` (`id`, `hostgroup_name`, `alias`, `members`, `hostgroup_members`, `notes`, `notes_url`, `action_url`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(3, 'network-printers', 'Network Printers', 1, 0, '', '', '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_hostgroup` (`id`, `hostgroup_name`, `alias`, `members`, `hostgroup_members`, `notes`, `notes_url`, `action_url`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(4, 'linux-servers', 'Linux Servers', 1, 0, '', '', '', '1', '1', NOW(), 0, 1);
--
-- Import templates
--
INSERT INTO `tbl_contacttemplate` (`id`, `template_name`, `alias`, `contactgroups`, `contactgroups_tploptions`, `host_notifications_enabled`, `service_notifications_enabled`, `host_notification_period`, `service_notification_period`, `host_notification_options`, `service_notification_options`, `host_notification_commands`, `host_notification_commands_tploptions`, `service_notification_commands`, `service_notification_commands_tploptions`, `can_submit_commands`, `retain_status_information`, `retain_nonstatus_information`, `email`, `pager`, `address1`, `address2`, `address3`, `address4`, `address5`, `address6`, `use_variables`, `use_template`, `use_template_tploptions`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES
(1, 'generic-contact', '', 0, 2, 2, 2, 1, 1, 'd,u,r,f,s', 'w,u,c,r,f,s', 1, 2, 1, 2, 2, 2, 2, '', '', '', '', '', '', '', '', 0, 0, 2, '0', '1', NOW(), 0, 1);
--
INSERT INTO `tbl_hosttemplate` (`id`, `template_name`, `alias`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, 'generic-host', '', 0, 2, 0, 2, '0', 0, 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, NULL, 0, 1, NULL, NULL, 1, '', 1, 1, 1, 0, 2, 0, 2, NULL, 1, NULL, '', 1, '', '', '', '', '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1);
INSERT INTO `tbl_hosttemplate` (`id`, `template_name`, `alias`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(2, 'linux-server', '', 0, 2, 0, 2, '3', 1, 2, '', 10, 5, 1, 2, 2, 1, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 1, 2, 120, 2, NULL, 'd,u,r', 2, '', '', '', '', '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1);
INSERT INTO `tbl_hosttemplate` (`id`, `template_name`, `alias`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(3, 'windows-server', '', 0, 2, 1, 2, '3', 1, 2, '', 10, 5, 1, 2, 2, 1, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 1, 2, 30, 1, NULL, 'd,r', 2, '', '', '', '', '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1);
INSERT INTO `tbl_hosttemplate` (`id`, `template_name`, `alias`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(4, 'generic-printer', '', 0, 2, 0, 2, '3', 1, 2, '', 10, 5, 1, 2, 2, 1, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 1, 2, 30, 2, NULL, 'd,r', 2, '', '', '', '', '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1);
INSERT INTO `tbl_hosttemplate` (`id`, `template_name`, `alias`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(5, 'generic-switch', '', 0, 2, 0, 2, '3', 1, 2, '', 10, 5, 1, 2, 2, 1, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 1, 2, 30, 1, NULL, 'd,r', 2, '', '', '', '', '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1);
--
INSERT INTO `tbl_lnkContacttemplateToCommandHost` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 1, 0);
--
INSERT INTO `tbl_lnkContacttemplateToCommandService` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 2, 0);
--
INSERT INTO `tbl_lnkHosttemplateToContactgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (2, 1, 0);
INSERT INTO `tbl_lnkHosttemplateToContactgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (3, 1, 0);
INSERT INTO `tbl_lnkHosttemplateToContactgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (4, 1, 0);
INSERT INTO `tbl_lnkHosttemplateToContactgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (5, 1, 0);
--
INSERT INTO `tbl_lnkHosttemplateToHostgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (3, 1, 0);
--
INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (2, 1, 1, 1);
INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (3, 1, 1, 1);
INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (4, 1, 1, 1);
INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (5, 1, 1, 1);
--
INSERT INTO `tbl_lnkServicetemplateToContactgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 1, 0);
--
INSERT INTO `tbl_lnkServicetemplateToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (2, 1, 1, 1);
--
INSERT INTO `tbl_servicetemplate` (`id`, `template_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(1, 'generic-service', 0, 2, 0, 2, '', '', 0, 2, 0, 2, '0', 0, '', 3, 10, 2, 1, 1, 1, 1, 1, 0, NULL, 0, 1, NULL, NULL, 1, '', 1, 1, 1, 60, NULL, 1, 'w,u,c,r', 1, 0, 2, 1, 2, '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1, '');
INSERT INTO `tbl_servicetemplate` (`id`, `template_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(2, 'local-service', 0, 2, 0, 2, '', '', 0, 2, 1, 2, '0', 2, '', 4, 5, 1, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '0', '1', NOW(), 0, 1, '');
--
-- Import contacts
--
INSERT INTO `tbl_contact` (`id`, `contact_name`, `alias`, `contactgroups`, `contactgroups_tploptions`, `host_notifications_enabled`, `service_notifications_enabled`, `host_notification_period`, `service_notification_period`, `host_notification_options`, `service_notification_options`, `host_notification_commands`, `host_notification_commands_tploptions`, `service_notification_commands`, `service_notification_commands_tploptions`, `can_submit_commands`, `retain_status_information`, `retain_nonstatus_information`, `email`, `pager`, `address1`, `address2`, `address3`, `address4`, `address5`, `address6`, `name`, `use_variables`, `use_template`, `use_template_tploptions`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES (1, 'nagiosadmin', 'Nagios Admin', 0, 2, 2, 2, 0, 0, '', '', 0, 2, 0, 2, 2, 2, 2, 'nagios@localhost', '', '', '', '', '', '', '', '', 0, 1, 2, '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_lnkContactToContacttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (1, 1, 1, 1);
INSERT INTO `tbl_lnkContactgroupToContact` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 1, 0);
--
-- Import hosts and services
--
INSERT INTO `tbl_host` (`id`, `host_name`, `alias`, `display_name`, `address`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(1, 'winserver', 'My Windows Server', '', '192.168.1.2', 0, 2, 0, 2, '0', 1, 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 0, 2, NULL, 0, NULL, '', 2, '', '', '', '', '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_host` (`id`, `host_name`, `alias`, `display_name`, `address`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(2, 'linksys-srw224p', 'Linksys SRW224P Switch', '', '192.168.1.253', 0, 2, 1, 2, '0', 1, 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 0, 2, NULL, 0, NULL, '', 2, '', '', '', '', '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_host` (`id`, `host_name`, `alias`, `display_name`, `address`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(3, 'hplj2605dn', 'HP LaserJet 2605dn', '', '192.168.1.30', 0, 2, 1, 2, '0', 1, 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 0, 2, NULL, 0, NULL, '', 2, '', '', '', '', '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1);
INSERT INTO `tbl_host` (`id`, `host_name`, `alias`, `display_name`, `address`, `parents`, `parents_tploptions`, `hostgroups`, `hostgroups_tploptions`, `check_command`, `use_template`, `use_template_tploptions`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `obsess_over_host`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `notification_interval`, `notification_period`, `first_notification_delay`, `notification_options`, `notifications_enabled`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `vrml_image`, `statusmap_image`, `2d_coords`, `3d_coords`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`) VALUES(4, 'localhost', 'localhost', '', '127.0.0.1', 0, 2, 0, 2, '0', 1, 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, 0, 2, 0, 2, NULL, 0, NULL, '', 2, '', '', '', '', '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1);
--
INSERT INTO `tbl_lnkHostToHostgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (2, 2, 0);
INSERT INTO `tbl_lnkHostToHostgroup` (`idMaster`, `idSlave`, `exclude`) VALUES (3, 3, 0);
--
INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (1, 3, 1, 1);
INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (2, 5, 1, 1);
INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (3, 4, 1, 1);
INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (4, 2, 1, 1);
--
INSERT INTO `tbl_lnkHostgroupToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (4, 4, 0);
INSERT INTO `tbl_lnkHostgroupToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (3, 3, 0);
INSERT INTO `tbl_lnkHostgroupToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (2, 2, 0);
INSERT INTO `tbl_lnkHostgroupToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 1, 0);
--
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (6, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (2, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (1, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (4, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (7, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (3, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (5, 1, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (9, 2, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (10, 2, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (11, 2, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (8, 2, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (12, 3, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (13, 3, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (17, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (19, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (20, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (15, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (14, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (21, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (16, 4, 0);
INSERT INTO `tbl_lnkServiceToHost` (`idMaster`, `idSlave`, `exclude`) VALUES (18, 4, 0);
--
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (1, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (2, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (3, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (4, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (5, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (6, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (7, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (8, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (9, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (10, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (11, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (12, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (13, 1, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (14, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (15, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (16, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (17, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (18, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (19, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (20, 2, 1, 1);
INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`, `idSlave`, `idSort`, `idTable`) VALUES (21, 2, 1, 1);
--
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(1, 'winserver', 1, 2, 0, 2, 'NSClient++ Version', '', 0, 2, 1, 2, '22!CLIENTVERSION', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'b7d611fe304406a192ea422e9fec890cd4a627da');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(2, 'winserver', 1, 2, 0, 2, 'Uptime', '', 0, 2, 1, 2, '22!UPTIME', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '3e14f6480f98aa306d6dc3476ad07cabb084d944');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(3, 'winserver', 1, 2, 0, 2, 'CPU Load', '', 0, 2, 1, 2, '22!CPULOAD!-l 5,80,90', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'cdbd954fc0f8816eed6aadeac4f73d0e162130fb');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(4, 'winserver', 1, 2, 0, 2, 'Memory Usage', '', 0, 2, 1, 2, '22!MEMUSE!-w 80 -c 90', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '20f5bcc56c0e0d2452d2e4b39e1d8600fcada046');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(5, 'winserver', 1, 2, 0, 2, 'C:\\ Drive Space', '', 0, 2, 1, 2, '22!USEDDISKSPACE!-l c -w 80 -c 90', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '51e82cb4027dfcd430039370538acc955d028e6f');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(6, 'winserver', 1, 2, 0, 2, 'W3SVC', '', 0, 2, 1, 2, '22!SERVICESTATE!-d SHOWALL -l W3SVC', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'ca8c3def8eb134790b665ea56d57ebc31c1201d4');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(7, 'winserver', 1, 2, 0, 2, 'Explorer', '', 0, 2, 1, 2, '22!PROCSTATE!-d SHOWALL -l Explorer.exe', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '90a2eeeeb2b99a2903d2c289bed9779eb4fcc494');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(8, 'linksys-srw224p', 1, 2, 0, 2, 'PING', '', 0, 2, 1, 2, '16!200.0,20%!600.0,60%', 2, '', NULL, 5, 1, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'fb722832723f2513617115ee984a079b22f19f13');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(9, 'linksys-srw224p', 1, 2, 0, 2, 'Uptime', '', 0, 2, 1, 2, '12!-C public -o sysUpTime.0', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '9b4de38cda53e1fe5f308bb4fcf9cd2516f3c2de');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(10, 'linksys-srw224p', 1, 2, 0, 2, 'Port 1 Link Status', '', 0, 2, 1, 2, '12!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '8fa5057d0b83c1266cd594aed0b695f1a1e95f5a');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(11, 'linksys-srw224p', 1, 2, 0, 2, 'Port 1 Bandwidth Usage', '', 0, 2, 1, 2, '9!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '9defa942c3ab6c423ccec9ef249468e7598156cb');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(12, 'hplj2605dn', 1, 2, 0, 2, 'Printer Status', '', 0, 2, 1, 2, '11!-C public', 2, '', NULL, 10, 1, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '9cfea4eb4454bbf15dd4728fa1e225e88c18f9a8');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(13, 'hplj2605dn', 1, 2, 0, 2, 'PING', '', 0, 2, 1, 2, '16!3000.0,80%!5000.0,100%', 2, '', NULL, 10, 1, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'a7144cdfbc4a82acf24a933e5b3f2cd3d11e00c9');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(14, 'localhost', 1, 2, 0, 2, 'PING', '', 0, 2, 1, 2, '16!100.0,20%!500.0,60%', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '371481bf6b0d725f572e4d97bd4e9554517ff7c7');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(15, 'localhost', 1, 2, 0, 2, 'Root Partition', '', 0, 2, 1, 2, '4!20%!10%!/', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '18a4fc9848cdec454e33ee61c0d56b7f6e2f2171');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(16, 'localhost', 1, 2, 0, 2, 'Current Users', '', 0, 2, 1, 2, '7!20!50', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '062fbd69060679aa6152d4152dc66a7123a7f4dc');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(17, 'localhost', 1, 2, 0, 2, 'Total Processes', '', 0, 2, 1, 2, '6!250!400!RSZDT', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'fc250fa70d17061759af179d1852fc892f99a86f');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(18, 'localhost', 1, 2, 0, 2, 'Current Load', '', 0, 2, 1, 2, '5!5.0,4.0,3.0!10.0,6.0,4.0', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, 'e327d173d7603018ef475966991f33f684789958');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(19, 'localhost', 1, 2, 0, 2, 'Swap Usage', '', 0, 2, 1, 2, '8!20!10', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 2, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '2f4ac3091f19d55e0ee53364eb6eefbe36f1bba8');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(20, 'localhost', 1, 2, 0, 2, 'SSH', '', 0, 2, 1, 2, '14', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 0, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '6722b40f8c9f4ac61890d28b5d09a2445962c552');
INSERT INTO `tbl_service` (`id`, `config_name`, `host_name`, `host_name_tploptions`, `hostgroup_name`, `hostgroup_name_tploptions`, `service_description`, `display_name`, `servicegroups`, `servicegroups_tploptions`, `use_template`, `use_template_tploptions`, `check_command`, `is_volatile`, `initial_state`, `max_check_attempts`, `check_interval`, `retry_interval`, `active_checks_enabled`, `passive_checks_enabled`, `check_period`, `parallelize_check`, `obsess_over_service`, `check_freshness`, `freshness_threshold`, `event_handler`, `event_handler_enabled`, `low_flap_threshold`, `high_flap_threshold`, `flap_detection_enabled`, `flap_detection_options`, `process_perf_data`, `retain_status_information`, `retain_nonstatus_information`, `notification_interval`, `first_notification_delay`, `notification_period`, `notification_options`, `notifications_enabled`, `contacts`, `contacts_tploptions`, `contact_groups`, `contact_groups_tploptions`, `stalking_options`, `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt`, `use_variables`, `name`, `register`, `active`, `last_modified`, `access_group`, `config_id`, `import_hash`) VALUES(21, 'localhost', 1, 2, 0, 2, 'HTTP', '', 0, 2, 1, 2, '13', 2, '', NULL, NULL, NULL, 2, 2, 0, 2, 2, 2, NULL, 0, 2, NULL, NULL, 2, '', 2, 2, 2, NULL, NULL, 0, '', 0, 0, 2, 0, 2, '', '', '', '', '', '', 0, '', '1', '1', NOW(), 0, 1, '4bb45772cf3540dc6d72b91ed38716689354b29a');

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- (c) 2008, 2009 by Martin Willisegger
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.0 to NagiosQL 3.0.1
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.0.2
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_300_301.sql 1237 2012-02-23 06:49:34Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.0.1' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
--
-- Modify existing tbl_logbook
--
ALTER TABLE `tbl_logbook` ADD `domain` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `ipadress`;
ALTER TABLE `tbl_logbook` CHANGE `entry` `entry` TINYTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;

View File

@@ -0,0 +1,554 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-27 07:58:18 +0100 (Mon, 27 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1255 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Update from 3.0.0 to 3.0.1
--
-- Modify existing tbl_logbook
--
ALTER TABLE `tbl_logbook` CHANGE `entry` `entry` TINYTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
--
-- Update from 3.0.1 to 3.0.4
--
ALTER TABLE `tbl_settings` CHANGE `value` `value` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
--
-- Modify existing tbl_lnkServicegroupToService
--
ALTER TABLE `tbl_lnkServicegroupToService` DROP PRIMARY KEY, ADD PRIMARY KEY ( `idMaster` , `idSlaveH` , `idSlaveHG`, `idSlaveS` );
--
-- Modify existing tbl_serviceextinfo
--
ALTER TABLE `tbl_serviceextinfo` CHANGE `host_name` `host_name` INT( 11 ) NULL DEFAULT '0';
--
-- Replace access_rights by access_group
--
ALTER TABLE `tbl_domain` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contactgroup` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contact` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_command` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contacttemplate` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_host` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostdependency` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostescalation` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostextinfo` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostgroup` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hosttemplate` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_service` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicedependency` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_serviceescalation` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_serviceextinfo` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicegroup` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicetemplate` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_timeperiod` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_submenu` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
--
-- Replace last_modified field type from TIMESTAMP to DATETIME
--
ALTER TABLE `tbl_domain` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contactgroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_command` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_host` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostextinfo` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_service` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicegroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_timedefinition` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_user` CHANGE `last_login` `last_login` DATETIME NOT NULL;
ALTER TABLE `tbl_user` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_variabledefinition` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
--
-- Add new import_hash field for all tables without key
--
ALTER TABLE `tbl_hostdependency` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_hostescalation` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_service` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_servicedependency` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_serviceescalation` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_serviceextinfo` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_servicetemplate` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
--
-- Add exclude field in link tables
--
ALTER TABLE `tbl_lnkContactgroupToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactgroupToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToCommandHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToCommandService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToCommandHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToCommandService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHostgroup_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHostgroup_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHost_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHost_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostgroupToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostgroupToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHostgroup_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHostgroup_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHost_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHost_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToService_DS` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToService_S` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicegroupToService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicegroupToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkTimeperiodToTimeperiod` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
--
-- Add slave string field for link tables
--
ALTER TABLE `tbl_lnkServicedependencyToService_DS` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
ALTER TABLE `tbl_lnkServicedependencyToService_S` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
ALTER TABLE `tbl_lnkServiceescalationToService` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
--
-- Reset permissions for submenus
--
UPDATE `tbl_submenu` SET `access_group` = '0';
--
-- Extent submenu for configuration cleaner and group administration
--
INSERT INTO `tbl_submenu` (`id` ,`id_main` ,`order_id` ,`item` ,`link` ,`access_group`) VALUES (NULL , '7', '3', 'Group admin', 'admin/group.php', '0');
INSERT INTO `tbl_submenu` (`id` ,`id_main` ,`order_id` ,`item` ,`link` ,`access_group`) VALUES (NULL , '6', '3', 'Delete config files', 'admin/delconfig.php', '0');
UPDATE `tbl_submenu` SET `item` = 'Delete backup files' WHERE `link` = 'admin/delbackup.php';
UPDATE `tbl_submenu` SET `item` = 'Extended Host' WHERE `link` = 'admin/hostextinfo.php';
UPDATE `tbl_submenu` SET `item` = 'Extended Service' WHERE `link` = 'admin/serviceextinfo.php';
UPDATE `tbl_submenu` SET `item` = 'Service dependency' WHERE `link` = 'admin/servicedependencies.php';
UPDATE `tbl_submenu` SET `item` = 'Service escalation' WHERE `link` = 'admin/serviceescalations.php';
--
-- Reorder submenu
--
UPDATE `tbl_submenu` SET `order_id` = '4' WHERE `tbl_submenu`.`id` =24;
UPDATE `tbl_submenu` SET `order_id` = '5' WHERE `tbl_submenu`.`id` =25;
UPDATE `tbl_submenu` SET `order_id` = '6' WHERE `tbl_submenu`.`id` =21;
UPDATE `tbl_submenu` SET `order_id` = '7' WHERE `tbl_submenu`.`id` =29;
UPDATE `tbl_submenu` SET `order_id` = '8' WHERE `tbl_submenu`.`id` =30;
UPDATE `tbl_submenu` SET `order_id` = '5' WHERE `tbl_submenu`.`id` =23;
UPDATE `tbl_submenu` SET `order_id` = '4' WHERE `tbl_submenu`.`id` =22;
UPDATE `tbl_submenu` SET `order_id` = '6' WHERE `tbl_submenu`.`id` =19;
--
-- Create new table tbl_group
--
CREATE TABLE IF NOT EXISTS `tbl_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`groupname` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`users` tinyint(3) unsigned NOT NULL DEFAULT '0',
`active` enum('0','1') NOT NULL,
`last_modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Create new table tbl_lnkGroupToUser
--
CREATE TABLE IF NOT EXISTS `tbl_lnkGroupToUser` (
`idMaster` int(10) unsigned NOT NULL,
`idSlave` int(10) unsigned NOT NULL,
`read` enum('0','1') NOT NULL DEFAULT '1',
`write` enum('0','1') NOT NULL DEFAULT '1',
`link` enum('0','1') NOT NULL DEFAULT '1',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Create new table tbl_lnkTimeperiodToTimeperiodUse
--
CREATE TABLE IF NOT EXISTS `tbl_lnkTimeperiodToTimeperiodUse` (
`idMaster` int( 11 ) NOT NULL ,
`idSlave` int( 11 ) NOT NULL ,
`exclude` tinyint( 3 ) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( `idMaster` , `idSlave` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Modify existing tbl_domain
--
ALTER TABLE `tbl_domain` ADD `ssh_key_path` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `password`;
ALTER TABLE `tbl_domain` ADD `conffile` VARCHAR( 255 ) NOT NULL DEFAULT '/mypath/nagios.cfg' AFTER `pidfile`;
ALTER TABLE `tbl_domain` ADD `picturedir` VARCHAR( 255 ) NULL AFTER `importdir`;
ALTER TABLE `tbl_domain` ADD `enable_common` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `version`;
ALTER TABLE `tbl_domain` ADD `utf8_decode` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `enable_common`;
INSERT INTO `tbl_domain` (`id`, `domain`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(0, 'common', 'administrative global domain', '', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 3, 0, '1', '1', NOW());
UPDATE `tbl_domain` SET `id` = '0' WHERE `tbl_domain`.`domain` ='common';
--
-- Modify existing tbl_timeperiod
--
ALTER TABLE `tbl_timeperiod` ADD `use_template` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `exclude`;
--
-- Modify existing tbl_user
--
ALTER TABLE `tbl_user` ADD `admin_enable` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `access_rights`;
UPDATE `tbl_user` SET `admin_enable` = '1' WHERE `tbl_user`.`id` =1;
--
-- Create new tbl_tablestatus
--
CREATE TABLE `tbl_tablestatus` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`tableName` VARCHAR( 255 ) NOT NULL ,
`domainId` INT NOT NULL ,
`updateTime` DATETIME NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;
--
-- Create new tbl_relationinformation
--
CREATE TABLE IF NOT EXISTS `tbl_relationinformation` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`master` varchar(255) NOT NULL,
`tableName1` varchar(255) NOT NULL,
`tableName2` varchar(255) NOT NULL,
`fieldName` varchar(255) NOT NULL,
`linkTable` varchar(255) NOT NULL,
`target1` varchar(255) NOT NULL,
`target2` varchar(255) NOT NULL,
`targetKey` varchar(255) NOT NULL,
`fullRelation` tinyint(3) unsigned NOT NULL DEFAULT '0',
`flags` varchar(255) NOT NULL,
`type` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=234 ;
--
-- Initialize tbl_relationinformation
--
INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES
(1, 'tbl_timeperiod', 'tbl_timeperiod', '', 'exclude', 'tbl_lnkTimeperiodToTimeperiod', 'timeperiod_name', '', '', 0, '', 2),
(2, 'tbl_contact', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContactToCommandHost', 'command_name', '', '', 0, '', 2),
(3, 'tbl_contact', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContactToCommandService', 'command_name', '', '', 0, '', 2),
(4, 'tbl_contact', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContactToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(5, 'tbl_contact', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(6, 'tbl_contact', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(7, 'tbl_contact', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContactToContacttemplate', 'template_name', 'name', '', 0, '', 3),
(8, 'tbl_contact', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContactToVariabledefinition', 'name', '', '', 0, '', 4),
(9, 'tbl_contacttemplate', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContacttemplateToCommandHost', 'command_name', '', '', 0, '', 2),
(10, 'tbl_contacttemplate', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContacttemplateToCommandService', 'command_name', '', '', 0, '', 2),
(11, 'tbl_contacttemplate', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContacttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(12, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(13, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(14, 'tbl_contacttemplate', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContacttemplateToContacttemplate', 'template_name', 'name', '', 0, '', 3),
(15, 'tbl_contacttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContacttemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(16, 'tbl_contactgroup', 'tbl_contact', '', 'members', 'tbl_lnkContactgroupToContact', 'contact_name', '', '', 0, '', 2),
(17, 'tbl_contactgroup', 'tbl_contactgroup', '', 'contactgroup_members', 'tbl_lnkContactgroupToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(18, 'tbl_hosttemplate', 'tbl_host', '', 'parents', 'tbl_lnkHosttemplateToHost', 'host_name', '', '', 0, '', 2),
(19, 'tbl_hosttemplate', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHosttemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(20, 'tbl_hosttemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHosttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(21, 'tbl_hosttemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkHosttemplateToContact', 'contact_name', '', '', 0, '', 2),
(22, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(23, 'tbl_hosttemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(24, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(25, 'tbl_hosttemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(26, 'tbl_hosttemplate', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHosttemplateToHosttemplate', 'template_name', 'name', '', 0, '', 3),
(27, 'tbl_hosttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHosttemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(28, 'tbl_host', 'tbl_host', '', 'parents', 'tbl_lnkHostToHost', 'host_name', '', '', 0, '', 2),
(29, 'tbl_host', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHostToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(30, 'tbl_host', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(31, 'tbl_host', 'tbl_contact', '', 'contacts', 'tbl_lnkHostToContact', 'contact_name', '', '', 0, '', 2),
(32, 'tbl_host', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(33, 'tbl_host', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(34, 'tbl_host', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(35, 'tbl_host', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(36, 'tbl_host', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHostToHosttemplate', 'template_name', 'name', '', 0, '', 3),
(37, 'tbl_host', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHostToVariabledefinition', 'name', '', '', 0, '', 4),
(38, 'tbl_hostgroup', 'tbl_host', '', 'members', 'tbl_lnkHostgroupToHost', 'host_name', '', '', 0, '', 2),
(39, 'tbl_hostgroup', 'tbl_hostgroup', '', 'hostgroup_members', 'tbl_lnkHostgroupToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(40, 'tbl_servicetemplate', 'tbl_host', '', 'host_name', 'tbl_lnkServicetemplateToHost', 'host_name', '', '', 0, '', 2),
(41, 'tbl_servicetemplate', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicetemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(42, 'tbl_servicetemplate', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServicetemplateToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(43, 'tbl_servicetemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServicetemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(44, 'tbl_servicetemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkServicetemplateToContact', 'contact_name', '', '', 0, '', 2),
(45, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(46, 'tbl_servicetemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(47, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(48, 'tbl_servicetemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(49, 'tbl_servicetemplate', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServicetemplateToServicetemplate', 'template_name', 'name', '', 0, '', 3),
(50, 'tbl_servicetemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServicetemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(51, 'tbl_service', 'tbl_host', '', 'host_name', 'tbl_lnkServiceToHost', 'host_name', '', '', 0, '', 2),
(52, 'tbl_service', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(53, 'tbl_service', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServiceToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(54, 'tbl_service', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(55, 'tbl_service', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceToContact', 'contact_name', '', '', 0, '', 2),
(56, 'tbl_service', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(57, 'tbl_service', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(58, 'tbl_service', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(59, 'tbl_service', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(60, 'tbl_service', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServiceToServicetemplate', 'template_name', 'name', '', 0, '', 3),
(61, 'tbl_service', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServiceToVariabledefinition', 'name', '', '', 0, '', 4),
(62, 'tbl_servicegroup', 'tbl_host', 'tbl_service', 'members', 'tbl_lnkServicegroupToService', 'host_name', 'service_description', '', 0, '', 5),
(63, 'tbl_servicegroup', 'tbl_servicegroup', '', 'servicegroup_members', 'tbl_lnkServicegroupToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(64, 'tbl_hostdependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkHostdependencyToHost_DH', 'host_name', '', '', 0, '', 2),
(65, 'tbl_hostdependency', 'tbl_host', '', 'host_name', 'tbl_lnkHostdependencyToHost_H', 'host_name', '', '', 0, '', 2),
(66, 'tbl_hostdependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2),
(67, 'tbl_hostdependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2),
(68, 'tbl_hostdependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1),
(69, 'tbl_hostescalation', 'tbl_host', '', 'host_name', 'tbl_lnkHostescalationToHost', 'host_name', '', '', 0, '', 2),
(70, 'tbl_hostescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(71, 'tbl_hostescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkHostescalationToContact', 'contact_name', '', '', 0, '', 2),
(72, 'tbl_hostescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(73, 'tbl_hostescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1),
(74, 'tbl_hostextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1),
(75, 'tbl_servicedependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkServicedependencyToHost_DH', 'host_name', '', '', 0, '', 2),
(76, 'tbl_servicedependency', 'tbl_host', '', 'host_name', 'tbl_lnkServicedependencyToHost_H', 'host_name', '', '', 0, '', 2),
(77, 'tbl_servicedependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2),
(78, 'tbl_servicedependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2),
(79, 'tbl_servicedependency', 'tbl_service', '', 'dependent_service_description', 'tbl_lnkServicedependencyToService_DS', 'service_description', '', '', 0, '', 6),
(80, 'tbl_servicedependency', 'tbl_service', '', 'service_description', 'tbl_lnkServicedependencyToService_S', 'service_description', '', '', 0, '', 6),
(81, 'tbl_servicedependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1),
(82, 'tbl_serviceescalation', 'tbl_host', '', 'host_name', 'tbl_lnkServiceescalationToHost', 'host_name', '', '', 0, '', 2),
(83, 'tbl_serviceescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(84, 'tbl_serviceescalation', 'tbl_service', '', 'service_description', 'tbl_lnkServiceescalationToService', 'service_description', '', '', 0, '', 6),
(85, 'tbl_serviceescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceescalationToContact', 'contact_name', '', '', 0, '', 2),
(86, 'tbl_serviceescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(87, 'tbl_serviceescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1),
(88, 'tbl_serviceextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1),
(89, 'tbl_serviceextinfo', 'tbl_service', '', 'service_description', '', 'service_description', '', '', 0, '', 1),
(90, 'tbl_command', 'tbl_lnkContacttemplateToCommandHost', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(91, 'tbl_command', 'tbl_lnkContacttemplateToCommandService', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(92, 'tbl_command', 'tbl_lnkContactToCommandHost', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0),
(93, 'tbl_command', 'tbl_lnkContactToCommandService', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0),
(94, 'tbl_command', 'tbl_host', '', 'check_command', '', '', '', 'host_name', 1, '0,2,2,0', 0),
(95, 'tbl_command', 'tbl_host', '', 'event_handler', '', '', '', 'host_name', 1, '0,2,2,0', 0),
(96, 'tbl_command', 'tbl_service', '', 'check_command', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0),
(97, 'tbl_command', 'tbl_service', '', 'event_handler', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0),
(98, 'tbl_contact', 'tbl_lnkContactgroupToContact', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '1,2,0,1', 0),
(99, 'tbl_contact', 'tbl_lnkContactToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(100, 'tbl_contact', 'tbl_lnkContactToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(101, 'tbl_contact', 'tbl_lnkContactToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(102, 'tbl_contact', 'tbl_lnkContactToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(103, 'tbl_contact', 'tbl_lnkContactToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(104, 'tbl_contact', 'tbl_lnkHostescalationToContact', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(105, 'tbl_contact', 'tbl_lnkHosttemplateToContact', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(106, 'tbl_contact', 'tbl_lnkHostToContact', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0),
(107, 'tbl_contact', 'tbl_lnkServiceescalationToContact', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(108, 'tbl_contact', 'tbl_lnkServicetemplateToContact', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(109, 'tbl_contact', 'tbl_lnkServiceToContact', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(110, 'tbl_contactgroup', 'tbl_lnkContactgroupToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(111, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(112, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(113, 'tbl_contactgroup', 'tbl_lnkContacttemplateToContactgroup', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(114, 'tbl_contactgroup', 'tbl_lnkContactToContactgroup', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(115, 'tbl_contactgroup', 'tbl_lnkHostescalationToContactgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(116, 'tbl_contactgroup', 'tbl_lnkHosttemplateToContactgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(117, 'tbl_contactgroup', 'tbl_lnkHostToContactgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0),
(118, 'tbl_contactgroup', 'tbl_lnkServiceescalationToContactgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(119, 'tbl_contactgroup', 'tbl_lnkServicetemplateToContactgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(120, 'tbl_contactgroup', 'tbl_lnkServiceToContactgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(121, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(122, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(123, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(124, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(125, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(126, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(127, 'tbl_contacttemplate', 'tbl_lnkContactToContacttemplate', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(128, 'tbl_host', 'tbl_lnkHostdependencyToHost_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0),
(129, 'tbl_host', 'tbl_lnkHostdependencyToHost_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0),
(130, 'tbl_host', 'tbl_lnkHostescalationToHost', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(131, 'tbl_host', 'tbl_lnkHosttemplateToHost', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(132, 'tbl_host', 'tbl_lnkHostToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(133, 'tbl_host', 'tbl_lnkHostToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(134, 'tbl_host', 'tbl_lnkHostToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(135, 'tbl_host', 'tbl_lnkHostToHost', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(136, 'tbl_host', 'tbl_lnkHostToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(137, 'tbl_host', 'tbl_lnkHostgroupToHost', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(138, 'tbl_host', 'tbl_lnkHostToHosttemplate', '', 'idMaster', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(139, 'tbl_host', 'tbl_lnkHostToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(140, 'tbl_host', 'tbl_lnkServicedependencyToHost_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(141, 'tbl_host', 'tbl_lnkServicedependencyToHost_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(142, 'tbl_host', 'tbl_lnkServiceescalationToHost', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(143, 'tbl_host', 'tbl_lnkServicetemplateToHost', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(144, 'tbl_host', 'tbl_lnkServiceToHost', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(145, 'tbl_host', 'tbl_lnkServicegroupToService', '', 'idSlaveH', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(146, 'tbl_host', 'tbl_hostextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(147, 'tbl_host', 'tbl_serviceextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(148, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(149, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(150, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(151, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(152, 'tbl_hostescalation', 'tbl_lnkHostescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(153, 'tbl_hostescalation', 'tbl_lnkHostescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(154, 'tbl_hostescalation', 'tbl_lnkHostescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(155, 'tbl_hostescalation', 'tbl_lnkHostescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(156, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0),
(157, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0),
(158, 'tbl_hostgroup', 'tbl_lnkHostescalationToHostgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '0,0,0,1', 0),
(159, 'tbl_hostgroup', 'tbl_lnkHostgroupToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(160, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(161, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(162, 'tbl_hostgroup', 'tbl_lnkHosttemplateToHostgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(163, 'tbl_hostgroup', 'tbl_lnkHostToHostgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(164, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0),
(165, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0),
(166, 'tbl_hostgroup', 'tbl_lnkServiceescalationToHostgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '0,0,0,1', 0),
(167, 'tbl_hostgroup', 'tbl_lnkServicetemplateToHostgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(168, 'tbl_hostgroup', 'tbl_lnkServiceToHostgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(169, 'tbl_hostgroup', 'tbl_lnkServicegroupToService', '', 'idSlaveHG', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(170, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(171, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(172, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(173, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(174, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(175, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(176, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(177, 'tbl_hosttemplate', 'tbl_lnkHostToHosttemplate', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(178, 'tbl_service', 'tbl_lnkServicedependencyToService_DS', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(179, 'tbl_service', 'tbl_lnkServicedependencyToService_S', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(180, 'tbl_service', 'tbl_lnkServiceescalationToService', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(181, 'tbl_service', 'tbl_lnkServicegroupToService', '', 'idSlaveS', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(182, 'tbl_service', 'tbl_lnkServiceToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(183, 'tbl_service', 'tbl_lnkServiceToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(184, 'tbl_service', 'tbl_lnkServiceToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(185, 'tbl_service', 'tbl_lnkServiceToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(186, 'tbl_service', 'tbl_lnkServiceToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(187, 'tbl_service', 'tbl_lnkServiceToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(188, 'tbl_service', 'tbl_lnkServiceToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(189, 'tbl_service', 'tbl_serviceextinfo', '', 'service_description', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(190, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(191, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(192, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(193, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(194, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_DS', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(195, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_S', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(196, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(197, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(198, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(199, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(200, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(201, 'tbl_servicegroup', 'tbl_lnkServicegroupToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(202, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(203, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idSlave', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(204, 'tbl_servicegroup', 'tbl_lnkServicetemplateToServicegroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(205, 'tbl_servicegroup', 'tbl_lnkServiceToServicegroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(206, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(207, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(208, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(209, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(210, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(211, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(212, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(213, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(214, 'tbl_servicetemplate', 'tbl_lnkServiceToServicetemplate', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(215, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(216, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(217, 'tbl_timeperiod', 'tbl_contact', '', 'host_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0),
(218, 'tbl_timeperiod', 'tbl_contact', '', 'service_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0),
(219, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'host_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(220, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'service_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(221, 'tbl_timeperiod', 'tbl_host', '', 'check_period', '', '', '', 'host_name', 1, '1,1,2,0', 0),
(222, 'tbl_timeperiod', 'tbl_host', '', 'notification_period', '', '', '', 'host_name', 1, '1,1,2,0', 0),
(223, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(224, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(225, 'tbl_timeperiod', 'tbl_hostdependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(226, 'tbl_timeperiod', 'tbl_hostescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(227, 'tbl_timeperiod', 'tbl_service', '', 'check_period', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0),
(228, 'tbl_timeperiod', 'tbl_service', '', 'notification_period', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0),
(229, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(230, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'notification_period', '', '', '', 'template_name', 1, '1,1,2,0', 0),
(231, 'tbl_timeperiod', 'tbl_servicedependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(232, 'tbl_timeperiod', 'tbl_serviceescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(233, 'tbl_timeperiod', 'tbl_timedefinition', '', 'tipId', '', '', '', 'id', 1, '0,0,0,3', 0),
(234, 'tbl_timeperiod', 'tbl_timeperiod', '', 'use_template', 'tbl_lnkTimeperiodToTimeperiodUse', 'timeperiod_name', '', '', 0, '', 2),
(235, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(236, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0);
--
-- Modify existing tbl_info
--
UPDATE `tbl_info` SET `infotext`='<p><strong>User - webserver authentication</strong></p>\r\n<p>If your webserver uses authentication and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentication.</p>' WHERE `id`=10;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>timeperiod name</strong></p>\r\n<p>This directives is the short name used to identify the time period.</p>\r\n<p><em>Parameter name:</em> timeperiod_name<br> <em>Required:</em> yes</p>' WHERE `id`=152;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>exclude</strong></p>\r\n<p>This directive is used to specify the short names of other timeperiod definitions whose time ranges should be excluded from this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> exclude<br> <em>Required:</em> no</p>' WHERE `id`=153;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>alias</strong></p>\r\n<p>This directive is a longer name or description used to identify the time period.</p>\r\n<p><em>Parameter name:</em> alias<br> <em>Required:</em> yes</p>' WHERE `id`=154;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>template name</strong></p>\r\n<p>Not yet implemented.</p>\r\n<p><em>Parameter name:</em> name<br> <em>Required:</em> no</p>' WHERE `id`=155;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time definition<br></strong></p>\r\n<p>The <em>sunday</em> through <em>saturday</em> directives are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=156;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time range<br></strong></p>\r\n<p>Each time range is in the form of <strong>HH:MM-HH:MM</strong>, where hours are specified on a 24 hour clock. For example, <strong>00:15-24:00</strong> means 12:15am in the morning for this day until 12:20am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=157;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time definition<br></strong></p>\r\n<p>The weekday directives ("<em>sunday</em>" through "<em>saturday</em>")are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).&nbsp;</p>\r\n<p>You can also specify several different types of exceptions to the standard rotating weekday schedule. Exceptions can take a number of different forms including single days of a specific or generic month, single weekdays in a month, or single calendar dates. You can also specify a range of days/dates and even specify skip intervals to obtain functionality described by "every 3 days between these dates". Rather than list all the possible formats for exception strings, Weekdays and different types of exceptions all have different levels of precedence, so its important to understand how they can affect each other. More information on this can be found in the documentation on timeperiods.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=158;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time range<br></strong></p>\r\n<p>Each time range is in the form of <strong>HH:MM-HH:MM</strong>, where hours are specified on a 24 hour clock. For example, <strong>00:15-24:00</strong> means 12:15am in the morning for this day until 12:00am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=159;
UPDATE `tbl_info` SET `infotext`='<p>The nagios version which is running in this domain.</p>\r\n<p>Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.</p>\r\n<p>You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don''t forget to write your complete configuration after a version change!</p>' WHERE `tbl_info`.`key1` = 'domain' AND `tbl_info`.`key2` = 'version' AND `tbl_info`.`version` = 'all' AND `tbl_info`.`language` = 'default';
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('host', 'services', 'all', 'default', '<p><strong>Host - service settings</strong></p>\r\n<p><span id="result_box" lang="en"><span>This box can be used to allocate already existing services to a host.&nbsp;</span></span></p>\r\n<p>This is an internal function of NagiosQL.</p>\r\n<p><span id="result_box" lang="en"><span><strong>Note:</strong> To activate the changes, the corresponding service definitions have to be rewritten!</span></span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('timeperiod', 'name', 'all', 'default', '<p><strong>Timeperiod - </strong><strong>name</strong></p>\r\n<p>It''s just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.</p>\r\n<p><em>Parameter name:</em> name<br /> <em>Required:</em> no</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('timeperiod', 'include', '3', 'default', '<p><strong>Timeperiod - </strong><strong>include</strong></p>\r\n<p>This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> use<br /> <em>Required:</em> no</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'adminenable', 'all', 'default', '<p><strong>User - enable group administration<br /></strong></p>\r\n<p>If this option is selected, the specified user is able to modify the access group for every object definition. This should be restricted only to administrators; otherwise a user might be able to lock himself out.<span id="result_box" lang="en"><span></span></span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('group', 'userrights', 'all', 'default', '<p><strong>Group - user rights</strong></p>\r\n<p>Define the object access rights for a user.</p>\r\n<p><strong>READ</strong> = The user can see the objects belong to this group<br /><strong>WRITE</strong> = The user can modify the objects belong to this group<br /><strong>LINK</strong> = The user can use the objects belong to this group to link them in other objects*<br /><br />* <em>Example:</em> If a time object belongs to this group - the user can user can add (link) this time object to his contact objects.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'conffile', 'all', 'default', '<p>Absolute path to your Nagios config file.<br /><br />Examples:<br />/etc/nagios/nagios.cfg<br />/usr/local/nagios/etc/nagios.cfg<br /><br />This is used to verify your Nagios configuration directly from NagiosQL.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'enable_common', 'all', 'default', '<p>This option is used to enable or disable the global common domain functionality.</p>\r\n<p>If this option is enabled, all objects from the global common domain will be added to this domains configuration files. The global common domain can be used to define objects like timeperiods or contacts that are used in all domains the same.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'utf8_decode', 'all', 'default', '<p>This is an experimental option!</p>\r\n<p>If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if Nagios does not understand the UTF8 data from NagiosQL.</p>\r\n<p>Tested only with Western European configurations!</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'picturedir', 'all', 'default', '<p><strong>Relative</strong> path to your nagios icon images.<br /><br />Example:<br />/my/own/images/</p>\r\n<p>This path is based on your nagios standard image path. Images are assumed to be in the <strong>logos/</strong> subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).</p>\r\n<p>So in the example above, the images are located in:</p>\r\n<p>/usr/local/nagios/share/images/logos<span style="color: #ff0000;">/my/own/images/</span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('common', 'accessgroup', 'all', 'default', '<p><strong>Access group</strong></p>\r\n<p>Select an access group name to restrict this object to the group members.</p>');
--
-- Modify existing tbl_settings
--
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'path' AND `tbl_settings`.`name` = 'physical';
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'path' AND `tbl_settings`.`name` = 'root';
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'db' AND `tbl_settings`.`name` = 'magic_quotes';
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'common', 'tplcheck', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'common', 'updcheck', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'Proxy', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyServer', '');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyUser', '');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyPasswd', '');
UPDATE `tbl_settings` SET `value` = '3.1.0' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
--
-- Modify some field settings (added for 3.2)
--
ALTER TABLE `tbl_hostextinfo` CHANGE `host_name` `host_name` INT( 11 ) NOT NULL;
ALTER TABLE `tbl_info` CHANGE `key1` `key1` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_info` CHANGE `key2` `key2` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_info` CHANGE `language` `language` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
TRUNCATE `tbl_logbook`;
ALTER TABLE `tbl_logbook` CHANGE `time` `time` DATETIME NOT NULL ;
ALTER TABLE `tbl_serviceextinfo` CHANGE `host_name` `host_name` INT( 11 ) NOT NULL;
ALTER TABLE `tbl_timeperiod` PACK_KEYS = DEFAULT;
ALTER TABLE `tbl_user` CHANGE `last_login` `last_login` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `tbl_user` CHANGE `last_modified` `last_modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
UPDATE `tbl_info` SET `infotext`='<p><strong>User - webserver authentification</strong></p>\r\n<p>If your webserver uses authentification and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentification.</p>' WHERE `key1`='user' AND `key2`='webserverauth' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Host - Templates</strong></p>\r\n<p>You can add one or more host templates to a host configuration. Nagios will add the definitions from each template to a host configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='host' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Service - Templates</strong></p>\r\n<p>You can add one or more service templates to a service configuration. Nagios will add the definitions from each template to a service configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='service' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Contact - Templates</strong></p>\r\n<p>You can add one or more contact templates to a contact configuration. Nagios will add the definitions from each template to a contact configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='contact' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>name</strong></p>\r\n<p>Its just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.</p>\r\n<p><em>Parameter name:</em> name<br /> <em>Required:</em> no</p>' WHERE `key1`='timeperiod' AND `key2`='name' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>include</strong></p>\r\n<p>This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> use<br /> <em>Required:</em> no</p>' WHERE `key1`='timeperiod' AND `key2`='include' AND `version`='3' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p>This is an experimental option!</p>\r\n<p>If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if nagios does not understand the UTF8 data from NagiosQL.</p>\r\n<p>Tested only with western european configurations!</p>' WHERE `key1`='domain' AND `key2`='utf8_decode' AND `version`='all' AND `language`='default';

View File

@@ -0,0 +1,25 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- (c) 2008, 2009 by Martin Willisegger
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.1 to NagiosQL 3.0.2
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.0.2
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_301_302.sql 1237 2012-02-23 06:49:34Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.0.2' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;

View File

@@ -0,0 +1,34 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- (c) 2008, 2009 by Martin Willisegger
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.2 to NagiosQL 3.0.3
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.0.3
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_302_303.sql 1237 2012-02-23 06:49:34Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.0.3' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
ALTER TABLE `tbl_settings` CHANGE `value` `value` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
--
-- Modify existing tbl_lnkServicegroupToService
--
ALTER TABLE `tbl_lnkServicegroupToService` DROP PRIMARY KEY, ADD PRIMARY KEY ( `idMaster` , `idSlaveH` , `idSlaveHG`, `idSlaveS` );
--
-- Modify existing tbl_serviceextinfo
--
ALTER TABLE `tbl_serviceextinfo` CHANGE `host_name` `host_name` INT( 11 ) NULL DEFAULT '0';

View File

@@ -0,0 +1,21 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.3 to NagiosQL 3.0.4
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2011-03-13 14:00:26 +0100 (Sun, 13 Mar 2011) $
-- Author : $LastChangedBy: rouven $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1058 $
-- SVN-ID : $Id: update_303_304.sql 1058 2011-03-13 13:00:26Z rouven $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.0.4' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;

View File

@@ -0,0 +1,535 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-27 07:58:18 +0100 (Mon, 27 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1255 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Replace access_rights by access_group
--
ALTER TABLE `tbl_domain` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contactgroup` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contact` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_command` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contacttemplate` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_host` CHANGE `access_rights` `access_group` INT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostdependency` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostescalation` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostextinfo` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hostgroup` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_hosttemplate` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_service` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicedependency` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_serviceescalation` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_serviceextinfo` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicegroup` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_servicetemplate` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_timeperiod` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_submenu` CHANGE `access_rights` `access_group` INT( 8 ) UNSIGNED NOT NULL DEFAULT '0';
--
-- Replace last_modified field type from TIMESTAMP to DATETIME
--
ALTER TABLE `tbl_domain` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contactgroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_command` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_host` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostextinfo` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_service` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicegroup` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_timedefinition` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_user` CHANGE `last_login` `last_login` DATETIME NOT NULL;
ALTER TABLE `tbl_user` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
ALTER TABLE `tbl_variabledefinition` CHANGE `last_modified` `last_modified` DATETIME NOT NULL;
--
-- Add new import_hash field for all tables without key
--
ALTER TABLE `tbl_hostdependency` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_hostescalation` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_service` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_servicedependency` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_serviceescalation` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_serviceextinfo` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `tbl_servicetemplate` ADD `import_hash` VARCHAR( 255 ) NULL DEFAULT NULL;
--
-- Add exclude field in link tables
--
ALTER TABLE `tbl_lnkContactgroupToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactgroupToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToCommandHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToCommandService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContacttemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToCommandHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToCommandService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkContactToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHostgroup_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHostgroup_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHost_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostdependencyToHost_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostescalationToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostgroupToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostgroupToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHosttemplateToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkHostToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHostgroup_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHostgroup_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHost_DH` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToHost_H` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToService_DS` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicedependencyToService_S` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceescalationToService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicegroupToService` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicegroupToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServicetemplateToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToContact` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToContactgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToHost` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToHostgroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkServiceToServicegroup` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_lnkTimeperiodToTimeperiod` ADD `exclude` TINYINT UNSIGNED NOT NULL DEFAULT '0';
--
-- Add slave string field for link tables
--
ALTER TABLE `tbl_lnkServicedependencyToService_DS` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
ALTER TABLE `tbl_lnkServicedependencyToService_S` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
ALTER TABLE `tbl_lnkServiceescalationToService` ADD `strSlave` VARCHAR( 255 ) NULL AFTER `idSlave`;
--
-- Reset permissions for submenus
--
UPDATE `tbl_submenu` SET `access_group` = '0';
--
-- Extent submenu for configuration cleaner and group administration
--
INSERT INTO `tbl_submenu` (`id` ,`id_main` ,`order_id` ,`item` ,`link` ,`access_group`) VALUES (NULL , '7', '3', 'Group admin', 'admin/group.php', '0');
INSERT INTO `tbl_submenu` (`id` ,`id_main` ,`order_id` ,`item` ,`link` ,`access_group`) VALUES (NULL , '6', '3', 'Delete config files', 'admin/delconfig.php', '0');
UPDATE `tbl_submenu` SET `item` = 'Delete backup files' WHERE `link` = 'admin/delbackup.php';
UPDATE `tbl_submenu` SET `item` = 'Extended Host' WHERE `link` = 'admin/hostextinfo.php';
UPDATE `tbl_submenu` SET `item` = 'Extended Service' WHERE `link` = 'admin/serviceextinfo.php';
UPDATE `tbl_submenu` SET `item` = 'Service dependency' WHERE `link` = 'admin/servicedependencies.php';
UPDATE `tbl_submenu` SET `item` = 'Service escalation' WHERE `link` = 'admin/serviceescalations.php';
--
-- Reorder submenu
--
UPDATE `tbl_submenu` SET `order_id` = '4' WHERE `tbl_submenu`.`id` =24;
UPDATE `tbl_submenu` SET `order_id` = '5' WHERE `tbl_submenu`.`id` =25;
UPDATE `tbl_submenu` SET `order_id` = '6' WHERE `tbl_submenu`.`id` =21;
UPDATE `tbl_submenu` SET `order_id` = '7' WHERE `tbl_submenu`.`id` =29;
UPDATE `tbl_submenu` SET `order_id` = '8' WHERE `tbl_submenu`.`id` =30;
UPDATE `tbl_submenu` SET `order_id` = '5' WHERE `tbl_submenu`.`id` =23;
UPDATE `tbl_submenu` SET `order_id` = '4' WHERE `tbl_submenu`.`id` =22;
UPDATE `tbl_submenu` SET `order_id` = '6' WHERE `tbl_submenu`.`id` =19;
--
-- Create new table tbl_group
--
CREATE TABLE IF NOT EXISTS `tbl_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`groupname` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`users` tinyint(3) unsigned NOT NULL DEFAULT '0',
`active` enum('0','1') NOT NULL,
`last_modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Create new table tbl_lnkGroupToUser
--
CREATE TABLE IF NOT EXISTS `tbl_lnkGroupToUser` (
`idMaster` int(10) unsigned NOT NULL,
`idSlave` int(10) unsigned NOT NULL,
`read` enum('0','1') NOT NULL DEFAULT '1',
`write` enum('0','1') NOT NULL DEFAULT '1',
`link` enum('0','1') NOT NULL DEFAULT '1',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Create new table tbl_lnkTimeperiodToTimeperiodUse
--
CREATE TABLE IF NOT EXISTS `tbl_lnkTimeperiodToTimeperiodUse` (
`idMaster` int( 11 ) NOT NULL ,
`idSlave` int( 11 ) NOT NULL ,
`exclude` tinyint( 3 ) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( `idMaster` , `idSlave` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Modify existing tbl_domain
--
ALTER TABLE `tbl_domain` ADD `ssh_key_path` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `password`;
ALTER TABLE `tbl_domain` ADD `conffile` VARCHAR( 255 ) NOT NULL DEFAULT '/mypath/nagios.cfg' AFTER `pidfile`;
ALTER TABLE `tbl_domain` ADD `picturedir` VARCHAR( 255 ) NULL AFTER `importdir`;
ALTER TABLE `tbl_domain` ADD `enable_common` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `version`;
ALTER TABLE `tbl_domain` ADD `utf8_decode` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `enable_common`;
INSERT INTO `tbl_domain` (`id`, `domain`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(0, 'common', 'administrative global domain', '', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 3, 0, '1', '1', NOW());
UPDATE `tbl_domain` SET `id` = '0' WHERE `tbl_domain`.`domain` ='common';
--
-- Modify existing tbl_timeperiod
--
ALTER TABLE `tbl_timeperiod` ADD `use_template` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `exclude`;
--
-- Modify existing tbl_user
--
ALTER TABLE `tbl_user` ADD `admin_enable` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `access_rights`;
UPDATE `tbl_user` SET `admin_enable` = '1' WHERE `tbl_user`.`id` =1;
--
-- Create new tbl_tablestatus
--
CREATE TABLE `tbl_tablestatus` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`tableName` VARCHAR( 255 ) NOT NULL ,
`domainId` INT NOT NULL ,
`updateTime` DATETIME NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;
--
-- Create new tbl_relationinformation
--
CREATE TABLE IF NOT EXISTS `tbl_relationinformation` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`master` varchar(255) NOT NULL,
`tableName1` varchar(255) NOT NULL,
`tableName2` varchar(255) NOT NULL,
`fieldName` varchar(255) NOT NULL,
`linkTable` varchar(255) NOT NULL,
`target1` varchar(255) NOT NULL,
`target2` varchar(255) NOT NULL,
`targetKey` varchar(255) NOT NULL,
`fullRelation` tinyint(3) unsigned NOT NULL DEFAULT '0',
`flags` varchar(255) NOT NULL,
`type` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=234 ;
--
-- Initialize tbl_relationinformation
--
INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES
(1, 'tbl_timeperiod', 'tbl_timeperiod', '', 'exclude', 'tbl_lnkTimeperiodToTimeperiod', 'timeperiod_name', '', '', 0, '', 2),
(2, 'tbl_contact', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContactToCommandHost', 'command_name', '', '', 0, '', 2),
(3, 'tbl_contact', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContactToCommandService', 'command_name', '', '', 0, '', 2),
(4, 'tbl_contact', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContactToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(5, 'tbl_contact', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(6, 'tbl_contact', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(7, 'tbl_contact', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContactToContacttemplate', 'template_name', 'name', '', 0, '', 3),
(8, 'tbl_contact', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContactToVariabledefinition', 'name', '', '', 0, '', 4),
(9, 'tbl_contacttemplate', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContacttemplateToCommandHost', 'command_name', '', '', 0, '', 2),
(10, 'tbl_contacttemplate', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContacttemplateToCommandService', 'command_name', '', '', 0, '', 2),
(11, 'tbl_contacttemplate', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContacttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(12, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(13, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(14, 'tbl_contacttemplate', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContacttemplateToContacttemplate', 'template_name', 'name', '', 0, '', 3),
(15, 'tbl_contacttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContacttemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(16, 'tbl_contactgroup', 'tbl_contact', '', 'members', 'tbl_lnkContactgroupToContact', 'contact_name', '', '', 0, '', 2),
(17, 'tbl_contactgroup', 'tbl_contactgroup', '', 'contactgroup_members', 'tbl_lnkContactgroupToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(18, 'tbl_hosttemplate', 'tbl_host', '', 'parents', 'tbl_lnkHosttemplateToHost', 'host_name', '', '', 0, '', 2),
(19, 'tbl_hosttemplate', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHosttemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(20, 'tbl_hosttemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHosttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(21, 'tbl_hosttemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkHosttemplateToContact', 'contact_name', '', '', 0, '', 2),
(22, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(23, 'tbl_hosttemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(24, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(25, 'tbl_hosttemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(26, 'tbl_hosttemplate', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHosttemplateToHosttemplate', 'template_name', 'name', '', 0, '', 3),
(27, 'tbl_hosttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHosttemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(28, 'tbl_host', 'tbl_host', '', 'parents', 'tbl_lnkHostToHost', 'host_name', '', '', 0, '', 2),
(29, 'tbl_host', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHostToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(30, 'tbl_host', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(31, 'tbl_host', 'tbl_contact', '', 'contacts', 'tbl_lnkHostToContact', 'contact_name', '', '', 0, '', 2),
(32, 'tbl_host', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(33, 'tbl_host', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(34, 'tbl_host', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(35, 'tbl_host', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(36, 'tbl_host', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHostToHosttemplate', 'template_name', 'name', '', 0, '', 3),
(37, 'tbl_host', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHostToVariabledefinition', 'name', '', '', 0, '', 4),
(38, 'tbl_hostgroup', 'tbl_host', '', 'members', 'tbl_lnkHostgroupToHost', 'host_name', '', '', 0, '', 2),
(39, 'tbl_hostgroup', 'tbl_hostgroup', '', 'hostgroup_members', 'tbl_lnkHostgroupToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(40, 'tbl_servicetemplate', 'tbl_host', '', 'host_name', 'tbl_lnkServicetemplateToHost', 'host_name', '', '', 0, '', 2),
(41, 'tbl_servicetemplate', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicetemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(42, 'tbl_servicetemplate', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServicetemplateToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(43, 'tbl_servicetemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServicetemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(44, 'tbl_servicetemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkServicetemplateToContact', 'contact_name', '', '', 0, '', 2),
(45, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(46, 'tbl_servicetemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(47, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(48, 'tbl_servicetemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(49, 'tbl_servicetemplate', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServicetemplateToServicetemplate', 'template_name', 'name', '', 0, '', 3),
(50, 'tbl_servicetemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServicetemplateToVariabledefinition', 'name', '', '', 0, '', 4),
(51, 'tbl_service', 'tbl_host', '', 'host_name', 'tbl_lnkServiceToHost', 'host_name', '', '', 0, '', 2),
(52, 'tbl_service', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(53, 'tbl_service', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServiceToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(54, 'tbl_service', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(55, 'tbl_service', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceToContact', 'contact_name', '', '', 0, '', 2),
(56, 'tbl_service', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1),
(57, 'tbl_service', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1),
(58, 'tbl_service', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1),
(59, 'tbl_service', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1),
(60, 'tbl_service', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServiceToServicetemplate', 'template_name', 'name', '', 0, '', 3),
(61, 'tbl_service', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServiceToVariabledefinition', 'name', '', '', 0, '', 4),
(62, 'tbl_servicegroup', 'tbl_host', 'tbl_service', 'members', 'tbl_lnkServicegroupToService', 'host_name', 'service_description', '', 0, '', 5),
(63, 'tbl_servicegroup', 'tbl_servicegroup', '', 'servicegroup_members', 'tbl_lnkServicegroupToServicegroup', 'servicegroup_name', '', '', 0, '', 2),
(64, 'tbl_hostdependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkHostdependencyToHost_DH', 'host_name', '', '', 0, '', 2),
(65, 'tbl_hostdependency', 'tbl_host', '', 'host_name', 'tbl_lnkHostdependencyToHost_H', 'host_name', '', '', 0, '', 2),
(66, 'tbl_hostdependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2),
(67, 'tbl_hostdependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2),
(68, 'tbl_hostdependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1),
(69, 'tbl_hostescalation', 'tbl_host', '', 'host_name', 'tbl_lnkHostescalationToHost', 'host_name', '', '', 0, '', 2),
(70, 'tbl_hostescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(71, 'tbl_hostescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkHostescalationToContact', 'contact_name', '', '', 0, '', 2),
(72, 'tbl_hostescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(73, 'tbl_hostescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1),
(74, 'tbl_hostextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1),
(75, 'tbl_servicedependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkServicedependencyToHost_DH', 'host_name', '', '', 0, '', 2),
(76, 'tbl_servicedependency', 'tbl_host', '', 'host_name', 'tbl_lnkServicedependencyToHost_H', 'host_name', '', '', 0, '', 2),
(77, 'tbl_servicedependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2),
(78, 'tbl_servicedependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2),
(79, 'tbl_servicedependency', 'tbl_service', '', 'dependent_service_description', 'tbl_lnkServicedependencyToService_DS', 'service_description', '', '', 0, '', 6),
(80, 'tbl_servicedependency', 'tbl_service', '', 'service_description', 'tbl_lnkServicedependencyToService_S', 'service_description', '', '', 0, '', 6),
(81, 'tbl_servicedependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1),
(82, 'tbl_serviceescalation', 'tbl_host', '', 'host_name', 'tbl_lnkServiceescalationToHost', 'host_name', '', '', 0, '', 2),
(83, 'tbl_serviceescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2),
(84, 'tbl_serviceescalation', 'tbl_service', '', 'service_description', 'tbl_lnkServiceescalationToService', 'service_description', '', '', 0, '', 6),
(85, 'tbl_serviceescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceescalationToContact', 'contact_name', '', '', 0, '', 2),
(86, 'tbl_serviceescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2),
(87, 'tbl_serviceescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1),
(88, 'tbl_serviceextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1),
(89, 'tbl_serviceextinfo', 'tbl_service', '', 'service_description', '', 'service_description', '', '', 0, '', 1),
(90, 'tbl_command', 'tbl_lnkContacttemplateToCommandHost', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(91, 'tbl_command', 'tbl_lnkContacttemplateToCommandService', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(92, 'tbl_command', 'tbl_lnkContactToCommandHost', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0),
(93, 'tbl_command', 'tbl_lnkContactToCommandService', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0),
(94, 'tbl_command', 'tbl_host', '', 'check_command', '', '', '', 'host_name', 1, '0,2,2,0', 0),
(95, 'tbl_command', 'tbl_host', '', 'event_handler', '', '', '', 'host_name', 1, '0,2,2,0', 0),
(96, 'tbl_command', 'tbl_service', '', 'check_command', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0),
(97, 'tbl_command', 'tbl_service', '', 'event_handler', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0),
(98, 'tbl_contact', 'tbl_lnkContactgroupToContact', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '1,2,0,1', 0),
(99, 'tbl_contact', 'tbl_lnkContactToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(100, 'tbl_contact', 'tbl_lnkContactToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(101, 'tbl_contact', 'tbl_lnkContactToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(102, 'tbl_contact', 'tbl_lnkContactToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(103, 'tbl_contact', 'tbl_lnkContactToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(104, 'tbl_contact', 'tbl_lnkHostescalationToContact', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(105, 'tbl_contact', 'tbl_lnkHosttemplateToContact', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(106, 'tbl_contact', 'tbl_lnkHostToContact', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0),
(107, 'tbl_contact', 'tbl_lnkServiceescalationToContact', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(108, 'tbl_contact', 'tbl_lnkServicetemplateToContact', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(109, 'tbl_contact', 'tbl_lnkServiceToContact', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(110, 'tbl_contactgroup', 'tbl_lnkContactgroupToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(111, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(112, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(113, 'tbl_contactgroup', 'tbl_lnkContacttemplateToContactgroup', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(114, 'tbl_contactgroup', 'tbl_lnkContactToContactgroup', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(115, 'tbl_contactgroup', 'tbl_lnkHostescalationToContactgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(116, 'tbl_contactgroup', 'tbl_lnkHosttemplateToContactgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(117, 'tbl_contactgroup', 'tbl_lnkHostToContactgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0),
(118, 'tbl_contactgroup', 'tbl_lnkServiceescalationToContactgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(119, 'tbl_contactgroup', 'tbl_lnkServicetemplateToContactgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(120, 'tbl_contactgroup', 'tbl_lnkServiceToContactgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(121, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(122, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0),
(123, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(124, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(125, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(126, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(127, 'tbl_contacttemplate', 'tbl_lnkContactToContacttemplate', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(128, 'tbl_host', 'tbl_lnkHostdependencyToHost_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0),
(129, 'tbl_host', 'tbl_lnkHostdependencyToHost_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0),
(130, 'tbl_host', 'tbl_lnkHostescalationToHost', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0),
(131, 'tbl_host', 'tbl_lnkHosttemplateToHost', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(132, 'tbl_host', 'tbl_lnkHostToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(133, 'tbl_host', 'tbl_lnkHostToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(134, 'tbl_host', 'tbl_lnkHostToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(135, 'tbl_host', 'tbl_lnkHostToHost', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(136, 'tbl_host', 'tbl_lnkHostToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(137, 'tbl_host', 'tbl_lnkHostgroupToHost', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(138, 'tbl_host', 'tbl_lnkHostToHosttemplate', '', 'idMaster', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(139, 'tbl_host', 'tbl_lnkHostToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(140, 'tbl_host', 'tbl_lnkServicedependencyToHost_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(141, 'tbl_host', 'tbl_lnkServicedependencyToHost_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(142, 'tbl_host', 'tbl_lnkServiceescalationToHost', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(143, 'tbl_host', 'tbl_lnkServicetemplateToHost', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(144, 'tbl_host', 'tbl_lnkServiceToHost', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0),
(145, 'tbl_host', 'tbl_lnkServicegroupToService', '', 'idSlaveH', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(146, 'tbl_host', 'tbl_hostextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(147, 'tbl_host', 'tbl_serviceextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(148, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(149, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(150, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(151, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(152, 'tbl_hostescalation', 'tbl_lnkHostescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(153, 'tbl_hostescalation', 'tbl_lnkHostescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(154, 'tbl_hostescalation', 'tbl_lnkHostescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(155, 'tbl_hostescalation', 'tbl_lnkHostescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(156, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0),
(157, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0),
(158, 'tbl_hostgroup', 'tbl_lnkHostescalationToHostgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '0,0,0,1', 0),
(159, 'tbl_hostgroup', 'tbl_lnkHostgroupToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(160, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(161, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(162, 'tbl_hostgroup', 'tbl_lnkHosttemplateToHostgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(163, 'tbl_hostgroup', 'tbl_lnkHostToHostgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(164, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0),
(165, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0),
(166, 'tbl_hostgroup', 'tbl_lnkServiceescalationToHostgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '0,0,0,1', 0),
(167, 'tbl_hostgroup', 'tbl_lnkServicetemplateToHostgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(168, 'tbl_hostgroup', 'tbl_lnkServiceToHostgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(169, 'tbl_hostgroup', 'tbl_lnkServicegroupToService', '', 'idSlaveHG', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(170, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(171, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(172, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(173, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(174, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(175, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0),
(176, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(177, 'tbl_hosttemplate', 'tbl_lnkHostToHosttemplate', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(178, 'tbl_service', 'tbl_lnkServicedependencyToService_DS', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(179, 'tbl_service', 'tbl_lnkServicedependencyToService_S', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0),
(180, 'tbl_service', 'tbl_lnkServiceescalationToService', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0),
(181, 'tbl_service', 'tbl_lnkServicegroupToService', '', 'idSlaveS', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(182, 'tbl_service', 'tbl_lnkServiceToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(183, 'tbl_service', 'tbl_lnkServiceToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(184, 'tbl_service', 'tbl_lnkServiceToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(185, 'tbl_service', 'tbl_lnkServiceToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(186, 'tbl_service', 'tbl_lnkServiceToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(187, 'tbl_service', 'tbl_lnkServiceToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(188, 'tbl_service', 'tbl_lnkServiceToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(189, 'tbl_service', 'tbl_serviceextinfo', '', 'service_description', '', '', '', 'host_name', 1, '0,0,0,0', 0),
(190, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(191, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(192, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(193, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(194, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_DS', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(195, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_S', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(196, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(197, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(198, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(199, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(200, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(201, 'tbl_servicegroup', 'tbl_lnkServicegroupToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(202, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(203, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idSlave', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(204, 'tbl_servicegroup', 'tbl_lnkServicetemplateToServicegroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(205, 'tbl_servicegroup', 'tbl_lnkServiceToServicegroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(206, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0),
(207, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0),
(208, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0),
(209, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0),
(210, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0),
(211, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(212, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0),
(213, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0),
(214, 'tbl_servicetemplate', 'tbl_lnkServiceToServicetemplate', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0),
(215, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(216, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(217, 'tbl_timeperiod', 'tbl_contact', '', 'host_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0),
(218, 'tbl_timeperiod', 'tbl_contact', '', 'service_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0),
(219, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'host_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(220, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'service_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(221, 'tbl_timeperiod', 'tbl_host', '', 'check_period', '', '', '', 'host_name', 1, '1,1,2,0', 0),
(222, 'tbl_timeperiod', 'tbl_host', '', 'notification_period', '', '', '', 'host_name', 1, '1,1,2,0', 0),
(223, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(224, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(225, 'tbl_timeperiod', 'tbl_hostdependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(226, 'tbl_timeperiod', 'tbl_hostescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(227, 'tbl_timeperiod', 'tbl_service', '', 'check_period', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0),
(228, 'tbl_timeperiod', 'tbl_service', '', 'notification_period', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0),
(229, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0),
(230, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'notification_period', '', '', '', 'template_name', 1, '1,1,2,0', 0),
(231, 'tbl_timeperiod', 'tbl_servicedependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(232, 'tbl_timeperiod', 'tbl_serviceescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0),
(233, 'tbl_timeperiod', 'tbl_timedefinition', '', 'tipId', '', '', '', 'id', 1, '0,0,0,3', 0),
(234, 'tbl_timeperiod', 'tbl_timeperiod', '', 'use_template', 'tbl_lnkTimeperiodToTimeperiodUse', 'timeperiod_name', '', '', 0, '', 2),
(235, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0),
(236, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0);
--
-- Modify existing tbl_info
--
UPDATE `tbl_info` SET `infotext`='<p><strong>User - webserver authentication</strong></p>\r\n<p>If your webserver uses authentication and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentication.</p>' WHERE `id`=10;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>timeperiod name</strong></p>\r\n<p>This directives is the short name used to identify the time period.</p>\r\n<p><em>Parameter name:</em> timeperiod_name<br> <em>Required:</em> yes</p>' WHERE `id`=152;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>exclude</strong></p>\r\n<p>This directive is used to specify the short names of other timeperiod definitions whose time ranges should be excluded from this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> exclude<br> <em>Required:</em> no</p>' WHERE `id`=153;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>alias</strong></p>\r\n<p>This directive is a longer name or description used to identify the time period.</p>\r\n<p><em>Parameter name:</em> alias<br> <em>Required:</em> yes</p>' WHERE `id`=154;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>template name</strong></p>\r\n<p>Not yet implemented.</p>\r\n<p><em>Parameter name:</em> name<br> <em>Required:</em> no</p>' WHERE `id`=155;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time definition<br></strong></p>\r\n<p>The <em>sunday</em> through <em>saturday</em> directives are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=156;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time range<br></strong></p>\r\n<p>Each time range is in the form of <strong>HH:MM-HH:MM</strong>, where hours are specified on a 24 hour clock. For example, <strong>00:15-24:00</strong> means 12:15am in the morning for this day until 12:20am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=157;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time definition<br></strong></p>\r\n<p>The weekday directives ("<em>sunday</em>" through "<em>saturday</em>")are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).&nbsp;</p>\r\n<p>You can also specify several different types of exceptions to the standard rotating weekday schedule. Exceptions can take a number of different forms including single days of a specific or generic month, single weekdays in a month, or single calendar dates. You can also specify a range of days/dates and even specify skip intervals to obtain functionality described by "every 3 days between these dates". Rather than list all the possible formats for exception strings, Weekdays and different types of exceptions all have different levels of precedence, so its important to understand how they can affect each other. More information on this can be found in the documentation on timeperiods.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=158;
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>time range<br></strong></p>\r\n<p>Each time range is in the form of <strong>HH:MM-HH:MM</strong>, where hours are specified on a 24 hour clock. For example, <strong>00:15-24:00</strong> means 12:15am in the morning for this day until 12:00am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.</p>\r\n<p><em>Parameter name:</em> [weekday] [exception]<br> <em>Required:</em> no</p>' WHERE `id`=159;
UPDATE `tbl_info` SET `infotext`='<p>The nagios version which is running in this domain.</p>\r\n<p>Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.</p>\r\n<p>You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don''t forget to write your complete configuration after a version change!</p>' WHERE `tbl_info`.`key1` = 'domain' AND `tbl_info`.`key2` = 'version' AND `tbl_info`.`version` = 'all' AND `tbl_info`.`language` = 'default';
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('host', 'services', 'all', 'default', '<p><strong>Host - service settings</strong></p>\r\n<p><span id="result_box" lang="en"><span>This box can be used to allocate already existing services to a host.&nbsp;</span></span></p>\r\n<p>This is an internal function of NagiosQL.</p>\r\n<p><span id="result_box" lang="en"><span><strong>Note:</strong> To activate the changes, the corresponding service definitions have to be rewritten!</span></span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('timeperiod', 'name', 'all', 'default', '<p><strong>Timeperiod - </strong><strong>name</strong></p>\r\n<p>It''s just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.</p>\r\n<p><em>Parameter name:</em> name<br /> <em>Required:</em> no</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('timeperiod', 'include', '3', 'default', '<p><strong>Timeperiod - </strong><strong>include</strong></p>\r\n<p>This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> use<br /> <em>Required:</em> no</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'adminenable', 'all', 'default', '<p><strong>User - enable group administration<br /></strong></p>\r\n<p>If this option is selected, the specified user is able to modify the access group for every object definition. This should be restricted only to administrators; otherwise a user might be able to lock himself out.<span id="result_box" lang="en"><span></span></span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('group', 'userrights', 'all', 'default', '<p><strong>Group - user rights</strong></p>\r\n<p>Define the object access rights for a user.</p>\r\n<p><strong>READ</strong> = The user can see the objects belong to this group<br /><strong>WRITE</strong> = The user can modify the objects belong to this group<br /><strong>LINK</strong> = The user can use the objects belong to this group to link them in other objects*<br /><br />* <em>Example:</em> If a time object belongs to this group - the user can user can add (link) this time object to his contact objects.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'conffile', 'all', 'default', '<p>Absolute path to your Nagios config file.<br /><br />Examples:<br />/etc/nagios/nagios.cfg<br />/usr/local/nagios/etc/nagios.cfg<br /><br />This is used to verify your Nagios configuration directly from NagiosQL.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'enable_common', 'all', 'default', '<p>This option is used to enable or disable the global common domain functionality.</p>\r\n<p>If this option is enabled, all objects from the global common domain will be added to this domains configuration files. The global common domain can be used to define objects like timeperiods or contacts that are used in all domains the same.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'utf8_decode', 'all', 'default', '<p>This is an experimental option!</p>\r\n<p>If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if Nagios does not understand the UTF8 data from NagiosQL.</p>\r\n<p>Tested only with Western European configurations!</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'picturedir', 'all', 'default', '<p><strong>Relative</strong> path to your nagios icon images.<br /><br />Example:<br />/my/own/images/</p>\r\n<p>This path is based on your nagios standard image path. Images are assumed to be in the <strong>logos/</strong> subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).</p>\r\n<p>So in the example above, the images are located in:</p>\r\n<p>/usr/local/nagios/share/images/logos<span style="color: #ff0000;">/my/own/images/</span></p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('common', 'accessgroup', 'all', 'default', '<p><strong>Access group</strong></p>\r\n<p>Select an access group name to restrict this object to the group members.</p>');
--
-- Modify existing tbl_settings
--
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'path' AND `tbl_settings`.`name` = 'physical';
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'path' AND `tbl_settings`.`name` = 'root';
DELETE FROM `tbl_settings` WHERE `tbl_settings`.`category` = 'db' AND `tbl_settings`.`name` = 'magic_quotes';
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'common', 'tplcheck', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'common', 'updcheck', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'Proxy', '0');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyServer', '');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyUser', '');
INSERT INTO `tbl_settings` (`id`, `category`, `name`, `value`) VALUES ('', 'network', 'ProxyPasswd', '');
UPDATE `tbl_settings` SET `value` = '3.1.0' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
--
-- Modify some field settings (added for 3.2)
--
ALTER TABLE `tbl_hostextinfo` CHANGE `host_name` `host_name` INT( 11 ) NOT NULL;
ALTER TABLE `tbl_info` CHANGE `key1` `key1` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_info` CHANGE `key2` `key2` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_info` CHANGE `language` `language` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
TRUNCATE `tbl_logbook`;
ALTER TABLE `tbl_logbook` CHANGE `time` `time` DATETIME NOT NULL ;
ALTER TABLE `tbl_serviceextinfo` CHANGE `host_name` `host_name` INT( 11 ) NOT NULL;
ALTER TABLE `tbl_timeperiod` PACK_KEYS = DEFAULT;
ALTER TABLE `tbl_user` CHANGE `last_login` `last_login` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `tbl_user` CHANGE `last_modified` `last_modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
UPDATE `tbl_info` SET `infotext`='<p><strong>User - webserver authentification</strong></p>\r\n<p>If your webserver uses authentification and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentification.</p>' WHERE `key1`='user' AND `key2`='webserverauth' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Host - Templates</strong></p>\r\n<p>You can add one or more host templates to a host configuration. Nagios will add the definitions from each template to a host configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='host' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Service - Templates</strong></p>\r\n<p>You can add one or more service templates to a service configuration. Nagios will add the definitions from each template to a service configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='service' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Contact - Templates</strong></p>\r\n<p>You can add one or more contact templates to a contact configuration. Nagios will add the definitions from each template to a contact configuration.</p>\r\n<p>If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.</p>\r\n<p>The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.</p>' WHERE `key1`='contact' AND `key2`='templateadd' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>name</strong></p>\r\n<p>Its just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.</p>\r\n<p><em>Parameter name:</em> name<br /> <em>Required:</em> no</p>' WHERE `key1`='timeperiod' AND `key2`='name' AND `version`='all' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p><strong>Timeperiod - </strong><strong>include</strong></p>\r\n<p>This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.</p>\r\n<p><em>Parameter name:</em> use<br /> <em>Required:</em> no</p>' WHERE `key1`='timeperiod' AND `key2`='include' AND `version`='3' AND `language`='default';
UPDATE `tbl_info` SET `infotext`='<p>This is an experimental option!</p>\r\n<p>If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if nagios does not understand the UTF8 data from NagiosQL.</p>\r\n<p>Tested only with western european configurations!</p>' WHERE `key1`='domain' AND `key2`='utf8_decode' AND `version`='all' AND `language`='default';

View File

@@ -0,0 +1,20 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.0 to NagiosQL 3.1.1
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1237 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.1.1' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;

View File

@@ -0,0 +1,348 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-03-12 22:41:04 +0100 (Mon, 12 Mar 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.2.0
-- Revision : $LastChangedRevision: 1291 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.2.0' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
INSERT INTO `tbl_settings` (`id` ,`category` ,`name` ,`value`) VALUES (NULL , 'path', 'base_url', '/');
--
-- Modify object tables
--
ALTER TABLE `tbl_command` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `command_type`;
UPDATE `tbl_command` SET `register`=`active`;
ALTER TABLE `tbl_contact` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `use_template_tploptions`;
UPDATE `tbl_contact` SET `register`=`active`;
ALTER TABLE `tbl_contactgroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `contactgroup_members`;
UPDATE `tbl_contactgroup` SET `register`=`active`;
ALTER TABLE `tbl_contacttemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_template_tploptions`;
UPDATE `tbl_contacttemplate` SET `register`='0';
ALTER TABLE `tbl_host` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_host` SET `register`=`active`;
ALTER TABLE `tbl_hostdependency` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `dependency_period`;
UPDATE `tbl_hostdependency` SET `register`=`active`;
ALTER TABLE `tbl_hostescalation` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `escalation_options`;
UPDATE `tbl_hostescalation` SET `register`=`active`;
ALTER TABLE `tbl_hostextinfo` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `3d_coords`;
UPDATE `tbl_hostextinfo` SET `register`=`active`;
ALTER TABLE `tbl_hostgroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `action_url`;
UPDATE `tbl_hostgroup` SET `register`=`active`;
ALTER TABLE `tbl_hosttemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_variables`;
UPDATE `tbl_hosttemplate` SET `register`='0';
ALTER TABLE `tbl_service` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_service` SET `register`=`active`;
ALTER TABLE `tbl_servicedependency` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `dependency_period`;
UPDATE `tbl_servicedependency` SET `register`=`active`;
ALTER TABLE `tbl_serviceescalation` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `escalation_options`;
UPDATE `tbl_serviceescalation` SET `register`=`active`;
ALTER TABLE `tbl_serviceextinfo` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `icon_image_alt`;
UPDATE `tbl_serviceextinfo` SET `register`=`active`;
ALTER TABLE `tbl_servicegroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `action_url`;
UPDATE `tbl_servicegroup` SET `register`=`active`;
ALTER TABLE `tbl_servicetemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_variables`;
UPDATE `tbl_servicetemplate` SET `register`='0';
ALTER TABLE `tbl_timeperiod` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_timeperiod` SET `register`=`active`;
CREATE TABLE IF NOT EXISTS `tbl_menu` (
`mnuId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mnuTopId` int(10) unsigned NOT NULL,
`mnuGrpId` int(10) unsigned NOT NULL DEFAULT '0',
`mnuCntId` int(10) unsigned NOT NULL,
`mnuName` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`mnuLink` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`mnuActive` tinyint(3) unsigned NOT NULL DEFAULT '1',
`mnuOrderId` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`mnuId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=39 ;
INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES
(1, 0, 0, 1, 'Main page', 'admin.php', 1, 1),
(2, 0, 0, 1, 'Supervision', 'admin/monitoring.php', 1, 2),
(3, 0, 0, 1, 'Alarming', 'admin/alarming.php', 1, 3),
(4, 0, 0, 1, 'Commands', 'admin/commands.php', 1, 4),
(5, 0, 0, 1, 'Specialties', 'admin/specials.php', 1, 5),
(6, 0, 0, 1, 'Tools', 'admin/tools.php', 1, 6),
(7, 0, 0, 1, 'Administration', 'admin/administration.php', 1, 7),
(8, 2, 0, 1, 'Host', 'admin/hosts.php', 1, 1),
(9, 2, 0, 1, 'Services', 'admin/services.php', 1, 2),
(10, 2, 0, 1, 'Host groups', 'admin/hostgroups.php', 1, 3),
(11, 2, 0, 1, 'Service groups', 'admin/servicegroups.php', 1, 4),
(12, 2, 0, 1, 'Host templates', 'admin/hosttemplates.php', 1, 5),
(13, 2, 0, 1, 'Service templates', 'admin/servicetemplates.php', 1, 6),
(14, 3, 0, 1, 'Contact data', 'admin/contacts.php', 1, 1),
(15, 3, 0, 1, 'Contact groups', 'admin/contactgroups.php', 1, 2),
(16, 3, 0, 1, 'Time periods', 'admin/timeperiods.php', 1, 3),
(17, 3, 0, 1, 'Contact templates', 'admin/contacttemplates.php', 1, 4),
(18, 4, 0, 1, 'Definitions', 'admin/checkcommands.php', 1, 1),
(19, 5, 0, 1, 'Host dependency', 'admin/hostdependencies.php', 1, 1),
(20, 5, 0, 1, 'Host escalation', 'admin/hostescalations.php', 1, 2),
(21, 5, 0, 1, 'Extended Host', 'admin/hostextinfo.php', 1, 3),
(22, 5, 0, 1, 'Service dependency', 'admin/servicedependencies.php', 1, 4),
(23, 5, 0, 1, 'Service escalation', 'admin/serviceescalations.php', 1, 5),
(24, 5, 0, 1, 'Extended Service', 'admin/serviceextinfo.php', 1, 6),
(25, 6, 0, 1, 'Data import', 'admin/import.php', 1, 1),
(26, 6, 0, 1, 'Delete backup files', 'admin/delbackup.php', 1, 2),
(27, 6, 0, 1, 'Delete config files', 'admin/delconfig.php', 1, 3),
(28, 6, 0, 1, 'Nagios config', 'admin/nagioscfg.php', 1, 4),
(29, 6, 0, 1, 'CGI config', 'admin/cgicfg.php', 1, 5),
(30, 6, 0, 1, 'Nagios control', 'admin/verify.php', 1, 6),
(31, 7, 0, 1, 'New password', 'admin/password.php', 1, 1),
(32, 7, 0, 1, 'User admin', 'admin/user.php', 1, 2),
(33, 7, 0, 1, 'Group admin', 'admin/group.php', 1, 3),
(34, 7, 0, 1, 'Menu access', 'admin/menuaccess.php', 1, 4),
(35, 7, 0, 1, 'Data domains', 'admin/datadomain.php', 1, 5),
(36, 7, 0, 1, 'Config targets', 'admin/configtargets.php', 1, 6),
(37, 7, 0, 1, 'Logbook', 'admin/logbook.php', 1, 7),
(38, 7, 0, 1, 'Settings', 'admin/settings.php', 1, 8),
(39, 7, 0, 1, 'Help editor', 'admin/helpedit.php', 1, 9),
(40, 7, 0, 1, 'Support', 'admin/support.php', 1, 10);
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 1) WHERE `tbl_menu`.`mnuId` = 8 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 7) WHERE `tbl_menu`.`mnuId` = 9 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 8) WHERE `tbl_menu`.`mnuId` = 10 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 9) WHERE `tbl_menu`.`mnuId` = 11 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 26) WHERE `tbl_menu`.`mnuId` = 12 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 27) WHERE `tbl_menu`.`mnuId` = 13 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 5) WHERE `tbl_menu`.`mnuId` = 14 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 6) WHERE `tbl_menu`.`mnuId` = 15 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 2) WHERE `tbl_menu`.`mnuId` = 16 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 28) WHERE `tbl_menu`.`mnuId` = 17 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 4) WHERE `tbl_menu`.`mnuId` = 18 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 12) WHERE `tbl_menu`.`mnuId` = 19 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 13) WHERE `tbl_menu`.`mnuId` = 20 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 14) WHERE `tbl_menu`.`mnuId` = 21 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 10) WHERE `tbl_menu`.`mnuId` = 22 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 11) WHERE `tbl_menu`.`mnuId` = 23 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 15) WHERE `tbl_menu`.`mnuId` = 24 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 16) WHERE `tbl_menu`.`mnuId` = 25 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 17) WHERE `tbl_menu`.`mnuId` = 26 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 32) WHERE `tbl_menu`.`mnuId` = 27 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 22) WHERE `tbl_menu`.`mnuId` = 28 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 23) WHERE `tbl_menu`.`mnuId` = 29 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 19) WHERE `tbl_menu`.`mnuId` = 30 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 20) WHERE `tbl_menu`.`mnuId` = 31 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 18) WHERE `tbl_menu`.`mnuId` = 32 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 31) WHERE `tbl_menu`.`mnuId` = 33 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 24) WHERE `tbl_menu`.`mnuId` = 34 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 25) WHERE `tbl_menu`.`mnuId` = 35 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 21) WHERE `tbl_menu`.`mnuId` = 37 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 29) WHERE `tbl_menu`.`mnuId` = 38 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 30) WHERE `tbl_menu`.`mnuId` = 39 ;
DROP TABLE `tbl_mainmenu`;
DROP TABLE `tbl_submenu`;
RENAME TABLE `tbl_domain` TO `tbl_datadomain`;
CREATE TABLE `tbl_configtarget` AS SELECT * FROM `tbl_datadomain`;
ALTER TABLE `tbl_configtarget` ENGINE = MYISAM;
ALTER TABLE `tbl_datadomain` DROP `server` ,
DROP `method` ,
DROP `user` ,
DROP `password` ,
DROP `ssh_key_path` ,
DROP `basedir` ,
DROP `hostconfig` ,
DROP `serviceconfig` ,
DROP `backupdir` ,
DROP `hostbackup` ,
DROP `servicebackup` ,
DROP `nagiosbasedir` ,
DROP `importdir` ,
DROP `picturedir` ,
DROP `commandfile` ,
DROP `binaryfile` ,
DROP `pidfile` ,
DROP `conffile`,
ADD `targets` INT UNSIGNED NOT NULL AFTER `alias` ;
DELETE FROM `tbl_configtarget` WHERE `domain`='common';
ALTER TABLE `tbl_configtarget` ADD PRIMARY KEY ( `id` );
ALTER TABLE `tbl_configtarget` CHANGE `id` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `tbl_configtarget` DROP `enable_common` , DROP `utf8_decode`;
ALTER TABLE `tbl_configtarget` CHANGE `conffile` `conffile` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `domain` `target` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_datadomain` CHANGE `domain` `domain` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` ADD UNIQUE ( `target` );
UPDATE `tbl_datadomain` SET `id` = '0' WHERE `domain` = 'common';
UPDATE `tbl_datadomain` SET `targets`= (SELECT `id` FROM `tbl_configtarget` WHERE `target`=`tbl_datadomain`.`domain`);
CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_DS` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_S` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToServicegroup` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `tbl_servicedependency` ADD `dependent_servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `dependent_service_description`;
ALTER TABLE `tbl_servicedependency` ADD `servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `service_description`;
ALTER TABLE `tbl_serviceescalation` ADD `servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `service_description`;
CREATE TABLE IF NOT EXISTS `tbl_language` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
`last_modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(1, 'English', 'en_GB', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(2, 'German', 'de_DE', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(3, 'Chinese (Simplified)', 'zh_CN', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(5, 'Italian', 'it_IT', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(6, 'French', 'fr_FR', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(7, 'Russian', 'ru_RU', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(8, 'Spanish', 'es_ES', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(9, 'Portuguese (Brazilian)', 'pt_BR', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(11, 'Dutch', 'nl_NL', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(13, 'Danish', 'da_DK', '1', NOW());
ALTER TABLE `tbl_user` DROP `access_rights`;
ALTER TABLE `tbl_user` ADD `language` VARCHAR( 20 ) NOT NULL AFTER `nodelete` ;
ALTER TABLE `tbl_user` ADD `domain` INT UNSIGNED NOT NULL DEFAULT '1' AFTER `language`;
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_group', 'tbl_user', '', 'users', 'tbl_lnkGroupToUser', 'username', '', '', 0, '', 0);
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_group', 'tbl_lnkGroupToUser', '', 'idMaster', '', 'tbl_user', '', 'username', 1, '0,0,0,1', 0);
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_servicegroup', '', 'dependent_servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_DS', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_S', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_DS', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_S', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_serviceescalation', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServiceescalationToServicegroup', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_serviceescalation', 'tbl_lnkServiceescalationToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('common', 'registered', 'all', 'default', '<p><strong>Register</strong></p>\r\n<p>This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the <em>register</em> directive to be <em>0</em>. This prevents the need to override an inherited <em>register</em> directive with a value of <em>1</em> for every object that should be registered.</p>\r\n<p><em>Parameter name:</em> register<br> <em>Required:</em> yes</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('servicedependency', 'dependent_servicegroup_name', 'all', 'default', '<p><strong>Servicedependency -</strong><strong> dependent servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the <em>dependent</em> servicegroup.</p>\r\n<p><em>Parameter name:</em> dependent_servicegroup_name<br> <em>Required:</em> yes (no, if a dependent service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('servicedependency', 'servicegroup_name', 'all', 'default', '<p><strong>Servicedependency -</strong><strong> </strong><strong>servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the servicegroup <em>that is being depended upon</em> (also referred to as the master service).</p>\r\n<p><em>Parameter name:</em> servicegroup_name<br> <em>Required:</em> yes (no, if a service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('serviceescalation', 'servicegroup', 'all', 'default', '<p><strong>Serviceescalation - </strong><strong>servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the servicegroup the escalation should apply to.</p>\r\n<p><em>Parameter name:</em> servicegroup_name<br> <em>Required:</em> yes (no, if a service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'language', 'all', 'default', '<p><strong>User - language<br /></strong></p>\r\n<p>Defines a default UI language for the user.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'standarddomain', 'all', 'default', '<p><strong>User - standard domain<br /></strong></p>\r\n<p>Defines a standard domain for the user. After the user has logged in, the defined domain is pre-selected.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'targets', 'all', 'default', '<p>Select a configuration domain which is assigned to this data domain</p>\r\n<p>The settings where to store the configuration files are defined in a configuration domain. Select here the desired target for your configuration files.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'ssh_host_key', 'all', 'default', 'Absolute path to the ssh key directory for the defined ssh user.<br><br>Examples:<br>/etc/nagiosql/ssh/ <br>/usr/local/nagios/etc/.ssh/<br><br>This directory includes the key file (id_rsa) for the user to connect to the remote system. Note, that the file name is set to id_rsa!');
UPDATE `tbl_info` SET `infotext`='<p><strong>Group - user rights</strong></p>\r\n<p>Define the object access rights for a user.</p>\r\n<p><strong>READ</strong> = The user can see the objects belong to this group<br /><strong>WRITE</strong> = The user can modify the objects belong to this group<br /><strong>LINK</strong> = The user can use the objects belong to this group to link them in other objects*<br /><br />* <em>Example:</em> If a time object belongs to this group - the user can add (link) this time object to his contact objects.</p>' WHERE `key1`='group' AND `key2`='userrights' AND `version`='all' AND `language`='default';
UPDATE `tbl_settings` SET `name`='proxy' WHERE `category`='network' AND `name`='Proxy';
UPDATE `tbl_settings` SET `name`='proxyserver' WHERE `category`='network' AND `name`='ProxyServer';
UPDATE `tbl_settings` SET `name`='proxyuser' WHERE `category`='network' AND `name`='ProxyUser';
UPDATE `tbl_settings` SET `name`='proxypasswd' WHERE `category`='network' AND `name`='ProxyPasswd';
UPDATE `tbl_user` SET `admin_enable` = '1' WHERE `tbl_user`.`id`=1;
--
-- Modify some field settings
--
ALTER TABLE `tbl_configtarget` CHANGE `ssh_key_path` `ssh_key_path` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `picturedir` `picturedir` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `version` `version` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '3';
ALTER TABLE `tbl_configtarget` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_contact` CHANGE `email` `email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `pager` `pager` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address1` `address1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address2` `address2` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address3` `address3` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address4` `address4` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address5` `address5` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address6` `address6` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contactgroup` CHANGE `contactgroup_members` `contactgroup_members` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contacttemplate` CHANGE `email` `email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `pager` `pager` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address1` `address1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address2` `address2` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address3` `address3` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address4` `address4` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address5` `address5` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address6` `address6` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_datadomain` CHANGE `version` `version` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '3';
ALTER TABLE `tbl_datadomain` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_group` CHANGE `description` `description` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_group` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_host` CHANGE `display_name` `display_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `check_command` `check_command` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `initial_state` `initial_state` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `flap_detection_options` `flap_detection_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notification_options` `notification_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `icon_image_alt` `icon_image_alt` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `vrml_image` `vrml_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `statusmap_image` `statusmap_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `2d_coords` `2d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `3d_coords` `3d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `execution_failure_criteria` `execution_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `notification_failure_criteria` `notification_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `escalation_options` `escalation_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `check_command` `check_command` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `initial_state` `initial_state` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `flap_detection_options` `flap_detection_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notification_options` `notification_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `icon_image_alt` `icon_image_alt` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `vrml_image` `vrml_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `statusmap_image` `statusmap_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `2d_coords` `2d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `3d_coords` `3d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicedependencyToService_DS` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicedependencyToService_S` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServiceescalationToService` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `name` `name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `execution_failure_criteria` `execution_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `notification_failure_criteria` `notification_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `escalation_options` `escalation_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `timeperiod_name` `timeperiod_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `alias` `alias` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicegroupToService` DROP PRIMARY KEY , ADD PRIMARY KEY ( `idMaster` , `idSlaveH` , `idSlaveHG` , `idSlaveS` );
--
-- Modify icon_image field for PNP4Nagios
--
ALTER TABLE `tbl_servicetemplate` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostextinfo` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;

View File

@@ -0,0 +1,348 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-03-12 22:41:04 +0100 (Mon, 12 Mar 2012) $
-- Author : $LastChangedBy: martin $
-- Version : 3.2.0
-- Revision : $LastChangedRevision: 1291 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- Modify existing tbl_settings
--
UPDATE `tbl_settings` SET `value` = '3.2.0' WHERE `tbl_settings`.`name` = 'version' LIMIT 1;
INSERT INTO `tbl_settings` (`id` ,`category` ,`name` ,`value`) VALUES (NULL , 'path', 'base_url', '/');
--
-- Modify object tables
--
ALTER TABLE `tbl_command` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `command_type`;
UPDATE `tbl_command` SET `register`=`active`;
ALTER TABLE `tbl_contact` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `use_template_tploptions`;
UPDATE `tbl_contact` SET `register`=`active`;
ALTER TABLE `tbl_contactgroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `contactgroup_members`;
UPDATE `tbl_contactgroup` SET `register`=`active`;
ALTER TABLE `tbl_contacttemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_template_tploptions`;
UPDATE `tbl_contacttemplate` SET `register`='0';
ALTER TABLE `tbl_host` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_host` SET `register`=`active`;
ALTER TABLE `tbl_hostdependency` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `dependency_period`;
UPDATE `tbl_hostdependency` SET `register`=`active`;
ALTER TABLE `tbl_hostescalation` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `escalation_options`;
UPDATE `tbl_hostescalation` SET `register`=`active`;
ALTER TABLE `tbl_hostextinfo` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `3d_coords`;
UPDATE `tbl_hostextinfo` SET `register`=`active`;
ALTER TABLE `tbl_hostgroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `action_url`;
UPDATE `tbl_hostgroup` SET `register`=`active`;
ALTER TABLE `tbl_hosttemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_variables`;
UPDATE `tbl_hosttemplate` SET `register`='0';
ALTER TABLE `tbl_service` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_service` SET `register`=`active`;
ALTER TABLE `tbl_servicedependency` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `dependency_period`;
UPDATE `tbl_servicedependency` SET `register`=`active`;
ALTER TABLE `tbl_serviceescalation` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `escalation_options`;
UPDATE `tbl_serviceescalation` SET `register`=`active`;
ALTER TABLE `tbl_serviceextinfo` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `icon_image_alt`;
UPDATE `tbl_serviceextinfo` SET `register`=`active`;
ALTER TABLE `tbl_servicegroup` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `action_url`;
UPDATE `tbl_servicegroup` SET `register`=`active`;
ALTER TABLE `tbl_servicetemplate` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `use_variables`;
UPDATE `tbl_servicetemplate` SET `register`='0';
ALTER TABLE `tbl_timeperiod` ADD `register` ENUM( '0', '1' ) NOT NULL DEFAULT '1' AFTER `name`;
UPDATE `tbl_timeperiod` SET `register`=`active`;
CREATE TABLE IF NOT EXISTS `tbl_menu` (
`mnuId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mnuTopId` int(10) unsigned NOT NULL,
`mnuGrpId` int(10) unsigned NOT NULL DEFAULT '0',
`mnuCntId` int(10) unsigned NOT NULL,
`mnuName` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`mnuLink` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`mnuActive` tinyint(3) unsigned NOT NULL DEFAULT '1',
`mnuOrderId` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`mnuId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=39 ;
INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES
(1, 0, 0, 1, 'Main page', 'admin.php', 1, 1),
(2, 0, 0, 1, 'Supervision', 'admin/monitoring.php', 1, 2),
(3, 0, 0, 1, 'Alarming', 'admin/alarming.php', 1, 3),
(4, 0, 0, 1, 'Commands', 'admin/commands.php', 1, 4),
(5, 0, 0, 1, 'Specialties', 'admin/specials.php', 1, 5),
(6, 0, 0, 1, 'Tools', 'admin/tools.php', 1, 6),
(7, 0, 0, 1, 'Administration', 'admin/administration.php', 1, 7),
(8, 2, 0, 1, 'Host', 'admin/hosts.php', 1, 1),
(9, 2, 0, 1, 'Services', 'admin/services.php', 1, 2),
(10, 2, 0, 1, 'Host groups', 'admin/hostgroups.php', 1, 3),
(11, 2, 0, 1, 'Service groups', 'admin/servicegroups.php', 1, 4),
(12, 2, 0, 1, 'Host templates', 'admin/hosttemplates.php', 1, 5),
(13, 2, 0, 1, 'Service templates', 'admin/servicetemplates.php', 1, 6),
(14, 3, 0, 1, 'Contact data', 'admin/contacts.php', 1, 1),
(15, 3, 0, 1, 'Contact groups', 'admin/contactgroups.php', 1, 2),
(16, 3, 0, 1, 'Time periods', 'admin/timeperiods.php', 1, 3),
(17, 3, 0, 1, 'Contact templates', 'admin/contacttemplates.php', 1, 4),
(18, 4, 0, 1, 'Definitions', 'admin/checkcommands.php', 1, 1),
(19, 5, 0, 1, 'Host dependency', 'admin/hostdependencies.php', 1, 1),
(20, 5, 0, 1, 'Host escalation', 'admin/hostescalations.php', 1, 2),
(21, 5, 0, 1, 'Extended Host', 'admin/hostextinfo.php', 1, 3),
(22, 5, 0, 1, 'Service dependency', 'admin/servicedependencies.php', 1, 4),
(23, 5, 0, 1, 'Service escalation', 'admin/serviceescalations.php', 1, 5),
(24, 5, 0, 1, 'Extended Service', 'admin/serviceextinfo.php', 1, 6),
(25, 6, 0, 1, 'Data import', 'admin/import.php', 1, 1),
(26, 6, 0, 1, 'Delete backup files', 'admin/delbackup.php', 1, 2),
(27, 6, 0, 1, 'Delete config files', 'admin/delconfig.php', 1, 3),
(28, 6, 0, 1, 'Nagios config', 'admin/nagioscfg.php', 1, 4),
(29, 6, 0, 1, 'CGI config', 'admin/cgicfg.php', 1, 5),
(30, 6, 0, 1, 'Nagios control', 'admin/verify.php', 1, 6),
(31, 7, 0, 1, 'New password', 'admin/password.php', 1, 1),
(32, 7, 0, 1, 'User admin', 'admin/user.php', 1, 2),
(33, 7, 0, 1, 'Group admin', 'admin/group.php', 1, 3),
(34, 7, 0, 1, 'Menu access', 'admin/menuaccess.php', 1, 4),
(35, 7, 0, 1, 'Data domains', 'admin/datadomain.php', 1, 5),
(36, 7, 0, 1, 'Config targets', 'admin/configtargets.php', 1, 6),
(37, 7, 0, 1, 'Logbook', 'admin/logbook.php', 1, 7),
(38, 7, 0, 1, 'Settings', 'admin/settings.php', 1, 8),
(39, 7, 0, 1, 'Help editor', 'admin/helpedit.php', 1, 9),
(40, 7, 0, 1, 'Support', 'admin/support.php', 1, 10);
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 1) WHERE `tbl_menu`.`mnuId` = 8 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 7) WHERE `tbl_menu`.`mnuId` = 9 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 8) WHERE `tbl_menu`.`mnuId` = 10 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 9) WHERE `tbl_menu`.`mnuId` = 11 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 26) WHERE `tbl_menu`.`mnuId` = 12 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 27) WHERE `tbl_menu`.`mnuId` = 13 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 5) WHERE `tbl_menu`.`mnuId` = 14 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 6) WHERE `tbl_menu`.`mnuId` = 15 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 2) WHERE `tbl_menu`.`mnuId` = 16 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 28) WHERE `tbl_menu`.`mnuId` = 17 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 4) WHERE `tbl_menu`.`mnuId` = 18 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 12) WHERE `tbl_menu`.`mnuId` = 19 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 13) WHERE `tbl_menu`.`mnuId` = 20 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 14) WHERE `tbl_menu`.`mnuId` = 21 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 10) WHERE `tbl_menu`.`mnuId` = 22 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 11) WHERE `tbl_menu`.`mnuId` = 23 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 15) WHERE `tbl_menu`.`mnuId` = 24 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 16) WHERE `tbl_menu`.`mnuId` = 25 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 17) WHERE `tbl_menu`.`mnuId` = 26 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 32) WHERE `tbl_menu`.`mnuId` = 27 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 22) WHERE `tbl_menu`.`mnuId` = 28 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 23) WHERE `tbl_menu`.`mnuId` = 29 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 19) WHERE `tbl_menu`.`mnuId` = 30 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 20) WHERE `tbl_menu`.`mnuId` = 31 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 18) WHERE `tbl_menu`.`mnuId` = 32 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 31) WHERE `tbl_menu`.`mnuId` = 33 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 24) WHERE `tbl_menu`.`mnuId` = 34 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 25) WHERE `tbl_menu`.`mnuId` = 35 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 21) WHERE `tbl_menu`.`mnuId` = 37 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 29) WHERE `tbl_menu`.`mnuId` = 38 ;
UPDATE `tbl_menu` SET `mnuGrpId` = (SELECT `access_group` FROM `tbl_submenu` WHERE `tbl_submenu`.`id` = 30) WHERE `tbl_menu`.`mnuId` = 39 ;
DROP TABLE `tbl_mainmenu`;
DROP TABLE `tbl_submenu`;
RENAME TABLE `tbl_domain` TO `tbl_datadomain`;
CREATE TABLE `tbl_configtarget` AS SELECT * FROM `tbl_datadomain`;
ALTER TABLE `tbl_configtarget` ENGINE = MYISAM;
ALTER TABLE `tbl_datadomain` DROP `server` ,
DROP `method` ,
DROP `user` ,
DROP `password` ,
DROP `ssh_key_path` ,
DROP `basedir` ,
DROP `hostconfig` ,
DROP `serviceconfig` ,
DROP `backupdir` ,
DROP `hostbackup` ,
DROP `servicebackup` ,
DROP `nagiosbasedir` ,
DROP `importdir` ,
DROP `picturedir` ,
DROP `commandfile` ,
DROP `binaryfile` ,
DROP `pidfile` ,
DROP `conffile`,
ADD `targets` INT UNSIGNED NOT NULL AFTER `alias` ;
DELETE FROM `tbl_configtarget` WHERE `domain`='common';
ALTER TABLE `tbl_configtarget` ADD PRIMARY KEY ( `id` );
ALTER TABLE `tbl_configtarget` CHANGE `id` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `tbl_configtarget` DROP `enable_common` , DROP `utf8_decode`;
ALTER TABLE `tbl_configtarget` CHANGE `conffile` `conffile` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `domain` `target` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_datadomain` CHANGE `domain` `domain` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` ADD UNIQUE ( `target` );
UPDATE `tbl_datadomain` SET `id` = '0' WHERE `domain` = 'common';
UPDATE `tbl_datadomain` SET `targets`= (SELECT `id` FROM `tbl_configtarget` WHERE `target`=`tbl_datadomain`.`domain`);
CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_DS` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_S` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToServicegroup` (
`idMaster` int(11) NOT NULL,
`idSlave` int(11) NOT NULL,
`exclude` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idMaster`,`idSlave`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `tbl_servicedependency` ADD `dependent_servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `dependent_service_description`;
ALTER TABLE `tbl_servicedependency` ADD `servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `service_description`;
ALTER TABLE `tbl_serviceescalation` ADD `servicegroup_name` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `service_description`;
CREATE TABLE IF NOT EXISTS `tbl_language` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
`last_modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(1, 'English', 'en_GB', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(2, 'German', 'de_DE', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(3, 'Chinese (Simplified)', 'zh_CN', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(5, 'Italian', 'it_IT', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(6, 'French', 'fr_FR', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(7, 'Russian', 'ru_RU', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(8, 'Spanish', 'es_ES', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(9, 'Portuguese (Brazilian)', 'pt_BR', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(11, 'Dutch', 'nl_NL', '1', NOW());
INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(13, 'Danish', 'da_DK', '1', NOW());
ALTER TABLE `tbl_user` DROP `access_rights`;
ALTER TABLE `tbl_user` ADD `language` VARCHAR( 20 ) NOT NULL AFTER `nodelete` ;
ALTER TABLE `tbl_user` ADD `domain` INT UNSIGNED NOT NULL DEFAULT '1' AFTER `language`;
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_group', 'tbl_user', '', 'users', 'tbl_lnkGroupToUser', 'username', '', '', 0, '', 0);
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_group', 'tbl_lnkGroupToUser', '', 'idMaster', '', 'tbl_user', '', 'username', 1, '0,0,0,1', 0);
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_servicegroup', '', 'dependent_servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_DS', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_S', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_DS', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_S', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_serviceescalation', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServiceescalationToServicegroup', 'servicegroup_name', '', '', '0', '', '2');
INSERT INTO `tbl_relationinformation` (`master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES ('tbl_serviceescalation', 'tbl_lnkServiceescalationToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('common', 'registered', 'all', 'default', '<p><strong>Register</strong></p>\r\n<p>This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the <em>register</em> directive to be <em>0</em>. This prevents the need to override an inherited <em>register</em> directive with a value of <em>1</em> for every object that should be registered.</p>\r\n<p><em>Parameter name:</em> register<br> <em>Required:</em> yes</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('servicedependency', 'dependent_servicegroup_name', 'all', 'default', '<p><strong>Servicedependency -</strong><strong> dependent servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the <em>dependent</em> servicegroup.</p>\r\n<p><em>Parameter name:</em> dependent_servicegroup_name<br> <em>Required:</em> yes (no, if a dependent service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('servicedependency', 'servicegroup_name', 'all', 'default', '<p><strong>Servicedependency -</strong><strong> </strong><strong>servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the servicegroup <em>that is being depended upon</em> (also referred to as the master service).</p>\r\n<p><em>Parameter name:</em> servicegroup_name<br> <em>Required:</em> yes (no, if a service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('serviceescalation', 'servicegroup', 'all', 'default', '<p><strong>Serviceescalation - </strong><strong>servicegroup name</strong><strong></strong></p>\r\n<p>This directive is used to identify the <em>name</em> of the servicegroup the escalation should apply to.</p>\r\n<p><em>Parameter name:</em> servicegroup_name<br> <em>Required:</em> yes (no, if a service is defined)</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'language', 'all', 'default', '<p><strong>User - language<br /></strong></p>\r\n<p>Defines a default UI language for the user.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('user', 'standarddomain', 'all', 'default', '<p><strong>User - standard domain<br /></strong></p>\r\n<p>Defines a standard domain for the user. After the user has logged in, the defined domain is pre-selected.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'targets', 'all', 'default', '<p>Select a configuration domain which is assigned to this data domain</p>\r\n<p>The settings where to store the configuration files are defined in a configuration domain. Select here the desired target for your configuration files.</p>');
INSERT INTO `tbl_info` (`key1`, `key2`, `version`, `language`, `infotext`) VALUES('domain', 'ssh_host_key', 'all', 'default', 'Absolute path to the ssh key directory for the defined ssh user.<br><br>Examples:<br>/etc/nagiosql/ssh/ <br>/usr/local/nagios/etc/.ssh/<br><br>This directory includes the key file (id_rsa) for the user to connect to the remote system. Note, that the file name is set to id_rsa!');
UPDATE `tbl_info` SET `infotext`='<p><strong>Group - user rights</strong></p>\r\n<p>Define the object access rights for a user.</p>\r\n<p><strong>READ</strong> = The user can see the objects belong to this group<br /><strong>WRITE</strong> = The user can modify the objects belong to this group<br /><strong>LINK</strong> = The user can use the objects belong to this group to link them in other objects*<br /><br />* <em>Example:</em> If a time object belongs to this group - the user can add (link) this time object to his contact objects.</p>' WHERE `key1`='group' AND `key2`='userrights' AND `version`='all' AND `language`='default';
UPDATE `tbl_settings` SET `name`='proxy' WHERE `category`='network' AND `name`='Proxy';
UPDATE `tbl_settings` SET `name`='proxyserver' WHERE `category`='network' AND `name`='ProxyServer';
UPDATE `tbl_settings` SET `name`='proxyuser' WHERE `category`='network' AND `name`='ProxyUser';
UPDATE `tbl_settings` SET `name`='proxypasswd' WHERE `category`='network' AND `name`='ProxyPasswd';
UPDATE `tbl_user` SET `admin_enable` = '1' WHERE `tbl_user`.`id`=1;
--
-- Modify some field settings
--
ALTER TABLE `tbl_configtarget` CHANGE `ssh_key_path` `ssh_key_path` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `picturedir` `picturedir` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_configtarget` CHANGE `version` `version` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '3';
ALTER TABLE `tbl_configtarget` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_contact` CHANGE `email` `email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `pager` `pager` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address1` `address1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address2` `address2` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address3` `address3` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address4` `address4` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address5` `address5` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contact` CHANGE `address6` `address6` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contactgroup` CHANGE `contactgroup_members` `contactgroup_members` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `tbl_contacttemplate` CHANGE `email` `email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `pager` `pager` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address1` `address1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address2` `address2` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address3` `address3` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address4` `address4` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address5` `address5` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_contacttemplate` CHANGE `address6` `address6` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_datadomain` CHANGE `version` `version` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '3';
ALTER TABLE `tbl_datadomain` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_group` CHANGE `description` `description` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_group` CHANGE `active` `active` ENUM( '0', '1' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
ALTER TABLE `tbl_host` CHANGE `display_name` `display_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `check_command` `check_command` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `initial_state` `initial_state` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `flap_detection_options` `flap_detection_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notification_options` `notification_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `icon_image_alt` `icon_image_alt` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `vrml_image` `vrml_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `statusmap_image` `statusmap_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `2d_coords` `2d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `3d_coords` `3d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `execution_failure_criteria` `execution_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `notification_failure_criteria` `notification_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostdependency` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `escalation_options` `escalation_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostescalation` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostgroup` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `check_command` `check_command` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `initial_state` `initial_state` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `flap_detection_options` `flap_detection_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notification_options` `notification_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notes` `notes` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `notes_url` `notes_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `action_url` `action_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `icon_image_alt` `icon_image_alt` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `vrml_image` `vrml_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `statusmap_image` `statusmap_image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `2d_coords` `2d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `3d_coords` `3d_coords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicedependencyToService_DS` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicedependencyToService_S` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServiceescalationToService` CHANGE `strSlave` `strSlave` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `name` `name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `execution_failure_criteria` `execution_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `notification_failure_criteria` `notification_failure_criteria` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicedependency` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `escalation_options` `escalation_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceescalation` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `stalking_options` `stalking_options` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_servicetemplate` CHANGE `import_hash` `import_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `timeperiod_name` `timeperiod_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_timeperiod` CHANGE `alias` `alias` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_lnkServicegroupToService` DROP PRIMARY KEY , ADD PRIMARY KEY ( `idMaster` , `idSlaveH` , `idSlaveHG` , `idSlaveS` );
--
-- Modify icon_image field for PNP4Nagios
--
ALTER TABLE `tbl_servicetemplate` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_service` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hosttemplate` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_host` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_hostextinfo` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `tbl_serviceextinfo` CHANGE `icon_image` `icon_image` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;

271
install/step1.php Normal file
View File

@@ -0,0 +1,271 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 1
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-25 17:48:16 +0100 (Sat, 25 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1252 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Prevent this file from direct access
// ====================================
if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) {
exit;
}
//
// Define common variables
// =======================
$preIncludeContent = "templates/step1.tpl.htm";
$intError = 0;
//
// Define check arrays
// ===================
$arrRequiredExt = array (
'Session' => 'session',
'Gettext' => 'gettext',
'Filter' => 'filter'
);
$arrOptionalExt = array (
'FTP' => 'ftp',
'SSH2' => 'ssh2'
);
//$arrSupportedDBs = array (
// 'MySQL' => 'mysql',
// 'Postgres' => 'pgsql'
//);
$arrSupportedDBs = array (
'MySQL' => 'mysql'
);
$arrIniCheck = array (
'file_uploads' => 1,
'session.auto_start' => 0,
'suhosin.session.encrypt' => 0,
'date.timezone' => '-NOTEMPTY-'
);
$arrSourceURLs = array(
'Sockets' => 'http://www.php.net/manual/en/book.sockets.php',
'Session' => 'http://www.php.net/manual/en/book.session.php',
'PCRE' => 'http://www.php.net/manual/en/book.pcre.php',
'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php',
'Mcrypt' => 'http://www.php.net/manual/en/book.mcrypt.php',
'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php',
'JSON' => 'http://www.php.net/manual/en/book.json.php',
'DOM' => 'http://www.php.net/manual/en/book.dom.php',
'Intl' => 'http://www.php.net/manual/en/book.intl.php',
'gettext' => 'http://www.php.net/manual/en/book.gettext.php',
'curl' => 'http://www.php.net/manual/en/book.curl.php',
'Filter' => 'http://www.php.net/manual/en/book.filter.php',
'XML' => 'http://www.php.net/manual/en/book.xml.php',
'SimpleXML' => 'http://www.php.net/manual/en/book.simplexml.php',
'FTP' => 'http://www.php.net/manual/en/book.ftp.php',
'MySQL' => 'http://php.net/manual/de/book.mysql.php',
'PEAR' => 'http://pear.php.net',
'date.timezone' => 'http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone',
'SSH2' => 'http://pecl.php.net/package/ssh2'
);
//
// Build content
// =============
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP1_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Checking requirements");
$arrTemplate['STEP1_SUBTITLE1'] = translate("Checking Client");
$arrTemplate['STEP1_SUBTITLE2'] = translate("Checking PHP version");
$arrTemplate['STEP1_SUBTITLE3'] = translate("Checking PHP extensions");
$arrTemplate['STEP1_SUBTITLE4'] = translate("Checking available database interfaces");
$arrTemplate['STEP1_SUBTITLE5'] = translate("Checking php.ini/.htaccess settings");
$arrTemplate['STEP1_SUBTITLE6'] = translate("Checking System Permission");
$arrTemplate['STEP1_TEXT3_1'] = translate("The following modules/extensions are <em>required</em> to run NagiosQL");
$arrTemplate['STEP1_TEXT3_2'] = translate("The next couple of extensions are <em>optional</em> but recommended");
$arrTemplate['STEP1_TEXT4_1'] = translate("Check which of the supported extensions are installed. At least one of them is required.");
$arrTemplate['STEP1_TEXT5_1'] = translate("The following settings are <em>required</em> to run NagiosQL");
//
// Conditional checks
// =======================
$strHTMLPart1 = "<img src=\"images/valid.png\" alt=\"valid\" title=\"valid\" class=\"textmiddle\"> ";
$strHTMLPart2 = "<img src=\"images/invalid.png\" alt=\"invalid\" title=\"invalid\" class=\"textmiddle\"> ";
$strHTMLPart3 = "<img src=\"images/warning.png\" alt=\"warning\" title=\"warning\" class=\"textmiddle\"> ";
$strHTMLPart4 = ": <span class=\"green\">";
$strHTMLPart5 = ": <span class=\"red\">";
$strHTMLPart6 = ": <span class=\"yellow\">";
$strHTMLPart7 = "<img src=\"images/onlinehelp.png\" alt=\"online help\" title=\"online help\" class=\"textmiddle\" style=\"border:none;\">";
// Javascript check
if ($_SESSION['install']['jscript'] == "yes") {
$arrTemplate['CHECK_1_PIC'] = "valid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = translate("ENABLED");
} else {
$arrTemplate['CHECK_1_PIC'] = "invalid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = translate("NOT ENABLED");
}
// PHP version check
define('MIN_PHP_VERSION', '5.2.0');
$arrTemplate['CHECK_2_TEXT'] = translate("Version");
if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
$arrTemplate['CHECK_2_PIC'] = "valid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = translate("OK");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". PHP_VERSION ." ".translate("detected").")";
} else {
$arrTemplate['CHECK_2_PIC'] = "invalid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = "PHP ". PHP_VERSION ." ".translate("detected");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". MIN_PHP_VERSION ." ".translate("or greater is required").")";
$intError = 1;
}
// PHP modules / extensions
$strExtPath = ini_get('extension_dir');
$strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
$strHTML = "";
foreach ($arrRequiredExt as $key => $elem) {
if (extension_loaded($elem)) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
$intError = 1;
}
$strHTML .= "<br>\n";
}
$arrTemplate['CHECK_3_CONTENT_1'] = $strHTML;
$strHTML = "";
foreach ($arrOptionalExt as $key => $elem) {
if (extension_loaded($elem)) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart3.$key.$strHTMLPart6.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
//$intError = 1;
}
$strHTML .= "<br>\n";
}
$arrTemplate['CHECK_3_CONTENT_2'] = $strHTML;
// PHP database interfaces
$strHTML = "";
$intTemp = 0;
foreach ($arrSupportedDBs as $key => $elem) {
if (extension_loaded($elem)) {
$strNewInstallOnly = "";
if (($_SESSION['install']['dbtype'] != $elem) && ($_SESSION['install']['mode'] == "Update")) $strNewInstallOnly = " (".translate("New installation only - updates are only supported using the same database interface!").")";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span> $strNewInstallOnly\n";
$intTemp++;
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
}
$strHTML .= "<br>\n";
}
$arrTemplate['CHECK_4_CONTENT_1'] = $strHTML;
if ($intTemp == 0) $intError = 1;
// PHP ini checks
$strHTML = "";
foreach ($arrIniCheck as $key => $elem) {
$strStatus = ini_get($key);
if ($elem === '-NOTEMPTY-') {
if (empty($strStatus)) {
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".translate("cannot be empty and needs to be set").")</span>\n";
$intError = 1;
} else {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
}
} else {
if ($strStatus == $elem) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
} else {
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$status." (".translate("should be")." ".$elem.")</span>\n";
$intError = 1;
}
}
$strHTML .= "<br>\n";
}
$arrTemplate['CHECK_5_CONTENT_1'] = $strHTML;
// File access checks
$strConfigFile = "../config/settings.php";
if (file_exists($strConfigFile) && is_readable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.translate("Read test on settings file (config/settings.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile)&& !is_readable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart2.translate("Read test on settings file (config/settings.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
} elseif (!file_exists($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart3.translate("Settings file does not exists (config/settings.php)").$strHTMLPart6.translate("will be created")."</span><br>\n";
}
if(file_exists($strConfigFile) && is_writable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.translate("Write test on settings file (config/settings.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else if (is_writable("../config") && !file_exists($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.translate("Write test on settings directory (config/)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile) && !is_writable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.translate("Write test on settings file (config/settings.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
} else {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.translate("Write test on settings directory (config/)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strClassFile = "../functions/nag_class.php";
if(file_exists($strClassFile) && is_readable($strClassFile)) {
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart1.translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart2.translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../admin.php";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart1.translate("Read test on startsite file (admin.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart2.translate("Read test on startsite file (admin.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/index.tpl.htm";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart1.translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart2.translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/admin/admin_master.tpl.htm";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart1.translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart2.translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/files/contacts.tpl.dat";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart1.translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart2.translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../images/pixel.gif";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_8'] = $strHTMLPart1.translate("Read test on a image file (images/pixel.gif)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_9'] = $strHTMLPart2.translate("Read test on a image file (images/pixel.gif)").$strHTMLPart5.translate("failed")."</span><br>\n";
$intError = 1;
}
if ($intError != 0) {
$arrTemplate['MESSAGE'] = "<span class=\"red\">".translate("There are some errors - please check your system settings and read the requirements of NagiosQL!")."</span><br><br>\n";
$arrTemplate['MESSAGE'] .= translate("Read the INSTALLATION file from NagiosQL to find out, how to fix them.") ."<br>\n";
$arrTemplate['MESSAGE'] .= translate("After that - refresh this page to proceed") ."...<br>\n";
$arrTemplate['DIV_ID'] = "install-center";
$arrTemplate['FORM_CONTENT'] = "<input type=\"image\" src=\"images/reload.png\" title=\"refresh\" value=\"Submit\" alt=\"refresh\" onClick=\"window.location.reload()\"><br>";
$arrTemplate['FORM_CONTENT'] .= translate("Refresh")."\n";
} else {
$arrTemplate['MESSAGE'] = "<span class=\"green\">".translate("Environment test sucessfully passed")."</span><br><br>\n";
$arrTemplate['DIV_ID'] = "install-next";
$arrTemplate['FORM_CONTENT'] = "<input type=\"hidden\" name=\"hidStep\" id=\"hidStep\" value=\"2\">\n";
$arrTemplate['FORM_CONTENT'] .= "<input type=\"image\" src=\"images/next.png\" value=\"Submit\" title=\"next\" alt=\"next\"><br>".translate("Next")."\n";
}
//
// Write content
// =============
$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent);
echo $strContent;
?>

106
install/step2.php Normal file
View File

@@ -0,0 +1,106 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 2
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-23 11:44:55 +0100 (Thu, 23 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1239 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Prevent this file from direct access
// ====================================
if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) {
exit;
}
//
// Define common variables
// =======================
$preIncludeContent = "templates/step2.tpl.htm";
$intError = 0;
//
// Build content
// =============
$arrTemplate['PASSWD_MESSAGE'] = translate('The NagiosQL first passwords are not equal!');
$arrTemplate['FIELDS_MESSAGE'] = translate('Please fill in all fields marked with an *');
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP2_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Setup");
$arrTemplate['STEP2_TEXT1_1'] = translate("Please complete the form below. Mandatory fields marked <em>*</em>");
$arrTemplate['STEP2_TEXT2_1'] = translate("Database Configuration");
$arrTemplate['STEP2_TEXT2_2'] = translate("Database Type");
$arrTemplate['STEP2_VALUE2_2'] = htmlspecialchars($_SESSION['install']['dbtype'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_3'] = translate("Database Server");
$arrTemplate['STEP2_VALUE2_3'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_4'] = translate("Local hostname or IP address");
if (htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8') == "localhost") {
$arrTemplate['STEP2_VALUE2_4'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8');
}else {
$arrTemplate['STEP2_VALUE2_4'] = $_SERVER['SERVER_ADDR'];
}
$arrTemplate['STEP2_TEXT2_5'] = translate("Database Server Port");
$arrTemplate['STEP2_VALUE2_5'] = htmlspecialchars($_SESSION['install']['dbport'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_6'] = translate("Database name");
$arrTemplate['STEP2_VALUE2_6'] = htmlspecialchars($_SESSION['install']['dbname'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_7'] = translate("NagiosQL DB User");
$arrTemplate['STEP2_VALUE2_7'] = htmlspecialchars($_SESSION['install']['dbuser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_8'] = translate("NagiosQL DB Password");
$arrTemplate['STEP2_VALUE2_8'] = htmlspecialchars($_SESSION['install']['dbpass'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_9'] = translate("Administrative Database User");
$arrTemplate['STEP2_VALUE2_9'] = htmlspecialchars($_SESSION['install']['admuser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_10'] = translate("Administrative Database Password");
$arrTemplate['STEP2_TEXT2_11'] = translate("Drop database if already exists?");
if ($_SESSION['install']['dbdrop'] == 1) {$arrTemplate['STEP2_VALUE2_11'] = "checked";} else {$arrTemplate['STEP2_VALUE2_11'] = "";}
$arrTemplate['STEP2_TEXT3_1'] = translate("NagiosQL User Setup");
$arrTemplate['STEP2_TEXT3_2'] = translate("Initial NagiosQL User");
$arrTemplate['STEP2_VALUE3_2'] = htmlspecialchars($_SESSION['install']['qluser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT3_3'] = translate("Initial NagiosQL Password");
$arrTemplate['STEP2_VALUE3_3'] = htmlspecialchars($_SESSION['install']['qlpass'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT3_4'] = translate("Please repeat the password");
$arrTemplate['STEP2_TEXT4_1'] = translate("Nagios Configuration");
$arrTemplate['STEP2_TEXT4_2'] = translate("Import Nagios sample config?");
if ($_SESSION['install']['sample'] == 1) {$arrTemplate['STEP2_VALUE4_2'] = "checked";} else {$arrTemplate['STEP2_VALUE4_2'] = "";}
$arrTemplate['STEP2_FORM_1'] = translate("Next");
$arrTemplate['STEP2_TEXT5_1'] = translate("NagiosQL path values");
$arrTemplate['STEP2_TEXT5_2'] = translate("Create NagiosQL config paths?");
if ($_SESSION['install']['createpath'] == 1) {$arrTemplate['STEP2_VALUE5_2'] = "checked";} else {$arrTemplate['STEP2_VALUE5_2'] = "";}
$arrTemplate['STEP2_TEXT5_3'] = translate("NagiosQL config path");
$arrTemplate['STEP2_VALUE5_3'] = htmlspecialchars($_SESSION['install']['qlpath'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT5_4'] = translate("Nagios config path");
$arrTemplate['STEP2_VALUE5_4'] = htmlspecialchars($_SESSION['install']['nagpath'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT5_5'] = translate("Both path values were stored in your configuration target settings for localhost.");
$arrTemplate['STEP2_TEXT5_6'] = translate("If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)");
$arrTemplate['INSTALL_FIELDS'] = "";
//
// Setting some template values to blank
// =====================================
$arrTemplate['STEP2_TEXT1_2'] = "";
//
// Conditional checks
// =======================
if ($_SESSION['install']['mode'] == "Update") {
$arrTemplate['STEP2_TEXT1_2'] = "<p style=\"color:red;\"><b>".translate("Please backup your database before proceeding!")."</b></p>\n";
$arrTemplate['INST_VISIBLE'] = "hidefield";
} else {
$arrTemplate['INSTALL_FIELDS'] = ",tfDBprivUser,tfDBprivPass,tfQLuser,tfQLpass";
$arrTemplate['INST_VISIBLE'] = "showfield";
}
//
// Write content
// =============
$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent);
echo $strContent;
?>

226
install/step3.php Normal file
View File

@@ -0,0 +1,226 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 2
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-23 11:44:55 +0100 (Thu, 23 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1239 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Prevent this file from direct access
// ====================================
if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) {
exit;
}
//
// Define common variables
// =======================
$preIncludeContent = "templates/step3.tpl.htm";
$intError = 0;
if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
@date_default_timezone_set(@date_default_timezone_get());
}
//
// Build content
// =============
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP3_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Finishing Setup");
$arrTemplate['INST_VISIBLE'] = "showfield";
$arrTemplate['STEP4_SUB_TITLE'] = translate("Deploy NagiosQL settings");
$arrTemplate['STEP3_TEXT_01'] = translate("Database server connection (privileged user)");
$arrTemplate['STEP3_TEXT_03'] = translate("Database server version");
$arrTemplate['STEP3_TEXT_05'] = translate("Database server support");
$arrTemplate['STEP3_TEXT_07'] = translate("Delete existing NagiosQL database");
$arrTemplate['STEP3_TEXT_09'] = translate("Creating new database");
$arrTemplate['STEP3_TEXT_11'] = translate("Create NagiosQL database user");
$arrTemplate['STEP3_TEXT_13'] = translate("Installing NagiosQL database tables");
$arrTemplate['STEP3_TEXT_15'] = translate("Set initial NagiosQL Administrator");
$arrTemplate['STEP3_TEXT_17'] = translate("Database server connection (NagiosQL user)");
$arrTemplate['STEP4_TEXT_01'] = translate("Writing global settings to database");
$arrTemplate['STEP4_TEXT_03'] = translate("Writing database configuration to settings.php");
$arrTemplate['STEP4_TEXT_05'] = translate("Import Nagios sample data");
$arrTemplate['STEP4_TEXT_07'] = translate("Create and/or store NagiosQL path settings");
$arrTemplate['STEP4_VISIBLE'] = "hidefield";
$arrTemplate['STEP3_TEXT_03_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_05_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_07_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_09_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_11_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_13_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_15_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_17_SHOW'] = "hidefield";
$arrTemplate['STEP4_TEXT_03_SHOW'] = "hidefield";
$arrTemplate['STEP4_TEXT_05_SHOW'] = "hidefield";
$arrTemplate['STEP4_TEXT_07_SHOW'] = "hidefield";
//
// Doing installation/upgrade
// ==========================
if ($_SESSION['install']['mode'] == "Update") {
$arrTemplate['STEP3_SUB_TITLE'] = translate("Updating existing NagiosQL database");
if ($_SESSION['install']['dbtype'] == "mysql") {
// Check database connection
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
// Check NagiosQL version
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_03'] = translate("Installed NagiosQL version");
$arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->checkQLVersion($arrTemplate['STEP3_TEXT_04'],$strErrorMessage,$arrUpdate,$setQLVersion);
}
// Upgrade NagiosQL DB
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_05'] = translate("Upgrading from version")." ".$setQLVersion." ".translate("to")." ".$preNagiosQL_ver;
$arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield";
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$arrUpdate);
}
// Converting database to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_07'] = translate("Converting database to utf8 character set");
$arrTemplate['STEP3_TEXT_07_SHOW'] = "showfield";
$intError = $myInstClass->convQLDB($arrTemplate['STEP3_TEXT_08'],$strErrorMessage);
}
// Converting database tables to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_09'] = translate("Converting database tables to utf8 character set");
$arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield";
$intError = $myInstClass->convQLDBTables($arrTemplate['STEP3_TEXT_10'],$strErrorMessage);
}
// Converting database fields to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_11'] = translate("Converting database fields to utf8 character set");
$arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield";
$intError = $myInstClass->convQLDBFields($arrTemplate['STEP3_TEXT_12'],$strErrorMessage);
}
// Reconnect Database with new user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield";
$intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
$intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
}
// Deploy NagiosQL database settings
if ($intError == 0) {
$arrTemplate['STEP4_VISIBLE'] = "showfield";
$intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage);
}
// Write database settings to file
if ($intError == 0) {
$arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage);
}
}
} else {
$arrTemplate['STEP3_SUB_TITLE'] = translate("Create new NagiosQL database");
// Check database connection
$intOldDBStatus = 0;
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) {
$intOldDBStatus = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if (($intOldDBStatus == 0) && ($_SESSION['install']['dbdrop'] == 0)) {
$strErrorMessage .= translate("Database already exists and drop database was not selected, please correct or manage manually")."<br>";
$arrTemplate['STEP3_TEXT_02'] = "<span class=\"red\">".translate("failed")."</span>";
$intError = 1;
} else {
$arrTemplate['STEP3_TEXT_02'] = "<span class=\"green\">".translate("passed")."</span>";
}
}
// Check database version
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield";
$arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield";
$intError = $myInstClass->checkDBVersion($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$strVersion);
if ($strVersion == "unknown") {
$arrTemplate['STEP3_TEXT_04'] = "<span class=\"red\">".translate("unknown")."</span>";
} else {
$arrTemplate['STEP3_TEXT_04'] = "<span class=\"green\">".$strVersion."</span>";
}
}
// Drop existing database
if (($intError == 0) && ($_SESSION['install']['dbdrop'] == 1) && ($intOldDBStatus == 0)) {
$arrTemplate['STEP3_TEXT_07_SHOW'] = "showfield";
$intError = $myInstClass->dropDB($arrTemplate['STEP3_TEXT_08'],$strErrorMessage);
}
// Create new database
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield";
$intError = $myInstClass->createDB($arrTemplate['STEP3_TEXT_10'],$strErrorMessage);
}
// Grant NagiosQL database user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield";
$intError = $myInstClass->grantDBUser($arrTemplate['STEP3_TEXT_12'],$strErrorMessage);
}
// Write initial SQL data to database
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_13_SHOW'] = "showfield";
$arrInsert[] = $preSqlNewInstall;
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_14'],$strErrorMessage,$arrInsert);
}
// Create NagiosQL admin user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_15_SHOW'] = "showfield";
$intError = $myInstClass->createNQLAdmin($arrTemplate['STEP3_TEXT_16'],$strErrorMessage);
}
// Reconnect Database with new user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield";
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
}
// Deploy NagiosQL settings
if ($intError == 0) {
$arrTemplate['STEP4_VISIBLE'] = "showfield";
$intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage);
}
// Write database settings to file
if ($intError == 0) {
$arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage);
}
// Write sample data to database
if (($intError == 0) && ($_SESSION['install']['sample'] == 1)) {
$arrTemplate['STEP4_TEXT_05_SHOW'] = "showfield";
$arrSample[] = "sql/import_nagios_sample.sql";
$intError = $myInstClass->updateQLDB($arrTemplate['STEP4_TEXT_06'],$strErrorMessage,$arrSample);
}
// Create NagiosQL path and write path settings to the database
if ($intError == 0) {
$arrTemplate['STEP4_TEXT_07_SHOW'] = "showfield";
$intError = $myInstClass->updateQLpath($arrTemplate['STEP4_TEXT_08'],$strErrorMessage);
}
}
if ($intError != 0) {
$arrTemplate['ERRORMESSAGE'] = "<p style=\"color:#F00;margin-top:0px;font-weight:bold;\">".$strErrorMessage."</p>\n";
$arrTemplate['INFO_TEXT'] = "";
$arrTemplate['BUTTON'] = "<div id=\"install-back\">\n";
$arrTemplate['BUTTON'] .= "<input type='hidden' name='hidStep' id='hidStep' value='2' />\n";
$arrTemplate['BUTTON'] .= "<input type='image' src='images/previous.png' value='Submit' alt='Submit' /><br />".translate("Back")."\n";
$arrTemplate['BUTTON'] .= "</div>\n";
} else {
$arrTemplate['ERRORMESSAGE'] = "";
$arrTemplate['INST_VISIBLE'] = "showfield";
$arrTemplate['INFO_TEXT'] = translate("Please delete the install directory to continue!");
$arrTemplate['BUTTON'] = "<div id=\"install-next\">\n";
$arrTemplate['BUTTON'] .= "<a href='../index.php'><img src='images/next.png' alt='finish' title='finish' border='0' /></a><br />".translate("Finish")."\n";
$arrTemplate['BUTTON'] .= "</div>\n";
}
//
// Write content
// =============
$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent);
echo $strContent;
?>

93
install/templates/index.tpl.htm Executable file
View File

@@ -0,0 +1,93 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer main template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{PAGETITLE}</title>
<link href="css/install.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="page_margins">
<div id="page">
<div id="header">
<div id="header-logo">
<a href="index.php"><img src="images/nagiosql.png" border="0" alt="NagiosQL"></a>
</div>
<div id="documentation">
<a href='http://www.nagiosql.org/faq/' target='_blank'>{NAGIOS_FAQ}</a>
</div>
<div id="langselector">
<form action="" name="frmLanguage" id="frmLanguage" method="post">
{LANGUAGE} :
<select name="selLanguage" onchange="document.frmLanguage.submit();">
{LANG_OPTION}
</select>
</form>
</div>
</div>
<div id="main">
<div id="indexmain">
<div id="indexmain_content">
<h1>{MAIN_TITLE}</h1>
<center>{TEXT_PART_1}<br>{TEXT_PART_2}<a href="http://www.nagiosql.org" target="_blank">www.nagiosql.org</a></center>
<br>
<p>{TEXT_PART_3}</p>
<p>{TEXT_PART_4}</p>
<ul>
<li>{TEXT_PART_5}</li>
<ul>
<li>{TEXT_PHP_REQ_1}</li>
<li>{TEXT_PHP_REQ_2}</li>
<li>{TEXT_PHP_REQ_3}</li>
<!--<li>{TEXT_PHP_REQ_4}</li>-->
<!--<li>{TEXT_PHP_REQ_5}</li>-->
<li>{TEXT_PHP_REQ_6}</li>
<!--<li>{TEXT_PHP_REQ_7}</li>-->
<li>{TEXT_PHP_REQ_8}</li>
<li>{TEXT_PHP_REQ_9}</li>
<li>{TEXT_PHP_REQ_10}</li>
</ul>
</ul>
<ul>
<li>{TEXT_PART_6}</li>
<ul>
<li>{TEXT_INI_REQ_1}</li>
<li>{TEXT_INI_REQ_2}</li>
</ul>
</ul>
<ul>
<li>{TEXT_PART_7}</li>
<li>{TEXT_PART_8}</li>
</ul>
{UPDATE_ERROR}
<form name="frmInstall" id="frmInstall" action="install.php" method="post">
<input type="hidden" name="hidLocale" value="{LOCALE}">
<input type="hidden" name="hidStep" value="1">
<input type="hidden" name="hidJScript" value="">
<p><input type="submit" name="butNewInstall" id="butNewInstall" value="{NEW_INSTALLATION}" {DISABLE_NEW}>
<input type="submit" name="butUpgrade" id="butUpgrade" value="{UPDATE}" {DISABLE_UPDATE}></p>
<p><a href='http://www.nagiosql.org/faq.html' target='_blank'>{ONLINE_DOC}</a></p>
</form>
</div>
</div>
<div id="footer">
<a href='http://www.nagiosql.org' target='_blank'>NagiosQL</a> <?php echo BASE_VERSION; ?>
</div>
</div>
</div>
</div>
<script language="JavaScript">
<!--
document.frmInstall.hidJScript.value = 'yes';
//-->
</script>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{PAGETITLE}</title>
<link href="css/install.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="page_margins">
<div id="page">
<div id="header">
<div id="header-logo">
<a href="index.php"><img src="images/nagiosql.png" border="0" alt="NagiosQL Logo" title="NagiosQL Logo"></a>
</div>
<div id="documentation">
<a href="http://www.nagiosql.org/faq.html" target="_blank"><?php echo translate("Online Documentation"); ?></a>
</div>
</div>
<div id="main">
{CONTENT}
</div>
<div id="footer">
<a href='http://www.nagiosql.org' target='_blank'>NagiosQL</a> <?php echo BASE_VERSION; ?>
</div>
</div>
</div>
</body>
</html>

54
install/templates/step1.tpl.htm Executable file
View File

@@ -0,0 +1,54 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<div id="installmenu">
<div id="installmenu_content">
<p class="step1_active"><br><br>{STEP1_BOX}</p>
<p class='step2_active'><a href='install.php?step=2'><br><br>{STEP2_BOX}</a></p>
<p class='step3_active'><a href='install.php?step=3'><br><br>{STEP3_BOX}</a></p>
</div>
</div>
<div id="installmain">
<div id="installmain_content">
<h1>{STEP1_TITLE}</h1>
<h3>{STEP1_SUBTITLE1}</h3>
<img src='images/{CHECK_1_PIC}.png' alt='{CHECK_1_PIC}' title='{CHECK_1_PIC}' class='textmiddle'> Javascript: <span class='{CHECK_1_CLASS}'>{CHECK_1_VALUE}</span>
<h3>{STEP1_SUBTITLE2}</h3>
<img src='images/{CHECK_2_PIC}.png' alt='{CHECK_2_PIC}' title='{CHECK_2_PIC}' class='textmiddle'> {CHECK_2_TEXT}: <span class='{CHECK_2_CLASS}'>{CHECK_2_VALUE}</span> {CHECK_2_INFO}
<h3>{STEP1_SUBTITLE3}</h3>
<p class='hint'>{STEP1_TEXT3_1}:</p>
{CHECK_3_CONTENT_1}
<p class='hint'>{STEP1_TEXT3_2}:</p>
{CHECK_3_CONTENT_2}
<h3>{STEP1_SUBTITLE4}</h3>
<p class='hint'>{STEP1_TEXT4_1}:</p>
{CHECK_4_CONTENT_1}
<h3>{STEP1_SUBTITLE5}</h3>
<p class='hint'>{STEP1_TEXT5_1}:</p>
{CHECK_5_CONTENT_1}
<h3>{STEP1_SUBTITLE6}</h3>
{CHECK_6_CONTENT_1}
{CHECK_6_CONTENT_2}
{CHECK_6_CONTENT_3}
{CHECK_6_CONTENT_4}
{CHECK_6_CONTENT_5}
{CHECK_6_CONTENT_6}
{CHECK_6_CONTENT_7}
{CHECK_6_CONTENT_8}
<br>
{MESSAGE}
<br>
<div id="{DIV_ID}">
<form name="frmStep1" id="frmStep1" action="install.php" method="post">
{FORM_CONTENT}
</form>
</div>
</div>
</div>
<div id="ie_clearing"> </div>

157
install/templates/step2.tpl.htm Executable file
View File

@@ -0,0 +1,157 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<script language="JavaScript" type="text/JavaScript">
<!--
// Send form
function LockButton() {
if (checkForm() == false) {
return false;
} else {
// Submit form
document.frmSetup.submit();
document.frmSetup.subForm.disabled = true;
}
}
// Check form entries
function checkForm() {
// Are all required fields filled in?
var fields = "tfDBserver,tfLocalSrv,tfDBport,tfDBname,tfDBuser,tfDBpass{INSTALL_FIELDS}";
var form = document.frmSetup;
var error = false;
var ar_field = fields.split(",");
for (i=0;i<ar_field.length;i++){
if (form[ar_field[i]].value == "") {
alert("{FIELDS_MESSAGE}");
form[ar_field[i]].focus();
return false;
break;
}
}
if (form.tfQLpass.value != form.tfQLpassrepeat.value) {
alert("PASSWORD_MESSAGE");
return false;
}
return true;
}
//-->
</script>
<div id="installmenu">
<div id="installmenu_content">
<p class="step1_active"><a href='install.php?step=1'><br><br>{STEP1_BOX}</a></p>
<p class='step2_active'><br><br>{STEP2_BOX}</p>
<p class='step3_active'><a href='install.php?step=3'><br><br>{STEP3_BOX}</a></p>
</div>
</div>
<div id="installmain">
<div id="installmain_content">
<h1>{STEP2_TITLE}</h1>
<form name="frmSetup" id="frmSetup" action="install.php" method="post" class="cmxform">
<p class='hint'>{STEP2_TEXT1_1}:</p>
{STEP2_TEXT1_2}
<fieldset>
<legend><b>{STEP2_TEXT2_1}</b></legend>
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td style="width:250px;">{STEP2_TEXT2_2}</td>
<td><input type="text" name="tfDBtype" id="tfDBtype" class="locked" value="{STEP2_VALUE2_2}" disabled="disabled"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_3} <em>*</em></td>
<td><input type="text" name="tfDBserver" id="tfDBserver" class="required" value="{STEP2_VALUE2_3}"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_4} <em>*</em></td>
<td><input type="text" name="tfLocalSrv" id="tfLocalSrv" class="required" value="{STEP2_VALUE2_4}"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_5} <em>*</em></td>
<td><input type="text" name="tfDBport" id="tfDBport" class="required" value="{STEP2_VALUE2_5}"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_6} <em>*</em></td>
<td><input type="text" name="tfDBname" id="tfDBname" class="required" value="{STEP2_VALUE2_6}"></td>
</tr>
<tr class="{INST_VISIBLE}">
<td>{STEP2_TEXT2_7} <em>*</em></td>
<td><input type="text" name="tfDBuser" id="tfDBuser" class="required" value="{STEP2_VALUE2_7}"></td>
</tr>
<tr class="{INST_VISIBLE}">
<td>{STEP2_TEXT2_8} <em>*</em></td>
<td><input type="password" name="tfDBpass" id="tfDBpass" class="required" value="{STEP2_VALUE2_8}"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_9} <em>*</em></td>
<td><input type="text" name="tfDBprivUser"id="tfDBprivUser" class="required" value="{STEP2_VALUE2_9}" size="19"></td>
</tr>
<tr>
<td>{STEP2_TEXT2_10} <em>*</em></td>
<td><input name="tfDBprivPass" id="tfDBprivPass" class="required" type="password"></td>
</tr>
<tr class="{INST_VISIBLE}">
<td>{STEP2_TEXT2_11}</td>
<td><input type="checkbox" name="chbDrop" id="chbDrop" value="1" {STEP2_VALUE2_11}></td>
</tr>
</table>
</fieldset>
<fieldset class="{INST_VISIBLE}">
<legend><b>{STEP2_TEXT3_1}</b></legend>
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td style="width:250px;">{STEP2_TEXT3_2} <em>*</em></td>
<td><input type="text" name="tfQLuser" id="tfQLuser" class="required" value="{STEP2_VALUE3_2}" size="15"></td>
</tr>
<tr>
<td>{STEP2_TEXT3_3} <em>*</em></td>
<td><input type="password" class="required" name="tfQLpass" id="tfQLpass" value="{STEP2_VALUE3_3}" size="15"></td>
</tr>
<tr>
<td>{STEP2_TEXT3_4} <em>*</em></td>
<td><input type="password" class="required" name="tfQLpassrepeat" id="tfQLpassrepeat" size="15"></td>
</tr>
</table>
</fieldset>
<fieldset class="{INST_VISIBLE}">
<legend><b>{STEP2_TEXT4_1}</b></legend>
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td style="width:250px;">{STEP2_TEXT4_2} </td>
<td><input type="checkbox" name="chbSample" id="chbSample" value="1" {STEP2_VALUE4_2}></td>
</tr>
</table>
</fieldset>
<fieldset class="{INST_VISIBLE}">
<legend><b>{STEP2_TEXT5_1}</b></legend>
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td style="width:250px;">{STEP2_TEXT5_2}</td>
<td><input type="checkbox" name="chbPath" id="chbPath" value="1" {STEP2_VALUE5_2}></td>
</tr>
<tr>
<td>{STEP2_TEXT5_3}</td>
<td><input type="text" name="tfQLpath" id="tfQLpath" value="{STEP2_VALUE5_3}" size="15"></td>
</tr>
<tr>
<td>{STEP2_TEXT5_4}</td>
<td><input type="text" name="tfNagiosPath" id="tfNagiosPath" value="{STEP2_VALUE5_4}" size="15"></td>
</tr>
<tr>
<td colspan="2" style="padding-top:5px;">{STEP2_TEXT5_5}<br>{STEP2_TEXT5_6}</td>
</tr>
</table>
</fieldset>
<br>
<div id="install-next">
<input type="hidden" name="hidStep" value="3">
<img src="images/next.png" onClick="LockButton()" alt="{STEP2_FORM_1}" title="{STEP2_FORM_1}" style="cursor:pointer"><br>{STEP2_FORM_1}
</div>
</form>
</div>
</div>
<div id="ie_clearing"> </div>

90
install/templates/step3.tpl.htm Executable file
View File

@@ -0,0 +1,90 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<div id="installmenu">
<div id="installmenu_content">
<p class="step1_active"><a href='install.php?step=1'><br><br>{STEP1_BOX}</a></p>
<p class='step2_active'><a href='install.php?step=2'><br><br>{STEP2_BOX}</a></p>
<p class='step3_active'><br><br>{STEP3_BOX}</p>
</div>
</div>
<div id="installmain">
<div id="installmain_content">
<h1>{STEP3_TITLE}</h1>
<form name="frmSetup" id="frmSetup" action="install.php" method="post" class="cmxform">
<fieldset>
<legend><b>{STEP3_SUB_TITLE}</b></legend>
{ERRORMESSAGE}
<table cellpadding="0" cellspacing="1" border="0" class="{INST_VISIBLE}">
<tr>
<td valign="top" style="width:350px;"><label>{STEP3_TEXT_01}</label></td>
<td>{STEP3_TEXT_02}</td>
</tr>
<tr class="{STEP3_TEXT_03_SHOW}">
<td valign="top"><label>{STEP3_TEXT_03}</label></td>
<td>{STEP3_TEXT_04}</td>
</tr>
<tr class="{STEP3_TEXT_05_SHOW}">
<td valign="top"><label>{STEP3_TEXT_05}</label></td>
<td>{STEP3_TEXT_06}</td>
</tr>
<tr class="{STEP3_TEXT_07_SHOW}">
<td valign="top"><label>{STEP3_TEXT_07}</label></td>
<td>{STEP3_TEXT_08}</td>
</tr>
<tr class="{STEP3_TEXT_09_SHOW}">
<td valign="top"><label>{STEP3_TEXT_09}</label></td>
<td>{STEP3_TEXT_10}</td>
</tr>
<tr class="{STEP3_TEXT_11_SHOW}">
<td valign="top"><label>{STEP3_TEXT_11}</label></td>
<td>{STEP3_TEXT_12}</td>
</tr>
<tr class="{STEP3_TEXT_13_SHOW}">
<td valign="top"><label>{STEP3_TEXT_13}</label></td>
<td>{STEP3_TEXT_14}</td>
</tr>
<tr class="{STEP3_TEXT_15_SHOW}">
<td valign="top"><label>{STEP3_TEXT_15}</label></td>
<td>{STEP3_TEXT_16}</td>
</tr>
<tr class="{STEP3_TEXT_17_SHOW}">
<td valign="top"><label>{STEP3_TEXT_17}</label></td>
<td>{STEP3_TEXT_18}</td>
</tr>
</table>
</fieldset>
<br>
<fieldset class="{STEP4_VISIBLE}">
<legend><b>{STEP4_SUB_TITLE}</b></legend>
<table cellpadding="0" cellspacing="1" border="0" class="{STEP4_VISIBLE}">
<tr>
<td valign="top" style="width:350px;"><label>{STEP4_TEXT_01}</label></td>
<td>{STEP4_TEXT_02}</td>
</tr>
<tr class="{STEP4_TEXT_03_SHOW}">
<td valign="top"><label>{STEP4_TEXT_03}</label></td>
<td>{STEP4_TEXT_04}</td>
</tr>
<tr class="{STEP4_TEXT_05_SHOW}">
<td valign="top"><label>{STEP4_TEXT_05}</label></td>
<td>{STEP4_TEXT_06}</td>
</tr>
<tr class="{STEP4_TEXT_07_SHOW}">
<td valign="top"><label>{STEP4_TEXT_07}</label></td>
<td>{STEP4_TEXT_08}</td>
</tr>
</table>
</fieldset>
<p style="color:red; font-weight:bold;">{INFO_TEXT}</p>
{BUTTON}
</form>
</div>
</div>
<div id="ie_clearing"> </div>