pnp4nagios/share/pnp/install.php.in
2025-08-06 18:11:51 +02:00

256 lines
8.2 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Installation</title>
<style type="text/css">
body { width: 42em; margin: 0 auto; font-family: sans-serif; font-size: 90%; }
#tests table { border-collapse: collapse; width: 100%; }
#tests table th,
#tests table td { padding: 0.2em 0.4em; text-align: left; vertical-align: top; }
#tests table th { width: 12em; font-weight: normal; font-size: 1.2em; }
#tests table tr:nth-child(odd) { background: #eee; }
#tests table td.pass { color: #191; }
#tests table td.fail { color: #911; }
#tests table td.warn { background: #ff3; }
#tests #results { color: #fff; }
#tests #results p { padding: 0.8em 0.4em; }
#tests #results p.pass { background: #191; }
#tests #results p.fail { background: #911; }
#tests #results p.warn { background: #ff3; }
</style>
</head>
<body>
<?php $failed = 0 ?>
<h1>PNP4Nagios Environment Tests</h1>
<p>The following options are determined by "configure".
If any of the tests have failed, consult the
<a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/pnp-0.6/install.txt">documentation</a>
for more information on how to correct the problem.</p>
<div id="tests">
<table cellspacing="0">
<tr>
<th>PNP4Nagios Version</th>
<td class="pass">@PACKAGE_NAME@-@PACKAGE_VERSION@</td>
</tr>
<tr>
<th>Prefix</th>
<td class="pass">@prefix@</td>
</tr>
<tr>
<th>Configure Arguments</th>
<td class="pass">./configure @ac_configure_args@</td>
</tr>
<tr>
<th>RRD Storage</th>
<?php if (is_readable('@PERFDATA_DIR@')) : ?>
<td class="pass">@PERFDATA_DIR@ is readable.</td>
<?php else :
$failed++ ?>
<td class="fail">@PERFDATA_DIR@ is not readable.</td>
<?php endif ?>
</tr>
<tr>
<th>RRDtool Binary</th>
<?php if (is_executable('@RRDTOOL@')) : ?>
<td class="pass">@RRDTOOL@ is executable by PHP</td>
<?php else :
$failed++ ?>
<td class="fail">@RRDTOOL@ is <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i8.txt">not executable</a> by PHP</td>
<?php endif ?>
</tr>
<tr>
<th>PHP mbstring extension</th>
<?php if (function_exists('mb_convert_encoding')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP mbstring extension not available/enabled</td>
<?php endif ?>
</tr>
<tr>
<th>PHP GD extension</th>
<?php if (function_exists('imagecreatefrompng')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP GD extension not available</td>
<?php endif ?>
</tr>
<tr>
<th>PHP function proc_open()</th>
<?php if (function_exists('proc_open')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP function <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i10.txt">proc_open</a> not available/enabled</td>
<?php endif ?>
</tr>
<tr>
<th>PHP XML extension</th>
<?php if (function_exists('simplexml_load_file')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP SimpleXML extension not available</td>
<?php endif ?>
</tr>
<tr>
<th>PHP zlib extension</th>
<?php if (function_exists('gzfile')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP zlib extension not available</td>
<?php endif ?>
</tr>
<tr>
<th>PHP session extension</th>
<?php if (function_exists('session_start')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP session extension not available</td>
<?php endif ?>
</tr>
<tr>
<th>PHP JSON extension</th>
<?php if (function_exists('json_encode')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail"><a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i10.txt">PHP JSON extension</a> not available</td>
<?php endif ?>
</tr>
<tr>
<th>PHP magic_quotes_gpc</th>
<td class="pass">Off</td>
<td class="fail">PHP <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i7.txt">magic_quotes_gpc</a> is REMOVED</td>
</tr>
<?php if (function_exists('apache_get_modules')) : ?>
<th>PHP socket extension</th>
<?php if (function_exists('socket_create')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail"><a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i11.txt">PHP socket extension</a> not available</td>
<?php endif ?>
</tr>
<th>Apache Rewrite Module</th>
<?php if (in_array('mod_rewrite', apache_get_modules())) : ?>
<td class="pass">Pass</td>
<?php else : ?>
<td class="warn"><a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i9.txt">Apache mod_rewrite</a> is not enabled</td>
<?php endif ?></tr>
<?php else : ?>
<th>Apache Rewrite Module</th>
<td class="pass">Not running within Apache mod_php</td>
<?php endif ?></tr>
</table>
</div>
<h1>Kohana Environment Tests</h1>
<p>The following tests have been run to determine if Kohana will
work in your environment. If any of the tests have failed,
consult the
<a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/pnp-0.6/install.txt">documentation</a>
for more information on how to correct the problem.</p>
<div id="tests">
<table cellspacing="0">
<tr>
<th>PHP Version</th>
<?php if (version_compare(PHP_VERSION, '5.1', '>=')) : ?>
<td class="pass"><?php echo PHP_VERSION ?></td>
<?php else :
$failed++ ?>
<td class="fail">Kohana requires PHP 5.1 or newer, this version is <?php echo PHP_VERSION ?>.</td>
<?php endif ?>
</tr>
<tr>
<th>System Directory</th>
<?php if (is_dir(SYSPATH) and is_file(SYSPATH . 'core/Bootstrap' . EXT)) : ?>
<td class="pass"><?php echo SYSPATH ?></td>
<?php else :
$failed++ ?>
<td class="fail">The configured system directory <br>('<?php echo SYSPATH ?>') <br>does not exist or does not contain required files.</td>
<?php endif ?>
</tr>
<tr>
<th>Application Directory</th>
<?php if (is_dir(APPPATH) and is_file(APPPATH . 'config/config' . EXT)) : ?>
<td class="pass"><?php echo APPPATH ?></td>
<?php else :
$failed++ ?>
<td class="fail">The configured application directory<br>('<?php echo APPPATH ?>')<br> does not exist or does not contain required files.</td>
<?php endif ?>
</tr>
<tr>
<th>Reflection Enabled</th>
<?php if (class_exists('ReflectionClass')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">PHP <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i3.txt">reflection</a> is either not loaded or not compiled in.</td>
<?php endif ?>
</tr>
<tr>
<th>Iconv Extension Loaded</th>
<?php if (extension_loaded('iconv')) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">The <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i5.txt">iconv</a> extension is not loaded.</td>
<?php endif ?>
<tr>
<?php if (version_compare(PHP_VERSION, '8.0', '>=')) : define("MB_OVERLOAD_STRING", 0) ?>
<?php endif ?>
<?php if (extension_loaded('mbstring')) : ?>
<th>Mbstring Not Overloaded</th>
<?php if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING) :
$failed++ ?>
<td class="fail">The <a href="https://raw.githubusercontent.com/pnp4nagios/docs/main/pages/faq/i6.txt">mbstring</a> extension is overloading PHPs native string functions.</td>
<?php else : ?>
<td class="pass">Pass</td>
<?php endif ?>
</tr>
<?php endif ?>
</tr>
<tr>
<th>URI Determination</th>
<?php if (isset($_SERVER['REQUEST_URI']) or isset($_SERVER['PHP_SELF'])) : ?>
<td class="pass">Pass</td>
<?php else :
$failed++ ?>
<td class="fail">Neither <code>$_SERVER['REQUEST_URI']</code> or <code>$_SERVER['PHP_SELF']</code> is available.</td>
<?php endif ?>
</tr>
</table>
<div id="results">
<?php if ($failed > 0) : ?>
<p class="fail">@PACKAGE_NAME@ may not work correctly with your environment. Remove or rename the <code><?php echo __FILE__ ?></code> file on your own risk.</p>
<?php else : ?>
<p class="pass">Your environment passed all requirements. To show the graphs:
<br>
<code>mv @datarootdir@/install.ignore.not
@datarootdir@/install.ignore</code>.
</p>
<?php endif ?>
</div>
</div>
</body>
</html>