Merge branch 'feature/celery-status' of https://github.com/radiorabe/libretime into radiorabe-feature/celery-status
This commit is contained in:
commit
329d214b25
|
@ -16,7 +16,8 @@ $rabbitmq = $externalServices["rabbitmq"];
|
||||||
|
|
||||||
$pypo = $externalServices["pypo"];
|
$pypo = $externalServices["pypo"];
|
||||||
$liquidsoap = $externalServices["liquidsoap"];
|
$liquidsoap = $externalServices["liquidsoap"];
|
||||||
$analyzer = $externalServices["analyzer"];
|
$analyzer = $externalServices["analyzer"];
|
||||||
|
$celery = $externalServices['celery'];
|
||||||
|
|
||||||
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
||||||
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
||||||
|
@ -222,6 +223,26 @@ $result = $r1 && $r2;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="<?=$celery ? 'success' : 'danger';?>">
|
||||||
|
<td class="component">
|
||||||
|
Celery
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
Airtime Celery Task service
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($celery) {echo 'check';?>">
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Check that the airtime-celery service is installed correctly in <code>/etc/init.d</code>,
|
||||||
|
and ensure that it's running with
|
||||||
|
<br/><code>initctl list | grep airtime-celery</code><br/>
|
||||||
|
If not, try running <code>sudo service airtime-celery restart</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
$pypo = $externalServices["pypo"];
|
$pypo = $externalServices["pypo"];
|
||||||
$liquidsoap = $externalServices["liquidsoap"];
|
$liquidsoap = $externalServices["liquidsoap"];
|
||||||
$analyzer = $externalServices["analyzer"];
|
$analyzer = $externalServices["analyzer"];
|
||||||
|
$celery = $externalServices['celery'];
|
||||||
|
|
||||||
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
||||||
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
||||||
|
@ -149,6 +150,26 @@
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="component">
|
||||||
|
Celery
|
||||||
|
</td>
|
||||||
|
<td class="description">
|
||||||
|
LibreTime Celery Task service
|
||||||
|
</td>
|
||||||
|
<td class="solution <?php if ($celery) {echo 'check';?>" >
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>">
|
||||||
|
Check that the airtime-celery service is installed correctly in <code>/etc/init</code>,
|
||||||
|
and ensure that it's running with
|
||||||
|
<br/><code>initctl list | grep airtime-celery</code><br/>
|
||||||
|
If not, try <br/><code>sudo service airtime-celery restart</code>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<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>
|
||||||
|
|
|
@ -54,7 +54,8 @@ function checkExternalServices() {
|
||||||
"analyzer" => checkAnalyzerService(),
|
"analyzer" => checkAnalyzerService(),
|
||||||
"pypo" => checkPlayoutService(),
|
"pypo" => checkPlayoutService(),
|
||||||
"liquidsoap" => checkLiquidsoapService(),
|
"liquidsoap" => checkLiquidsoapService(),
|
||||||
"rabbitmq" => checkRMQConnection()
|
"rabbitmq" => checkRMQConnection(),
|
||||||
|
"celery" => checkCeleryService(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,3 +145,16 @@ function checkLiquidsoapService() {
|
||||||
}
|
}
|
||||||
return $status == 0;
|
return $status == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if airtime-celery is currently running
|
||||||
|
*
|
||||||
|
* @return boolean true if airtime-celery is running
|
||||||
|
*/
|
||||||
|
function checkCeleryService() {
|
||||||
|
exec("pgrep -f -u celery airtime-celery", $out, $status);
|
||||||
|
if (array_key_exists(0, $out) && $status == 0) {
|
||||||
|
return posix_kill(rtrim($out[0]), 0);
|
||||||
|
}
|
||||||
|
return $status == 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue