diff --git a/airtime_mvc/application/configs/navigation.php b/airtime_mvc/application/configs/navigation.php index 0851b0cf6..4619f4f9d 100644 --- a/airtime_mvc/application/configs/navigation.php +++ b/airtime_mvc/application/configs/navigation.php @@ -88,7 +88,14 @@ $pages[] = array( 'module' => 'default', 'controller' => 'preference', 'action' => 'stream-setting' - ) + ), + array( + 'label' => _('Status'), + 'module' => 'default', + 'controller' => 'systemstatus', + 'action' => 'index', + 'resource' => 'systemstatus' + ), ) ); $pages[] = array( diff --git a/airtime_mvc/application/controllers/SystemstatusController.php b/airtime_mvc/application/controllers/SystemstatusController.php new file mode 100644 index 000000000..b219c630b --- /dev/null +++ b/airtime_mvc/application/controllers/SystemstatusController.php @@ -0,0 +1,22 @@ +view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$config['airtime_version'],'text/javascript'); + $this->version = $config['airtime_version']; + } + + public function indexAction() + { + Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings'); + + $partitions = Application_Model_Systemstatus::GetDiskInfo(); + $this->view->status = new StdClass; + $this->view->status->partitions = $partitions; + $this->view->version = $this->version; + } +} diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index b97ea491e..dcb5c1dac 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -214,27 +214,20 @@ class Application_Model_Systemstatus public static function GetDiskInfo() { $partitions = array(); - - //connect to DB and find how much total space user has allocated. - $totalSpace = Application_Model_Preference::GetDiskQuota(); - - $usedSpace = Application_Model_Preference::getDiskUsage(); - if (empty($usedSpace)) { - $usedSpace = 0; + /* First lets get all the watched directories. Then we can group them + * into the same partitions by comparing the partition sizes. */ + $musicDirs = Application_Model_MusicDir::getWatchedDirs(); + $musicDirs[] = Application_Model_MusicDir::getStorDir(); + foreach ($musicDirs as $md) { + $totalSpace = disk_total_space($md->getDirectory()); + if (!isset($partitions[$totalSpace])) { + $partitions[$totalSpace] = new StdClass; + $partitions[$totalSpace]->totalSpace = $totalSpace; + $partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory()); + $partitions[$totalSpace]->usedSpace = $totalSpace - $partitions[$totalSpace]->totalFreeSpace; + } + $partitions[$totalSpace]->dirs[] = $md->getDirectory(); } - /* $path = $_SERVER['AIRTIME_BASE']."etc/airtime/num_bytes.ini"; - $arr = parse_ini_file($path); - - $usedSpace = 0; - if ($arr !== false) { - $usedSpace = $arr['num_bytes']; - } */ - - $partitions[$totalSpace] = new stdClass(); - $partitions[$totalSpace]->totalSpace = $totalSpace; - $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; - //Logging::info($partitions[$totalSpace]->totalFreeSpace); - return array_values($partitions); } diff --git a/airtime_mvc/application/views/scripts/systemstatus/index.phtml b/airtime_mvc/application/views/scripts/systemstatus/index.phtml index 76321d8f2..9fa27d378 100644 --- a/airtime_mvc/application/views/scripts/systemstatus/index.phtml +++ b/airtime_mvc/application/views/scripts/systemstatus/index.phtml @@ -3,7 +3,6 @@ status->partitions[0]; - $used = $disk->totalSpace-$disk->totalFreeSpace; - $total = $disk->totalSpace; ?> - + + + + @@ -37,13 +32,6 @@ - - - - */?> - - - - -
version; ?>
Postgres @@ -54,7 +42,7 @@ " + ?>"> Try running sudo apt-get install php5-pgsql - Database configuration for Airtime + Database configuration for LibreTime " + ?>"> 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 - /etc/airtime.conf are correct and the Airtime database was installed correctly. + /etc/airtime.conf are correct and the LibreTime database was installed correctly. @@ -85,12 +73,12 @@ RabbitMQ - RabbitMQ configuration for Airtime + RabbitMQ configuration for LibreTime " + ?>"> Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts to see if the airtime user (or your custom RabbitMQ user) exists, then checking that @@ -103,19 +91,19 @@
- Media Monitor + Media Analzyer - Airtime media-monitor service + LibreTime media analyzer service + " - Check that the airtime-media-monitor service is installed correctly in /etc/init, + ?>"> + Check that the airtime_analyzer service is installed correctly in /etc/init, and ensure that it's running with -
initctl list | grep airtime-media-monitor
- If not, try
sudo service airtime-media-monitor start +
initctl list | grep airtime_analyzer
+ If not, try
sudo service airtime_analyzer start @@ -126,12 +114,12 @@ Pypo
- Airtime playout service + LibreTime playout service " + ?>"> Check that the airtime-playout service is installed correctly in /etc/init, and ensure that it's running with
initctl list | grep airtime-playout
@@ -146,12 +134,12 @@ Liquidsoap
- Airtime liquidsoap service + LibreTime liquidsoap service + " + ?>"> Check that the airtime-liquidsoap service is installed correctly in /etc/init, and ensure that it's running with
initctl list | grep airtime-liquidsoap
@@ -162,26 +150,7 @@
-
    -
-
- - -
-
;"> -
-
-
-
diff --git a/docs/manual/status/index.md b/docs/manual/status/index.md index 77e3a3e98..baaa0ed3c 100644 --- a/docs/manual/status/index.md +++ b/docs/manual/status/index.md @@ -1,7 +1,7 @@ -On the **System** menu, the **Status** page provides an overview of the health and resource usage of the various services that make up an Airtime system. If all is well, you will only see green check mark icons in the **Status** column. This page also shows how much **Disk Space** you have used on the disk partition containing the main Import folder, as well as any disks or partitions with watched folders. +On the **Settings** menu, the **Status** page provides an overview of the health and resource usage of the various services that make up a LibreTime system. If all is well, you will only see green check mark icons in the **Status** column. This page also shows how much **Disk Space** you have used on the disk partition containing the main Import folder, as well as any disks or partitions with watched folders. ![](static/Screenshot521-System_status_240.png) -If any of the check mark icons in the **Status** column have changed to a red warning sign, contact your system administrator for assistance. (The chapter *Troubleshooting* contains some tips). Airtime will do its best to restart any failing services, but sometimes manual intervention may be required; for example, in the case of hardware failure. +If any of the check mark icons in the **Status** column have changed to a red warning sign, contact your system administrator for assistance. (The chapter [Troubleshooting](../troubleshooting/index.md) contains some tips). LibreTime will do its best to restart any failing services, but sometimes manual intervention may be required; for example, in the case of hardware failure. -If you have run out of storage space, an Airtime user with *admin* privileges could log in and delete media files that are no longer required from the **Library**. Alternatively, you could move some files to a watched folder on another disk, or ask your system administrator to install additional storage capacity. +If you have run out of storage space, a LibreTime user with *admin* privileges could log in and delete media files that are no longer required from the **Library**. Alternatively, you could move some files to a watched folder on another disk, or ask your system administrator to install additional storage capacity. diff --git a/docs/manual/status/static/Screenshot521-System_status_240.png b/docs/manual/status/static/Screenshot521-System_status_240.png index 3ae852f2e..bebbaf802 100644 Binary files a/docs/manual/status/static/Screenshot521-System_status_240.png and b/docs/manual/status/static/Screenshot521-System_status_240.png differ