2007-02-19 Sancho Leren <slerena@openideas.info>
* include/styles/pandora.css: Updated to have new styles for installer. * include/config.inc.php: New skeleton for config, used in wizard. * install.php: NEW wizar/installer for console. * index.php: Some modifications for main page. * operation/incidents/incide*: Some header changes. * operation/active_console/index.php: Header changes. * images/*: New images for wizard. * general/error_*.php: New messages for wizard. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@378 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
09e615055f
commit
36934a367c
pandora_console
|
@ -1,3 +1,22 @@
|
|||
2007-02-19 Sancho Leren <slerena@openideas.info>
|
||||
|
||||
* include/styles/pandora.css: Updated to have new styles for
|
||||
installer.
|
||||
|
||||
* include/config.inc.php: New skeleton for config, used in wizard.
|
||||
|
||||
* install.php: NEW wizar/installer for console.
|
||||
|
||||
* index.php: Some modifications for main page.
|
||||
|
||||
* operation/incidents/incide*: Some header changes.
|
||||
|
||||
* operation/active_console/index.php: Header changes.
|
||||
|
||||
* images/*: New images for wizard.
|
||||
|
||||
* general/error_*.php: New messages for wizard.
|
||||
|
||||
2007-02-19 Sancho Lerena <slerena@openideas.info>
|
||||
|
||||
* operation/incidents/incident.php: Pagination finished.
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
include "include/config.php";
|
||||
if (file_exists("include/languages/language_".$language_code.".php")) {
|
||||
include "include/languages/language_".$language_code.".php";
|
||||
} else {
|
||||
include "include/languages/language_en.php";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Pandora FMS - <?php echo $lang_label["header_title"]; ?></title>
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
|
||||
<meta name="resource-type" content="document">
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="author" content="Sancho Lerena, Raul Mateos">
|
||||
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
|
||||
<meta name="keywords" content="pandora, monitoring, system, GPL, software">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="icon" href="images/pandora.ico" type="image/ico">
|
||||
<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">
|
||||
</head>
|
||||
<body background='images/backgrounds/<?php echo $config_bgimage; ?>'>
|
||||
<div align='center'>
|
||||
<div id='login_f'>
|
||||
<h1 id="log_f" class="error">Installer active</h1>
|
||||
<div>
|
||||
<img src="images/logo_login.gif" border="0"></a><br><font size="1">
|
||||
<?php echo $pandora_version; ?>
|
||||
</font>
|
||||
</div>
|
||||
<div class="msg"><br><br>For security reasons, normal operation is not possible until you delete installer file. Please delete <b>./install.php</b> file before running Pandora FMS Console.</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
include "include/config.php";
|
||||
if (file_exists("include/languages/language_".$language_code.".php")) {
|
||||
include "include/languages/language_".$language_code.".php";
|
||||
} else {
|
||||
include "include/languages/language_en.php";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Pandora FMS - <?php echo $lang_label["header_title"]; ?></title>
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
|
||||
<meta name="resource-type" content="document">
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="author" content="Sancho Lerena, Raul Mateos">
|
||||
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
|
||||
<meta name="keywords" content="pandora, monitoring, system, GPL, software">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="icon" href="images/pandora.ico" type="image/ico">
|
||||
<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">
|
||||
</head>
|
||||
<body background='images/backgrounds/<?php echo $config_bgimage; ?>'>
|
||||
<div align='center'>
|
||||
<div id='login_f'>
|
||||
<h1 id="log_f" class="error">Bad permission for include/config.php</h1>
|
||||
<div>
|
||||
<img src="images/logo_login.gif" border="0"></a><br><font size="1">
|
||||
<?php echo $pandora_version; ?>
|
||||
</font>
|
||||
</div>
|
||||
<div class="msg"><br><br>For security reasons, <i>config.php</i> must have restrictive permissions, and "other" users cannot read or write to it. It could be writed only for owner (usually www-data or http daemon user), normal operation is not possible until you change permissions for <i>include/config.php</i>file. Please do it, it's for your security.</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After ![]() (image error) Size: 473 B |
Binary file not shown.
After ![]() (image error) Size: 226 B |
Binary file not shown.
After ![]() (image error) Size: 226 B |
Binary file not shown.
After ![]() (image error) Size: 258 B |
Binary file not shown.
After ![]() (image error) Size: 266 B |
Binary file not shown.
After ![]() (image error) Size: 250 B |
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
// This is the base config file
|
||||
|
||||
//Pandora Version
|
||||
$build_version="PC080105"; //PCyymmdd
|
||||
$pandora_version="v1.3 devel";
|
||||
|
||||
// Database configuration (default ones)
|
||||
//$dbname="pandora"; // MySQL DataBase
|
||||
//$dbuser="pandora"; // DB User
|
||||
//$dbpassword="pandora"; // Password
|
||||
//$dbhost="localhost"; // MySQL Host
|
||||
|
||||
// This is used for reporting, please add "/" character at the end
|
||||
//$config_homedir = "/var/www/babel_console/";
|
||||
|
||||
// Do not display any ERROR
|
||||
//error_reporting(0);
|
||||
|
||||
// Display ALL errors
|
||||
error_reporting(E_ALL);
|
||||
|
||||
//This is directory where placed "attachment" directory, to upload files stores.
|
||||
// This MUST be writtable by http server user, and should be in pandora root.
|
||||
// Please append "/" to the end.
|
||||
$attachment_store=$config_homedir;
|
||||
|
||||
// Default font used for graphics (a Free TrueType font included with Pandora FMS)
|
||||
$config_fontpath = $config_homedir."reporting/FreeSans.ttf";
|
||||
|
||||
// Read remaining config tokens from DB
|
||||
if (! mysql_connect($dbhost,$dbuser,$dbpassword)){
|
||||
|
||||
//Non-persistent connection. If you want persistent conn change it to mysql_pconnect()
|
||||
exit ('<html><head><title>Pandora Error</title>
|
||||
<link rel="stylesheet" href="./include/styles/pandora.css" type="text/css">
|
||||
</head><body><div align="center">
|
||||
<div id="db_f">
|
||||
<div>
|
||||
<a href="index.php"><img src="images/logo_menu.gif" border="0"></a>
|
||||
</div>
|
||||
<div id="db_ftxt">
|
||||
<h1 id="db_fh1" class="error">Pandora Console Error DB-001</h1>
|
||||
Cannot connect with Database, please check your database setup in the
|
||||
<b>./include/config.php</b> file and read documentation.<i><br><br>
|
||||
Probably any of your user/database/hostname values are incorrect or
|
||||
database is not running.</i><br><br><font class="error">
|
||||
<b>MySQL ERROR:</b> '. mysql_error().'</font>
|
||||
<br>
|
||||
</div>
|
||||
</div></body></html>');
|
||||
}
|
||||
mysql_select_db($dbname);
|
||||
$result2=mysql_query("SELECT * FROM tconfig");
|
||||
while ($row2=mysql_fetch_array($result2)){
|
||||
switch ($row2["token"]) {
|
||||
case "language_code": $language_code=$row2["value"];
|
||||
break;
|
||||
case "block_size": $block_size=$row2["value"];
|
||||
break;
|
||||
case "days_purge": $days_purge=$row2["value"];
|
||||
break;
|
||||
case "days_compact": $days_compact=$row2["value"];
|
||||
break;
|
||||
case "graph_res": $config_graph_res=$row2["value"];
|
||||
break;
|
||||
case "step_compact": $config_step_compact=$row2["value"];
|
||||
break;
|
||||
case "truetype": $config_truetype=$row2["value"];
|
||||
break;
|
||||
case "graph_order": $config_graph_order=$row2["value"];
|
||||
break;
|
||||
case "bgimage": $config_bgimage=$row2["value"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($language_code == 'ast_es') {
|
||||
$help_code='ast';
|
||||
}
|
||||
else $help_code = substr($language_code,0,2);
|
||||
|
||||
?>
|
||||
|
|
@ -420,4 +420,24 @@ div.nf {
|
|||
color: #9a2f0a;
|
||||
margin-left: 7px;
|
||||
padding: 2px 1px 6px 25px;
|
||||
}
|
||||
div#wizard {
|
||||
text-align: left;
|
||||
border: 1px solid #999999;
|
||||
margin-top: 3em;
|
||||
margin-bottom: -1em;
|
||||
padding: 20px;
|
||||
width: 600px;
|
||||
background-color: #fff;
|
||||
background: url(../../images/background8.jpg);
|
||||
}
|
||||
.mt35 {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
div#install_box {
|
||||
float: right;
|
||||
padding-right: 20px;
|
||||
margin-top: 10px;
|
||||
width: 350px;
|
||||
}
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -18,11 +20,24 @@
|
|||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Pandora FMS 1.x uses icons from famfamfam, licensed under CC Atr. 2.5
|
||||
// Silk icon set 1.3
|
||||
// (cc) Mark James, http://www.famfamfam.com/lab/icons/silk/
|
||||
// Silk icon set 1.3 (cc) Mark James, http://www.famfamfam.com/lab/icons/silk/
|
||||
|
||||
// Pandora FMS shares much of it's code with project Babel Enterprise, also a
|
||||
// FreeSoftware Project coded by some of the people who makes Pandora FMS
|
||||
|
||||
// If no config file, automatically try to install
|
||||
if (! file_exists("include/config.php")){
|
||||
include ("install.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check for installer presence
|
||||
if (file_exists("install.php")){
|
||||
include "general/error_install.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Pandora FMS 1.x uses Pear Image::Graph code
|
||||
|
||||
session_start();
|
||||
include "include/config.php";
|
||||
include "include/languages/language_".$language_code.".php";
|
||||
|
|
|
@ -0,0 +1,433 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Pandora FMS - Installation Wizard</title>
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
|
||||
<meta name="resource-type" content="document">
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="author" content="Sancho Lerena, Raul Mateos">
|
||||
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
|
||||
<meta name="keywords" content="pandora, fms, monitoring, network, system, GPL, software">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="icon" href="images/pandora.ico" type="image/ico">
|
||||
<link rel="stylesheet" href="include/styles/pandora.css" type="text/css">
|
||||
</head>
|
||||
<body background='images/backgrounds/background11.jpg'>
|
||||
<?PHP
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
function install_step1() {
|
||||
echo "
|
||||
<div align='center' class='mt35'>
|
||||
<h1>Pandora FMS instalation wizard. Step #1 of 4</h1>
|
||||
<div id='wizard' style='height: 300px;'>
|
||||
<div id='install_box'>
|
||||
<h1>Welcome to Pandora FMS installation Wizard</h1>
|
||||
<p>This wizard helps you to quick install Pandora FMS console in your system.</p>
|
||||
<p>In three steps checks all dependencies and make your configuration for a quick installation.</p>
|
||||
<p>For more information, please refer to documentation.</p>
|
||||
<i>Pandora FMS Development team</i>
|
||||
";
|
||||
if (file_exists("include/config.php")){
|
||||
echo "<p><img src='images/info.gif'> Warning: You already have a config.php file. Configuracion and database would be overwritten if you continue.</p>";
|
||||
}
|
||||
echo "
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/logo_login.gif' border='0'><br>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/step0.png' border='0'>
|
||||
</div>
|
||||
<div id='install_box' style='margin-bottom: 25px;margin-left: 25px;'>
|
||||
<a href='install.php?step=2'><img align='right' src='images/arrow_next.png' border=0></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id='foot'>
|
||||
<i>Pandora FMS is a Free Software project registered at
|
||||
<a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
function check_extension ( $ext, $label ){
|
||||
echo "<tr><td>";
|
||||
echo "<img src='images/arrow.gif'> $label";
|
||||
echo "</td><td>";
|
||||
if (!extension_loaded($ext)){
|
||||
echo "<img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
} else {
|
||||
echo "<img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
function check_include ( $ext, $label ){
|
||||
echo "<tr><td>";
|
||||
echo "<img src='images/arrow.gif'> $label";
|
||||
echo "</td><td>";
|
||||
if (!include($ext)){
|
||||
echo "<img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
} else {
|
||||
echo "<img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
function check_exists ( $file, $label ){
|
||||
echo "<tr><td>";
|
||||
echo "<img src='images/arrow.gif'> $label";
|
||||
echo "</td><td>";
|
||||
if (!file_exists ($file)){
|
||||
echo " <img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
} else {
|
||||
echo " <img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
function check_generic ( $ok, $label ){
|
||||
echo "<tr><td>";
|
||||
echo "<img src='images/arrow.gif'> $label";
|
||||
echo "</td><td>";
|
||||
if ($ok == 0 ){
|
||||
echo " <img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
} else {
|
||||
echo " <img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
function check_variable ( $var, $value, $label, $mode ){
|
||||
echo "<tr><td>";
|
||||
echo "<img src='images/arrow.gif'> $label";
|
||||
echo "</td><td>";
|
||||
if ($mode == 1){
|
||||
if ($var >= $value){
|
||||
echo " <img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
} else {
|
||||
echo " <img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
}
|
||||
} elseif ($var == $value){
|
||||
echo " <img src='images/dot_green.gif'>";
|
||||
return 0;
|
||||
} else {
|
||||
echo " <img src='images/dot_red.gif'>";
|
||||
return 1;
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
function install_step2() {
|
||||
echo "
|
||||
<div align='center' class='mt35'>
|
||||
<h1>Pandora FMS console instalation wizard. Step #2 of 4</h1>
|
||||
<div id='wizard' style='height: 250px;'>
|
||||
<div id='install_box'>";
|
||||
echo "<h1>Checking software dependencies</h1>";
|
||||
echo "<table border=0 width=230>";
|
||||
$res = 0;
|
||||
$res += check_variable(phpversion(),"4.3","PHP version >= 4.3.x",1);
|
||||
$res += check_extension("mysql","PHP MySQL extension");
|
||||
//$res += check_extension("curl","PHP Curl extension");
|
||||
$res += check_extension("gd","PHP gd extension");
|
||||
$res += check_extension("snmp","PHP smmp extension");
|
||||
$res += check_extension("session","PHP session extension");
|
||||
$res += check_include("PEAR.php","PEAR PHP Library");
|
||||
//$res += check_exists ("/usr/bin/pdflatex","PDF Latex in /usr/bin/pdflatex");
|
||||
echo "</table>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/logo_login.gif' border='0'' alt=''>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/step1.png' border='0' alt=''>
|
||||
</div>
|
||||
<div id='install_box' style='margin-bottom: 25px;margin-left: 25px;'>";
|
||||
if ($res > 0) {
|
||||
echo "<p><img src='images/info.gif'> You have some uncomplete
|
||||
dependencies. Please correct it or this installer
|
||||
could not finish your installation.
|
||||
</p>
|
||||
Ignore it. <a href='install.php?step=3'>Force install Step #3</a>";
|
||||
} else {
|
||||
echo "<a href='install.php?step=3'><img align='right' src='images/arrow_next.png' border=0 alt=''></a>";
|
||||
}
|
||||
echo "
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='foot'>";
|
||||
echo '<i>Pandora FMS is a Free Software project registered at <a target="_new" href="http://pandora.sourceforge.net">SourceForge</a></i>';
|
||||
echo "</div></div>";
|
||||
}
|
||||
|
||||
function install_step3() {
|
||||
echo "
|
||||
<div align='center' class='mt35'>
|
||||
<h1>Pandora FMS console instalation wizard. Step #3 of 4 </h1>
|
||||
<div id='wizard' style='height: 500px;'>
|
||||
<div id='install_box'>
|
||||
<h1>Environment and database setup</h1>
|
||||
<p>
|
||||
This wizard will create your Pandora FMS database, and populate it with data needed to run for first time.
|
||||
You need a privileged user to create database schema, this is usually root user.
|
||||
Information about <i>root</i> user will not be used or stored for anymore.
|
||||
</p>
|
||||
<p>
|
||||
Now, please, complete all details to configure your database and enviroment setup
|
||||
</p>
|
||||
<form method='post' action='install.php?step=4'>
|
||||
<div>DB User with privileges on MySQL</div>
|
||||
<input class='login' type='text' name='user' value=''>
|
||||
<div>DB Password for this user</div>
|
||||
<input class='login' type='passwordzx' name='pass' value=''>
|
||||
<div>DB Hostname of MySQL</div>
|
||||
<input class='login' type='text' name='host' value=''>
|
||||
|
||||
<div>Full path to HTTP publication directory.<br>
|
||||
<span class='f9b'>For example /srv/www/hdtocs/</span>
|
||||
</div>
|
||||
<input class='login' type='text' name='path' style='width: 190px;' value=''>
|
||||
|
||||
<div>Full local URL to Pandora FMS Console. <br>
|
||||
<span class='f9b'>For example http://localhost/pandora_console</span>
|
||||
</div>
|
||||
<input class='login' type='text' name='url' style='width: 250px;' value=''>
|
||||
|
||||
<div><input align='right' style='align: right; width:70px; height: 16px;' type='image' src='images/arrow_next.png' value='Step #4'></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/logo_login.gif' border='0' alt=''>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/step2.png' border='0' alt=''>
|
||||
</div>
|
||||
</div>
|
||||
<div id='foot'>
|
||||
<i>Pandora FMS is a Free Software project registered at
|
||||
<a target='_ne' href='http://pandora.sourceforge.net'>SourceForge</a></i>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
function parse_mysql_dump($url){
|
||||
if (file_exists($url)){
|
||||
$file_content = file($url);
|
||||
$query = "";
|
||||
foreach($file_content as $sql_line){
|
||||
if(trim($sql_line) != "" && strpos($sql_line, "--") === false){
|
||||
$query .= $sql_line;
|
||||
if(preg_match("/;[\040]*\$/", $sql_line)){
|
||||
if (!$result = mysql_query($query))
|
||||
return 0;
|
||||
$query = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function random_name ($size){
|
||||
$temp = "";
|
||||
for ($a=0;$a< $size;$a++)
|
||||
$temp = $temp. chr(rand(122,97));
|
||||
return $temp;
|
||||
}
|
||||
|
||||
function install_step4() {
|
||||
$db_name = "pandora";
|
||||
$pandora_config = "include/config.php";
|
||||
|
||||
if ( (! isset($_POST["user"])) || (! isset($_POST["host"])) || (! isset($_POST["pass"])) ) {
|
||||
$dbpassword = "";
|
||||
$dbuser = "";
|
||||
$dbhost = "";
|
||||
} else {
|
||||
$dbpassword = $_POST["pass"];
|
||||
$dbuser = $_POST["user"];
|
||||
$dbhost = $_POST["host"];
|
||||
if (isset($_POST["url"]))
|
||||
$url = $_POST["url"];
|
||||
else
|
||||
$url = "http://localhost";
|
||||
if (isset($_POST["path"]))
|
||||
$path = $_POST["path"];
|
||||
else
|
||||
$path = "/var/www";
|
||||
}
|
||||
$everything_ok = 0;
|
||||
$step1=0;
|
||||
$step2=0;
|
||||
$step3=0;
|
||||
$step4=0; $step5=0; $step6=0; $step7=0;
|
||||
echo "
|
||||
<div align='center' class='mt35'>
|
||||
<h1>Pandora FMS Console instalation wizard. Step #4 of 4 </h1>
|
||||
<div id='wizard' style='height: 320px;'>
|
||||
<div id='install_box'>
|
||||
<h1>Creating database and default configuration file</h1>
|
||||
<table>";
|
||||
if (! mysql_connect ($dbhost,$dbuser,$dbpassword)) {
|
||||
check_generic ( 0, "Connection with Database");
|
||||
} else {
|
||||
check_generic ( 1, "Connection with Database");
|
||||
// Create schema
|
||||
$step1 = mysql_query ("CREATE DATABASE $db_name");
|
||||
check_generic ($step1, "Creating database '$db_name'");
|
||||
if ($step1 == 1){
|
||||
$step2 = mysql_select_db($db_name);
|
||||
check_generic ($step2, "Opening database '$db_name'");
|
||||
|
||||
$step3 = parse_mysql_dump("pandoradb.sql");
|
||||
check_generic ($step3, "Creating schema");
|
||||
|
||||
$step4 = parse_mysql_dump("pandoradb_data.sql");
|
||||
check_generic ($step4, "Populating database");
|
||||
|
||||
$random_password = random_name (8);
|
||||
$step5 = mysql_query ("GRANT ALL PRIVILEGES ON $db_name.* to pandora@localhost IDENTIFIED BY '".$random_password."'");
|
||||
mysql_query ("FLUSH PRIVILEGES");
|
||||
check_generic ($step5, "Established privileges for user pandora");
|
||||
|
||||
$step6 = is_writable("include");
|
||||
check_generic ($step6, "Write permissions to save config file in './include'");
|
||||
|
||||
$cfgin = fopen ("include/config.inc.php","r");
|
||||
$cfgout = fopen ($pandora_config,"w");
|
||||
$config_contents = fread ($cfgin, filesize("include/config.inc.php"));
|
||||
|
||||
$config_new = '
|
||||
<!-- Begin of automatic config file -->
|
||||
<?PHP
|
||||
$dbname="'.$db_name.'"; // MySQL DataBase
|
||||
$dbuser="pandora"; // DB User
|
||||
$dbpassword="'.$random_password.'"; // Password
|
||||
$dbhost="'.$dbhost.'"; // MySQL Host
|
||||
$config_homedir="'.$path.'"; // MySQL Host
|
||||
$BASE_URL="'.$url.'"; // MySQL Host
|
||||
?>
|
||||
<!-- End of automatic config file -->
|
||||
';
|
||||
$step7 = fputs ($cfgout, $config_new);
|
||||
$step7 = $step7 + fputs ($cfgout, $config_contents);
|
||||
if ($step7 > 0)
|
||||
$step7 = 1;
|
||||
fclose ($cfgin);
|
||||
fclose ($cfgout);
|
||||
check_generic ($step7, "Created new config file at '".$pandora_config."'");
|
||||
}
|
||||
}
|
||||
if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) {
|
||||
$everything_ok = 1;
|
||||
}
|
||||
echo "</table></div>
|
||||
<div class='box'>
|
||||
<img src='images/logo_login.gif' border='0' alt=''>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/step3.png' border='0' alt=''>
|
||||
</div>
|
||||
|
||||
<div id='install_box' style='margin-bottom: 25px;margin-left: 25px;'>";
|
||||
if ($everything_ok == 1) {
|
||||
echo "<a href='install.php?step=5'><img align='right' src='images/arrow_next.png' border=0 class=''></a>";
|
||||
} else {
|
||||
echo "<img src='images/info.gif'> You get some problems. Installation is not completed.
|
||||
<p>Please correct failures before trying again. All database schemes created in this step have been dropped.</p>";
|
||||
|
||||
if (mysql_error() != "")
|
||||
echo "<p><img src='images/info.gif'> <b>ERROR:</b> ". mysql_error()."</p>";
|
||||
|
||||
mysql_query ("DROP DATABASE $db_name");
|
||||
}
|
||||
echo "
|
||||
</div>
|
||||
</div>
|
||||
<div id='foot'>
|
||||
<i>Pandora FMS is a Free Software project registered at
|
||||
<a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
function install_step5() {
|
||||
echo "
|
||||
<div align='center' class='mt35'>
|
||||
<h1>Pandora FMS console instalation wizard. Finished</h1>
|
||||
<div id='wizard' style='height: 300px;'>
|
||||
<div id='install_box'>
|
||||
<h1>Installation complete</h1>
|
||||
<p>You now must delete manually this installer for security, ('install.php') and rename your new config file '".$pandora_config."' to 'config.php' before trying to access to your Pandora FMS console.
|
||||
<p>Don't forget to check <a href='http://pandora.sourceforge.net'>http://pandora.sourceforge.net</a> for updates.
|
||||
<p><a href='index.php'>Click here to access to your Pandora FMS console</A></p>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/logo_login.gif' border='0'></a><br>
|
||||
</div>
|
||||
<div class='box'>
|
||||
<img src='images/step4.png' border='0'><br>
|
||||
</div>
|
||||
</div>
|
||||
<div id='foot'>
|
||||
<i>Pandora FMS is a Free Software project registered at
|
||||
<a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
if (! isset($_GET["step"])){
|
||||
install_step1();
|
||||
} else {
|
||||
$step = $_GET["step"];
|
||||
switch ($step) {
|
||||
case 2: install_step2();
|
||||
break;
|
||||
case 3: install_step3();
|
||||
break;
|
||||
case 4: install_step4();
|
||||
break;
|
||||
case 5: install_step5();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,21 +1,23 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
// Copyright (c) INDISEG S.L, contacto[AT]indiseg[DOT]net www.indiseg.net
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require("../../include/config.php");
|
||||
global $dbname;
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -16,7 +18,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Load global vars
|
||||
$accion = "";
|
||||
require("include/config.php");
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -16,7 +18,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -16,7 +18,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -16,7 +18,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
|
||||
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
// as published by the Free Software Foundation version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -16,7 +18,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
|
|
Loading…
Reference in New Issue