CC-2750: Ability to query health status for pypo, liquidsoap, media monitor, and recorder
This commit is contained in:
parent
5a5430f468
commit
a11dba1469
3 changed files with 56 additions and 46 deletions
|
@ -22,7 +22,6 @@ class Application_Model_Systemstatus
|
||||||
|
|
||||||
public static function ExtractServiceInformation($p_docRoot, $p_serviceName){
|
public static function ExtractServiceInformation($p_docRoot, $p_serviceName){
|
||||||
|
|
||||||
$data = array();
|
|
||||||
$starting = array("process_id"=>"STARTING...",
|
$starting = array("process_id"=>"STARTING...",
|
||||||
"uptime_seconds"=>"STARTING...",
|
"uptime_seconds"=>"STARTING...",
|
||||||
"memory_perc"=>"UNKNOWN",
|
"memory_perc"=>"UNKNOWN",
|
||||||
|
@ -35,9 +34,10 @@ class Application_Model_Systemstatus
|
||||||
"memory_kb"=>"UNKNOWN",
|
"memory_kb"=>"UNKNOWN",
|
||||||
"cpu_perc"=>"UNKNOWN"
|
"cpu_perc"=>"UNKNOWN"
|
||||||
);
|
);
|
||||||
|
$data = $notRunning;
|
||||||
|
|
||||||
|
|
||||||
|
if (!is_null($p_docRoot)){
|
||||||
foreach ($p_docRoot->getElementsByTagName("service") AS $item)
|
foreach ($p_docRoot->getElementsByTagName("service") AS $item)
|
||||||
{
|
{
|
||||||
if ($item->getElementsByTagName("name")->item(0)->nodeValue == $p_serviceName){
|
if ($item->getElementsByTagName("name")->item(0)->nodeValue == $p_serviceName){
|
||||||
|
@ -75,18 +75,18 @@ class Application_Model_Systemstatus
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetPlatformInfo(){
|
public static function GetPlatformInfo(){
|
||||||
$docRoot = self::GetMonitStatus("localhost");
|
|
||||||
|
|
||||||
$data = array("release"=>"UNKNOWN",
|
$data = array("release"=>"UNKNOWN",
|
||||||
"machine"=>"UNKNOWN",
|
"machine"=>"UNKNOWN",
|
||||||
"memory"=>"UNKNOWN",
|
"memory"=>"UNKNOWN",
|
||||||
"swap"=>"UNKNOWN");
|
"swap"=>"UNKNOWN");
|
||||||
|
|
||||||
|
$docRoot = self::GetMonitStatus("localhost");
|
||||||
|
if (!is_null($docRoot)){
|
||||||
foreach ($docRoot->getElementsByTagName("platform") AS $item)
|
foreach ($docRoot->getElementsByTagName("platform") AS $item)
|
||||||
{
|
{
|
||||||
$data["release"] = $item->getElementsByTagName("release")->item(0)->nodeValue;
|
$data["release"] = $item->getElementsByTagName("release")->item(0)->nodeValue;
|
||||||
|
@ -94,6 +94,7 @@ class Application_Model_Systemstatus
|
||||||
$data["memory"] = $item->getElementsByTagName("memory")->item(0)->nodeValue;
|
$data["memory"] = $item->getElementsByTagName("memory")->item(0)->nodeValue;
|
||||||
$data["swap"] = $item->getElementsByTagName("swap")->item(0)->nodeValue;
|
$data["swap"] = $item->getElementsByTagName("swap")->item(0)->nodeValue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,15 @@ elif [ "$result" -ne "0" ]; then
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||||
|
# so we can ensure they can register with monit to monitor them when they start.
|
||||||
|
/etc/init.d/monit start
|
||||||
|
|
||||||
|
# We may have updated the monit config files, and monit was already running.
|
||||||
|
# In this case the previous "start" command didn't do anything, and we need
|
||||||
|
# to reload the config files instead.
|
||||||
|
/etc/init.d/monit force-reload
|
||||||
|
|
||||||
echo -e "\n*** API Client Installation ***"
|
echo -e "\n*** API Client Installation ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
||||||
|
|
||||||
|
@ -49,11 +58,11 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
|
||||||
echo -e "\n*** Media Monitor Installation ***"
|
echo -e "\n*** Media Monitor Installation ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
||||||
|
|
||||||
monit monitor icecast2 >/dev/null 2>&1
|
monit monitor icecast2
|
||||||
monit monitor rabbitmq-server >/dev/null 2>&1
|
monit monitor rabbitmq-server
|
||||||
|
|
||||||
echo -e "\n*** Verifying your system environment ***"
|
echo -e "\n*** Verifying your system environment ***"
|
||||||
sleep 5
|
sleep 10
|
||||||
airtime-check-system
|
airtime-check-system
|
||||||
|
|
||||||
echo -e "\n******************************* Install Complete *******************************"
|
echo -e "\n******************************* Install Complete *******************************"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
set daemon 10 # Poll at 10 second intervals
|
set daemon 10 # Poll at 5 second intervals
|
||||||
#set logfile syslog facility log_daemon
|
#set logfile syslog facility log_daemon
|
||||||
set logfile /var/log/monit.log
|
set logfile /var/log/monit.log
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue