CC-2750: Ability to query health status for pypo,
liquidsoap, media monitor, and recorder
This commit is contained in:
parent
0af749dd20
commit
7dd14efe27
5 changed files with 2 additions and 56 deletions
25
airtime_mvc/application/models/ServiceRegister.php
Normal file
25
airtime_mvc/application/models/ServiceRegister.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
class Application_Model_ServiceRegister {
|
||||
|
||||
public static function Register($p_componentName, $p_ipAddress){
|
||||
|
||||
$component = CcServiceRegisterQuery::create()->findOneByDbName($p_componentName);
|
||||
|
||||
if ($component == NULL){
|
||||
$component = new CcServiceRegister();
|
||||
$component->setDbName($p_componentName);
|
||||
}
|
||||
|
||||
// Need to convert ipv6 to ipv4 since Monit server does not appear
|
||||
// to allow access via an ipv6 address.
|
||||
// http://[::1]:2812 does not respond.
|
||||
// Bug: http://savannah.nongnu.org/bugs/?27608
|
||||
if ($p_ipAddress == "::1"){
|
||||
$p_ipAddress = "127.0.0.1";
|
||||
}
|
||||
|
||||
$component->setDbIp($p_ipAddress);
|
||||
$component->save();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue