]> git.openstreetmap.org Git - nominatim.git/commitdiff
Basic status page for monitoring nominatim is working
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Thu, 24 Jan 2013 12:42:34 +0000 (12:42 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Thu, 24 Jan 2013 12:42:42 +0000 (12:42 +0000)
settings/settings.php
utils/setup.php
website/status.php [new file with mode: 0644]

index 26b48551d7eadae021c2ceb91f5d1fbec6d05472..fc3166b41e365588388993dc148be05aed367822 100644 (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_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
 
        // Override this function to add an adjustment factor to the cost
        // based on server load. e.g. getBlockingProcesses
index 1ebee32ff1104df99e85cfbb4c2ed8bdb4bc995a..e49a2d52f2de91d5658d94d19dcfa70033b2bb0a 100755 (executable)
                @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/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');
                @symlink(CONST_BasePath.'/website/images', $sTargetDir.'/images');
                @symlink(CONST_BasePath.'/website/js', $sTargetDir.'/js');
                @symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css');
diff --git a/website/status.php b/website/status.php
new file mode 100644 (file)
index 0000000..0caa92a
--- /dev/null
@@ -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;
+