Basic status page for monitoring nominatim is working

This commit is contained in:
Brian Quinion 2013-01-24 12:42:34 +00:00
parent 1d836f6c5c
commit fca2d00617
3 changed files with 28 additions and 0 deletions

View File

@ -28,6 +28,7 @@
@define('CONST_ConnectionBucket_Cost_Reverse', 1);
@define('CONST_ConnectionBucket_Cost_Search', 2);
@define('CONST_ConnectionBucket_Cost_Details', 3);
@define('CONST_ConnectionBucket_Cost_Status', 1);
// Override this function to add an adjustment factor to the cost
// based on server load. e.g. getBlockingProcesses

View File

@ -619,6 +619,7 @@
@symlink(CONST_BasePath.'/website/search.php', $sTargetDir.'/index.php');
@symlink(CONST_BasePath.'/website/deletable.php', $sTargetDir.'/deletable.php');
@symlink(CONST_BasePath.'/website/polygons.php', $sTargetDir.'/polygons.php');
@symlink(CONST_BasePath.'/website/status.php', $sTargetDir.'/status.php');
@symlink(CONST_BasePath.'/website/images', $sTargetDir.'/images');
@symlink(CONST_BasePath.'/website/js', $sTargetDir.'/js');
@symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css');

26
website/status.php Normal file
View File

@ -0,0 +1,26 @@
<?php
@define('CONST_ConnectionBucket_PageType', 'Status');
require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
$oDB =& getDB();
if (!$oDB || PEAR::isError($oDB))
{
echo "ERROR: No database";
exit;
}
$iWordID = $oDB->getOne("select word_id,word_token, word, class, type, location, country_code, operator, search_name_count from word where word_token in (' a')");
if (PEAR::isError($iWordID))
{
echo "ERROR: Query failed";
exit;
}
if (!$iWordID)
{
echo "ERROR: No value";
exit;
}
echo "OK";
exit;