Changed status page to use config-check (tentative) and removed time-intensive check in index routing
This commit is contained in:
parent
2f0b3d423c
commit
44018b2cbf
5 changed files with 201 additions and 67 deletions
|
@ -28,6 +28,25 @@ $result = $r1 && $r2;
|
||||||
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
||||||
</head>
|
</head>
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
This is here because we're using the config-check css for
|
||||||
|
both this page and the system status page
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h2>
|
<h2>
|
||||||
|
|
|
@ -13,16 +13,9 @@ class SystemstatusController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function indexAction()
|
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();
|
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||||
|
|
||||||
$this->view->status = new StdClass;
|
$this->view->status = new StdClass;
|
||||||
$this->view->status->services = $services;
|
|
||||||
$this->view->status->partitions = $partitions;
|
$this->view->status->partitions = $partitions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,31 @@
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$phpDependencies = checkPhpDependencies();
|
||||||
|
$externalServices = checkExternalServices();
|
||||||
|
$zend = $phpDependencies["zend"];
|
||||||
|
$postgres = $phpDependencies["postgres"];
|
||||||
|
|
||||||
|
$database = $externalServices["database"];
|
||||||
|
$rabbitmq = $externalServices["rabbitmq"];
|
||||||
|
|
||||||
|
$pypo = $externalServices["pypo"];
|
||||||
|
$liquidsoap = $externalServices["liquidsoap"];
|
||||||
|
$mediamonitor = $externalServices["media-monitor"];
|
||||||
|
|
||||||
|
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
||||||
|
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
||||||
|
$result = $r1 && $r2;
|
||||||
|
?>
|
||||||
|
|
||||||
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
|
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="ui-state-default strong">
|
<tr class="ui-state-default strong">
|
||||||
<td><?php echo _("Service") ?></td>
|
<td><?php echo _("Service") ?></td>
|
||||||
|
<td><?php echo _("Description") ?></td>
|
||||||
<td><?php echo _("Status") ?></td>
|
<td><?php echo _("Status") ?></td>
|
||||||
<td><?php echo _("Uptime") ?></td>
|
|
||||||
<td><?php echo _("CPU") ?></td>
|
|
||||||
<td><?php echo _("Memory") ?></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -16,16 +36,141 @@
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
-->
|
-->
|
||||||
<?php $i=0; ?>
|
<tr>
|
||||||
<?php foreach($this->status->services as $key=>$value): ?>
|
<td class="component">
|
||||||
<tr class="<?php echo ($i&1) == 0 ? "even":"odd"; $i++; ?>" id="<?php echo $value["name"]; ?>">
|
Zend
|
||||||
<td><?php echo $value["name"]; ?></td>
|
</td>
|
||||||
<td><span></span></td>
|
<td class="description">
|
||||||
<td></td>
|
Zend MVC Framework
|
||||||
<td></td>
|
</td>
|
||||||
<td></td>
|
<td class="solution <?php if ($zend) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
<b>Ubuntu</b>: try running <code>sudo apt-get install libzend-framework-php</code>
|
||||||
|
<br/><b>Debian</b>: try running <code>sudo apt-get install zendframework</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Postgres
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
PDO and PostgreSQL libraries
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($postgres) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Try running <code>sudo apt-get install php5-pgsql</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Database
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
Database configuration for Airtime
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($database) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
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
|
||||||
|
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly.
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
RabbitMQ
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
RabbitMQ configuration for Airtime
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($rabbitmq) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
|
||||||
|
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
|
||||||
|
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
|
||||||
|
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-media-monitor, airtime-pypo,
|
||||||
|
and airtime-uploads.
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Media Monitor
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
Airtime media-monitor service
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($mediamonitor) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>,
|
||||||
|
and ensure that it's running with
|
||||||
|
<br/><code>initctl list | grep airtime-media-monitor</code><br/>
|
||||||
|
If not, try <br/><code>sudo service airtime-media-monitor start</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Pypo
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
Airtime playout service
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($pypo) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
|
||||||
|
and ensure that it's running with
|
||||||
|
<br/><code>sudo initctl list | grep airtime-playout</code><br/>
|
||||||
|
If not, try <br/><code>sudo service airtime-playout restart</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Liquidsoap
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
Airtime liquidsoap service
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($liquidsoap) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
|
||||||
|
and ensure that it's running with
|
||||||
|
<br/><code>sudo initctl list | grep airtime-liquidsoap</code><br/>
|
||||||
|
If not, try <br/><code>sudo service airtime-liquidsoap restart</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr id="partitions" class="even">
|
<tr id="partitions" class="even">
|
||||||
<th colspan="5"><?php echo _("Disk Space") ?></th>
|
<th colspan="5"><?php echo _("Disk Space") ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -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 {
|
.logo {
|
||||||
margin-bottom: .5em;
|
margin-bottom: .5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@ function showConfigCheckPage() {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isApiCall() {
|
||||||
|
$path = $_SERVER['PHP_SELF'];
|
||||||
|
return strpos($path, "api") !== false;
|
||||||
|
}
|
||||||
|
|
||||||
// Define application path constants
|
// Define application path constants
|
||||||
define('ROOT_PATH', dirname( __DIR__) . '/');
|
define('ROOT_PATH', dirname( __DIR__) . '/');
|
||||||
define('LIB_PATH', ROOT_PATH . 'library/');
|
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 a configuration file exists, forward to our boot script
|
||||||
if (file_exists(AIRTIME_CONFIG_STOR . AIRTIME_CONFIG)) {
|
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');
|
require_once(APPLICATION_PATH . 'airtime-boot.php');
|
||||||
}
|
}
|
||||||
// Otherwise, we'll need to run our configuration setup
|
// Otherwise, we'll need to run our configuration setup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue