function get_disks() { global $g, $debug; $disks_array = array(); $disks_s = explode(" ", get_single_sysctl("kern.disks")); foreach ($disks_s as $disk) { if (trim($disk)) { $disks_array[] = $disk; } } return $disks_array; }
<div class="progress" > <div id="memUsagePB" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="<?php echo $memUsage; ?> " aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $memUsage; ?> %"> </div> </div> <span id="memusagemeter"><?php echo $memUsage; ?> </span><span>% of <?php echo sprintf("%.0f", get_single_sysctl('hw.physmem') / (1024 * 1024)); ?> MiB</span> </td> </tr> <?php if ($showswap == true) { ?> <tr> <th><?php echo gettext("SWAP usage"); ?> </th> <td> <?php $swapusage = swap_usage();
function get_cpu_count($show_detail = false) { $cpucount = get_single_sysctl('kern.smp.cpus'); if ($show_detail) { $cpudetail = ""; exec("/usr/bin/grep 'SMP.*package.*core' /var/log/dmesg.boot | /usr/bin/cut -f2- -d' '", $cpudetail); $cpucount = $cpudetail[0]; } return $cpucount; }
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ $nocsrf = true; require_once "guiconfig.inc"; require_once "pfsense-utils.inc"; require_once "interfaces.inc"; require_once "widgets/include/carp_status.inc"; $carp_enabled = get_single_sysctl('net.inet.carp.allow') > 0; ?> <table class="table table-striped" width="100%" border="0" cellspacing="0" cellpadding="0" summary="carp status"> <?php if (isset($config['virtualip']['vip'])) { $carpint = 0; foreach ($config['virtualip']['vip'] as $carp) { if ($carp['mode'] != "carp") { continue; } $ipaddress = $carp['subnet']; $password = $carp['password']; $netmask = $carp['subnet_bits']; $vhid = $carp['vhid']; $advskew = $carp['advskew']; $status = get_carp_interface_status("{$carp['interface']}_vip{$vhid}");
exit; } ## Find out whether there's hardware encryption or not unset($hwcrypto); $fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r"); if ($fd) { while (!feof($fd)) { $dmesgl = fgets($fd); if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/.*(VIA Padlock)/", $dmesgl, $matches) or preg_match("/^safe.: (\\w.*)/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { $hwcrypto = $matches[1]; break; } } fclose($fd); if (!isset($hwcrypto) && get_single_sysctl("dev.aesni.0.%desc")) { $hwcrypto = get_single_sysctl("dev.aesni.0.%desc"); } } ##build widget saved list information if ($config['widgets'] && $config['widgets']['sequence'] != "") { $pconfig['sequence'] = $config['widgets']['sequence']; $widgetsfromconfig = array(); foreach (explode(',', $pconfig['sequence']) as $line) { list($file, $col, $display) = explode(':', $line); // be backwards compatible // If the display column information is missing, we will assign a temporary // column here. Next time the user saves the dashboard it will fix itself if ($col == "") { if ($file == "system_information") { $col = "col1"; } else {
interfaces_carp_setup(); set_single_sysctl('net.inet.carp.allow', '1'); } } } $carpcount = 0; foreach ($a_vip as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break; } } // fetch pfsync info $pfsyncnodes = json_decode(configd_run("filter list pfsync json"), true); legacy_html_escape_form_data($a_vip); $status = get_single_sysctl('net.inet.carp.allow') > 0; $carp_detected_problems = array_pop(get_sysctl("net.inet.carp.demotion")) > 0; include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <section class="page-content-main"> <div class="container-fluid"> <div class="row"> <?php if (isset($savemsg)) { print_info_box($savemsg);
interface_ipalias_configure($vip); } break; } } } interfaces_sync_setup(); set_single_sysctl('net.inet.carp.allow', '1'); $status = 1; } } $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); if (!empty($_POST['resetdemotion'])) { set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}"); sleep(1); $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); } $pgtitle = array(gettext("Status"), gettext("CARP")); $shortcut_section = "carp"; include "head.inc"; if ($savemsg) { print_info_box($savemsg, 'success'); } $carpcount = 0; if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break; } }
?> </td> <td width="75%" class="listr"> <?php $memUsage = mem_usage(); ?> <div class="progress"> <div id="memUsagePB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"> <span class="sr-only"></span> </div> </div> <span id="memusagemeter"><?php echo $memUsage . '%'; ?> </span> used <?php echo sprintf("%.0f/%.0f", $memUsage / 100.0 * get_single_sysctl('hw.physmem') / (1024 * 1024), get_single_sysctl('hw.physmem') / (1024 * 1024)); ?> MB </td> </tr> <?php if ($showswap == true) { ?> <tr> <td width="25%" class="vncellt"><?php echo gettext("SWAP usage"); ?> </td> <td width="75%" class="listr"> <?php $swapusage = swap_usage();