From 44018b2cbf2dae9b6e6bcf22c652e866062f9754 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Fri, 16 Jan 2015 16:15:16 -0500 Subject: [PATCH] Changed status page to use config-check (tentative) and removed time-intensive check in index routing --- .../application/configs/config-check.php | 19 ++ .../controllers/SystemstatusController.php | 7 - .../views/scripts/systemstatus/index.phtml | 209 +++++++++++++++--- airtime_mvc/public/css/setup/config-check.css | 14 -- airtime_mvc/public/index.php | 19 +- 5 files changed, 201 insertions(+), 67 deletions(-) diff --git a/airtime_mvc/application/configs/config-check.php b/airtime_mvc/application/configs/config-check.php index 8b083ba48..381522136 100644 --- a/airtime_mvc/application/configs/config-check.php +++ b/airtime_mvc/application/configs/config-check.php @@ -28,6 +28,25 @@ $result = $r1 && $r2; +

diff --git a/airtime_mvc/application/controllers/SystemstatusController.php b/airtime_mvc/application/controllers/SystemstatusController.php index 496dae625..6098f71b7 100644 --- a/airtime_mvc/application/controllers/SystemstatusController.php +++ b/airtime_mvc/application/controllers/SystemstatusController.php @@ -13,16 +13,9 @@ class SystemstatusController extends Zend_Controller_Action public function indexAction() { - $services = array( - "pypo"=>Application_Model_Systemstatus::GetPypoStatus(), - "liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(), - "media-monitor"=>Application_Model_Systemstatus::GetMediaMonitorStatus(), - ); - $partitions = Application_Model_Systemstatus::GetDiskInfo(); $this->view->status = new StdClass; - $this->view->status->services = $services; $this->view->status->partitions = $partitions; } } diff --git a/airtime_mvc/application/views/scripts/systemstatus/index.phtml b/airtime_mvc/application/views/scripts/systemstatus/index.phtml index 2a31ac78e..ccd43b2a4 100644 --- a/airtime_mvc/application/views/scripts/systemstatus/index.phtml +++ b/airtime_mvc/application/views/scripts/systemstatus/index.phtml @@ -1,33 +1,178 @@ + + + + + + - - - - - - - - - - - - - status->services as $key=>$value): ?> - " id=""> - - - - - - - - - - - -
+ + + + + + + + + + + + Zend + + + Zend MVC Framework + + + "> + Ubuntu: try running sudo apt-get install libzend-framework-php +
Debian: try running sudo apt-get install zendframework + + + + + + Postgres + + + PDO and PostgreSQL libraries + + + "> + Try running sudo apt-get install php5-pgsql + + + + + + Database + + + Database configuration for Airtime + + + "> + Make sure you aren't missing any of the Postgres dependencies in the table above. + If your dependencies check out, make sure your database configuration settings in + /etc/airtime.conf are correct and the Airtime database was installed correctly. + + + + + + RabbitMQ + + + RabbitMQ configuration for Airtime + + + "> + Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf + are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts + to see if the airtime user (or your custom RabbitMQ user) exists, then checking that + sudo rabbitmqctl list_exchanges contains entries for airtime-media-monitor, airtime-pypo, + and airtime-uploads. + + + + + + Media Monitor + + + Airtime media-monitor service + + + "> + Check that the airtime-media-monitor service is installed correctly in /etc/init, + and ensure that it's running with +
initctl list | grep airtime-media-monitor
+ If not, try
sudo service airtime-media-monitor start + + + + + + Pypo + + + Airtime playout service + + + "> + Check that the airtime-playout service is installed correctly in /etc/init, + and ensure that it's running with +
sudo initctl list | grep airtime-playout
+ If not, try
sudo service airtime-playout restart + + + + + + Liquidsoap + + + Airtime liquidsoap service + + + "> + Check that the airtime-liquidsoap service is installed correctly in /etc/init, + and ensure that it's running with +
sudo initctl list | grep airtime-liquidsoap
+ If not, try
sudo service airtime-liquidsoap restart + + + + + + + + diff --git a/airtime_mvc/public/css/setup/config-check.css b/airtime_mvc/public/css/setup/config-check.css index 31983f4b1..d07ed1d3e 100644 --- a/airtime_mvc/public/css/setup/config-check.css +++ b/airtime_mvc/public/css/setup/config-check.css @@ -1,17 +1,3 @@ -html { - background-color: #f5f5f5; -} - -body { - padding: 2em 0; - min-width: 600px; - width: 50%; - text-align: center; - margin: 3em auto; - border: 1px solid lightgray; - border-radius: 5em; -} - .logo { margin-bottom: .5em; } diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php index 45e519111..d85ad2b13 100644 --- a/airtime_mvc/public/index.php +++ b/airtime_mvc/public/index.php @@ -16,6 +16,11 @@ function showConfigCheckPage() { die(); } +function isApiCall() { + $path = $_SERVER['PHP_SELF']; + return strpos($path, "api") !== false; +} + // Define application path constants define('ROOT_PATH', dirname( __DIR__) . '/'); define('LIB_PATH', ROOT_PATH . 'library/'); @@ -40,20 +45,6 @@ if (array_key_exists('config', $_GET)) { // If a configuration file exists, forward to our boot script if (file_exists(AIRTIME_CONFIG_STOR . AIRTIME_CONFIG)) { - /* - * Even if the user has been through the setup process and - * created an airtime.conf file (or they may have simply - * copied the example file) their settings aren't necessarily - * correctly configured. - * - * If something is improperly configured, show the user a - * configuration checklist page so they know what went wrong - */ - if (!checkConfiguration()) { - $configRun = true; - showConfigCheckPage(); - } - require_once(APPLICATION_PATH . 'airtime-boot.php'); } // Otherwise, we'll need to run our configuration setup