1<?php defined('SYSPATH') OR die('No direct access allowed.');?>
2<?php require('application/lib/jsonwrapper.php');?>
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6
7<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
9<title>Installation</title>
10
11<style type="text/css">
12body { width: 42em; margin: 0 auto; font-family: sans-serif; font-size: 90%; }
13
14#tests table { border-collapse: collapse; width: 100%; }
15	#tests table th,
16	#tests table td { padding: 0.2em 0.4em; text-align: left; vertical-align: top; }
17	#tests table th { width: 12em; font-weight: normal; font-size: 1.2em; }
18	#tests table tr:nth-child(odd) { background: #eee; }
19	#tests table td.pass { color: #191; }
20	#tests table td.fail { color: #911; }
21	#tests table td.warn { background: #ff3; }
22	#tests #results { color: #fff; }
23	#tests #results p { padding: 0.8em 0.4em; }
24	#tests #results p.pass { background: #191; }
25	#tests #results p.fail { background: #911; }
26	#tests #results p.warn { background: #ff3; }
27</style>
28
29</head>
30<body>
31
32<?php $failed = 0 ?>
33<h1>PNP4Nagios Environment Tests</h1>
34
35<p>The following options are determined by "configure". If any of the tests have failed, consult the <a href="http://docs.pnp4nagios.org/pnp-0.6/install">documentation</a> for more information on how to correct the problem.</p>
36
37<div id="tests">
38<table cellspacing="0">
39<tr>
40<th>PNP4Nagios Version</th>
41<td class="pass">@PKG_NAME@-@PKG_VERSION@</td>
42</tr>
43<tr>
44<th>Prefix</th>
45<td class="pass">@prefix@</td>
46</tr>
47<tr>
48<th>Configure Arguments</th>
49<td class="pass">./configure @ac_configure_args@</td>
50</tr>
51<tr>
52<th>RRD Storage</th>
53<?php if (is_readable('@PERFDATA_DIR@')): ?>
54<td class="pass">@PERFDATA_DIR@ is readable.</td>
55<?php else: $failed++ ?>
56<td class="fail">@PERFDATA_DIR@ is not readable.</td>
57<?php endif ?>
58</tr>
59<tr>
60<th>RRDtool Binary</th>
61<?php if (is_executable('@RRDTOOL@') ): ?>
62<td class="pass">@RRDTOOL@ is executable by PHP</td>
63<?php else: $failed++ ?>
64<td class="fail">@RRDTOOL@ is <a href="http://docs.pnp4nagios.org/faq/i8">not executable</a> by PHP</td>
65<?php endif ?>
66</tr>
67<tr>
68<th>PHP GD extension</th>
69<?php if (function_exists('imagecreatefrompng')): ?>
70<td class="pass">Pass</td>
71<?php else: $failed++ ?>
72<td class="fail">PHP GD extension not available</td>
73<?php endif ?>
74</tr>
75<tr>
76<th>PHP function proc_open()</th>
77<?php if (function_exists('proc_open')): ?>
78<td class="pass">Pass</td>
79<?php else: $failed++ ?>
80<td class="fail">PHP function <a href="http://docs.pnp4nagios.org/faq/i10">proc_open</a> not available/enabled</td>
81<?php endif ?>
82</tr>
83<tr>
84<th>PHP zlib extension</th>
85<?php if (function_exists('gzfile')): ?>
86<td class="pass">Pass</td>
87<?php else: $failed++ ?>
88<td class="fail">PHP zlib extension not available</td>
89<?php endif ?>
90</tr>
91<tr>
92<th>PHP session extension</th>
93<?php if (function_exists('session_start')): ?>
94<td class="pass">Pass</td>
95<?php else: $failed++ ?>
96<td class="fail">PHP session extension not available</td>
97<?php endif ?>
98</tr>
99<tr>
100<th>PHP JSON extension</th>
101<?php if (function_exists('json_encode')): ?>
102<td class="pass">Pass</td>
103<?php else: $failed++ ?>
104<td class="fail"><a href="http://docs.pnp4nagios.org/faq/i10">PHP JSON extension</a> not available</td>
105<?php endif ?>
106</tr>
107<th>PHP magic_quotes_gpc</th>
108<?php if (get_magic_quotes_gpc() == FALSE): ?>
109<td class="pass">Off</td>
110<?php else: $failed++ ?>
111<td class="fail">PHP <a href="http://docs.pnp4nagios.org/faq/i7">magic_quotes_gpc</a> is deprecated</td>
112<?php endif ?></tr>
113<?php if(function_exists('apache_get_modules')) : ?>
114<th>PHP socket extension</th>
115<?php if (function_exists('socket_create')): ?>
116<td class="pass">Pass</td>
117<?php else: $failed++ ?>
118<td class="fail"><a href="http://docs.pnp4nagios.org/faq/i11">PHP socket extension</a> not available</td>
119<?php endif ?>
120</tr>
121<th>Apache Rewrite Module</th>
122<?php if(in_array('mod_rewrite', apache_get_modules())) : ?>
123<td class="pass">Pass</td>
124<?php else: ?>
125<td class="warn"><a href="http://docs.pnp4nagios.org/faq/i9">Apache mod_rewrite</a> is not enabled</td>
126<?php endif ?></tr>
127<?php else: ?>
128<th>Apache Rewrite Module</th>
129<td class="pass">Not running within Apache mod_php</td>
130<?php endif ?></tr>
131</table>
132</div>
133
134<h1>Kohana Environment Tests</h1>
135
136<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="http://docs.pnp4nagios.org/pnp-0.6/install">documentation</a> for more information on how to correct the problem.</p>
137
138<div id="tests">
139<table cellspacing="0">
140<tr>
141<th>PHP Version</th>
142<?php if (version_compare(PHP_VERSION, '5.1', '>=')): ?>
143<td class="pass"><?php echo PHP_VERSION ?></td>
144<?php else: $failed++ ?>
145<td class="fail">Kohana requires PHP 5.1 or newer, this version is <?php echo PHP_VERSION ?>.</td>
146<?php endif ?>
147</tr>
148<tr>
149<th>System Directory</th>
150<?php if (is_dir(SYSPATH) AND is_file(SYSPATH.'core/Bootstrap'.EXT)): ?>
151<td class="pass"><?php echo SYSPATH ?></td>
152<?php else: $failed++ ?>
153<td class="fail">The configured system directory <br>('<?php echo SYSPATH ?>') <br>does not exist or does not contain required files.</td>
154<?php endif ?>
155</tr>
156<tr>
157<th>Application Directory</th>
158<?php if (is_dir(APPPATH) AND is_file(APPPATH.'config/config'.EXT)): ?>
159<td class="pass"><?php echo APPPATH ?></td>
160<?php else: $failed++ ?>
161<td class="fail">The configured application directory<br>('<?php echo APPPATH ?>')<br> does not exist or does not contain required files.</td>
162<?php endif ?>
163</tr>
164<tr>
165<th>Reflection Enabled</th>
166<?php if (class_exists('ReflectionClass')): ?>
167<td class="pass">Pass</td>
168<?php else: $failed++ ?>
169<td class="fail">PHP <a href="http://docs.pnp4nagios.org/faq/i3">reflection</a> is either not loaded or not compiled in.</td>
170<?php endif ?>
171</tr>
172<tr>
173<th>Iconv Extension Loaded</th>
174<?php if (extension_loaded('iconv')): ?>
175<td class="pass">Pass</td>
176<?php else: $failed++ ?>
177<td class="fail">The <a href="http://docs.pnp4nagios.org/faq/i5">iconv</a> extension is not loaded.</td>
178<?php endif ?>
179<tr>
180<?php if (extension_loaded('mbstring')): ?>
181<th>Mbstring Not Overloaded</th>
182<?php if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING): $failed++ ?>
183<td class="fail">The <a href="http://docs.pnp4nagios.org/faq/i6">mbstring</a> extension is overloading PHP's native string functions.</td>
184<?php else: ?>
185<td class="pass">Pass</td>
186<?php endif ?>
187</tr>
188<?php endif ?>
189</tr>
190<tr>
191<th>URI Determination</th>
192<?php if (isset($_SERVER['REQUEST_URI']) OR isset($_SERVER['PHP_SELF'])): ?>
193<td class="pass">Pass</td>
194<?php else: $failed++ ?>
195<td class="fail">Neither <code>$_SERVER['REQUEST_URI']</code> or <code>$_SERVER['PHP_SELF']</code> is available.</td>
196<?php endif ?>
197</tr>
198</table>
199
200<div id="results">
201<?php if ($failed > 0): ?>
202<p class="fail">@PKG_NAME@ may not work correctly with your environment. Remove or rename the <code><?php echo __FILE__ ?></code> file on your own risk.</p>
203<?php else: ?>
204<p class="pass">Your environment passed all requirements. Remove or rename the <code><?php echo __FILE__ ?></code> file now.</p>
205<?php endif ?>
206</div>
207
208</div>
209
210</body>
211</html>
212