CC-3520: Change default password of monit

-currently I allow it to be fixed, but I don't actually change it
from default of airtime:guest
This commit is contained in:
Martin Konecny 2012-04-13 16:58:12 -04:00
parent 2e4cab45b3
commit 5a2d55ef84
3 changed files with 15 additions and 2 deletions

View File

@ -64,6 +64,10 @@ class Config {
$CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours']; $CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours'];
$CC_CONFIG['monit_user'] = $values['monit']['monit_user'];
$CC_CONFIG['monit_password'] = $values['monit']['monit_password'];
// Database config // Database config
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser']; $CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass']; $CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];

View File

@ -4,20 +4,25 @@ class Application_Model_Systemstatus
{ {
public static function GetMonitStatus($p_ip){ public static function GetMonitStatus($p_ip){
global $CC_CONFIG;
$monit_user = $CC_CONFIG['monit_user'];
$monit_password = $CC_CONFIG['monit_password'];
$url = "http://$p_ip:2812/_status?format=xml"; $url = "http://$p_ip:2812/_status?format=xml";
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "guest:airtime"); curl_setopt($ch, CURLOPT_USERPWD, "$monit_user:$monit_password");
//wait a max of 3 seconds before aborting connection attempt //wait a max of 3 seconds before aborting connection attempt
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
$result = curl_exec($ch); $result = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch); curl_close($ch);
$docRoot = null; $docRoot = null;
if ($result != FALSE){ if ($result !== FALSE && $info["http_code"] === 200){
if ($result != ""){ if ($result != ""){
$xmlDoc = new DOMDocument(); $xmlDoc = new DOMDocument();
$xmlDoc->loadXML($result); $xmlDoc->loadXML($result);

View File

@ -22,6 +22,10 @@ base_port = 80
;cache scheduled media files. ;cache scheduled media files.
cache_ahead_hours = 1 cache_ahead_hours = 1
[monit]
user = guest
password = airtime
[soundcloud] [soundcloud]
connection_retries = 3 connection_retries = 3
time_between_retries = 60 time_between_retries = 60