date('Y-m-d H:i:s T'), 'mem_info' => $meminfo, 'partitions' => disk_list() ); } function disk_list() { $partitions = array(); // Fetch partition information from df command // I would have used disk_free_space() and disk_total_space() here but // there appears to be no way to get a list of partitions in PHP? $output = array(); @exec('df --block-size=1', $output); foreach($output as $line) { $columns = array(); foreach(explode(' ', $line) as $column) { $column = trim($column); if($column != '') $columns[] = $column; } // Only process 6 column rows // (This has the bonus of ignoring the first row which is 7) if(count($columns) == 6) { $partition = $columns[5]; $partitions[$partition]['Temporary']['bool'] = in_array($columns[0], array('tmpfs', 'devtmpfs')); $partitions[$partition]['Partition']['text'] = $partition; $partitions[$partition]['FileSystem']['text'] = $columns[0]; if(is_numeric($columns[1]) && is_numeric($columns[2]) && is_numeric($columns[3])) { $partitions[$partition]['Size']['value'] = $columns[1]; $partitions[$partition]['Free']['value'] = $columns[3]; $partitions[$partition]['Used']['value'] = $columns[2]; } else { // Fallback if we don't get numerical values $partitions[$partition]['Size']['text'] = $columns[1]; $partitions[$partition]['Used']['text'] = $columns[2]; $partitions[$partition]['Free']['text'] = $columns[3]; } } } return $partitions; } function formatSize( $bytes ) { $types = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ); for( $i = 0; $bytes >= 1024 && $i < ( count( $types ) -1 ); $bytes /= 1024, $i++ ); return( round( $bytes, 2 ) . " " . $types[$i] ); } ?> CDN - <?php echo $lang['digital_voice']." ".$lang['dashboard']." - ".$lang['update'];?>
CDN: / Dashboard:

CDN -

| | | |

CDN System Information

Memory\n
\n"; $sysRamUsed = $system['mem_info']['MemTotal'] - $system['mem_info']['MemFree'] - $system['mem_info']['Buffers'] - $system['mem_info']['Cached']; $sysRamPercent = sprintf('%.2f',($sysRamUsed / $system['mem_info']['MemTotal']) * 100); echo "
RAM
\n"; echo "
".$sysRamPercent."% used
\n"; echo "
Total: ".formatSize($system['mem_info']['MemTotal'])."   Used: ".formatSize($sysRamUsed)."   Free: ".formatSize($system['mem_info']['MemTotal'] - $sysRamUsed)."
\n"; echo "
\n
\n"; } // Filesystem Information if (count($system['partitions']) > 0) { echo "

Mounted Filesystems

\n
\n"; foreach($system['partitions'] as $fs) { if ($fs['Used']['value'] > 0 && $fs['FileSystem']['text']!= "none" && $fs['FileSystem']['text']!= "udev") { $diskFree = $fs['Free']['value']; $diskTotal = $fs['Size']['value']; $diskUsed = $fs['Used']['value']; $diskPercent = sprintf('%.2f',($diskUsed / $diskTotal) * 100); echo "
".$fs['Partition']['text']."
\n"; echo "
".$diskPercent."% used
\n"; echo "
Total: ".formatSize($diskTotal)."   Used: ".formatSize($diskUsed)."   Free: ".formatSize($diskFree)."
\n"; echo "
\n"; } } echo "
\n"; } // Binary Information echo "

Installed Binaries

\n
\n"; if (is_executable('/usr/local/bin/MMDVMHost')) { $MMDVMHost_Ver = exec('/usr/local/bin/MMDVMHost -v | cut -d\' \' -f 3-'); echo "
MMDVMHost
".$MMDVMHost_Ver."
\n"; } if (is_executable('/usr/local/bin/DMRGateway')) { $DMRGateway_Ver = exec('/usr/local/bin/DMRGateway -v | cut -d\' \' -f 3-'); echo "
DMRGateway
".$DMRGateway_Ver."
\n"; } if (is_executable('/usr/local/bin/DMR2YSF')) { $DMR2YSF_Ver = exec('/usr/local/bin/DMR2YSF -v | cut -d\' \' -f 3-'); echo "
DMR2YSF
".$DMR2YSF_Ver."
\n"; } if (is_executable('/usr/local/bin/DMR2NXDN')) { $DMR2NXDN_Ver = exec('/usr/local/bin/DMR2NXDN -v | cut -d\' \' -f 3-'); echo "
DMR2NXDN
".$DMR2NXDN_Ver."
\n"; } if (is_executable('/usr/local/bin/YSFGateway')) { $YSFGateway_Ver = exec('/usr/local/bin/YSFGateway -v | cut -d\' \' -f 3-'); echo "
YSFGateway
".$YSFGateway_Ver."
\n"; } if (is_executable('/usr/local/bin/DGIdGateway')) { $DGIdGateway_Ver = exec('/usr/local/bin/DGIdGateway -v | cut -d\' \' -f 3-'); echo "
DGIdGateway
".$DGIdGateway_Ver."
\n"; } if (is_executable('/usr/local/bin/YSF2DMR')) { $YSF2DMR_Ver = exec('/usr/local/bin/YSF2DMR -v | cut -d\' \' -f 3-'); echo "
YSF2DMR
".$YSF2DMR_Ver."
\n"; } if (is_executable('/usr/local/bin/YSF2P25')) { $YSF2P25_Ver = exec('/usr/local/bin/YSF2P25 -v | cut -d\' \' -f 3-'); echo "
YSF2P25
".$YSF2P25_Ver."
\n"; } if (is_executable('/usr/local/bin/YSF2NXDN')) { $YSF2NXDN_Ver = exec('/usr/local/bin/YSF2NXDN -v | cut -d\' \' -f 3-'); echo "
YSF2NXDN
".$YSF2NXDN_Ver."
\n"; } if (is_executable('/usr/local/bin/P25Gateway')) { $P25Gateway_Ver = exec('/usr/local/bin/P25Gateway -v | cut -d\' \' -f 3-'); echo "
P25Gateway
".$P25Gateway_Ver."
\n"; } if (is_executable('/usr/local/bin/NXDNGateway')) { $NXDNGateway_Ver = exec('/usr/local/bin/NXDNGateway -v | cut -d\' \' -f 3-'); echo "
NXDNGateway
".$NXDNGateway_Ver."
\n"; } if (is_executable('/usr/local/bin/M17Gateway')) { $M17Gateway_Ver = exec('/usr/local/bin/M17Gateway -v | cut -d\' \' -f 3-'); echo "
M17Gateway
".$M17Gateway_Ver."
\n"; } if (is_executable('/usr/local/bin/DAPNETGateway')) { $DAPNETGateway_Ver = exec('/usr/local/bin/DAPNETGateway -v | cut -d\' \' -f 3-'); echo "
DAPNETGateway
".$DAPNETGateway_Ver."
\n"; } echo "
\n"; ?>