当前位置: 首页>>代码示例>>PHP>>正文


PHP get_service_status函数代码示例

本文整理汇总了PHP中get_service_status函数的典型用法代码示例。如果您正苦于以下问题:PHP get_service_status函数的具体用法?PHP get_service_status怎么用?PHP get_service_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_service_status函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_services

<?php 
$services = get_services();
if (count($services) > 0) {
    uasort($services, "service_name_compare");
    foreach ($services as $service) {
        if (empty($service['name'])) {
            continue;
        }
        if (empty($service['description'])) {
            $service['description'] = get_pkg_descr($service['name']);
        }
        echo "<tr><td class=\"listlr\" width=\"20%\">" . $service['name'] . "</td>\n";
        echo "<td class=\"listr\" width=\"55%\">" . $service['description'] . "</td>\n";
        // if service is running then listr else listbg
        $bgclass = null;
        if (get_service_status($service)) {
            $bgclass = "listr";
        } else {
            $bgclass = "listbg";
        }
        echo "<td class=\"" . $bgclass . "\" align=\"center\">" . get_service_status_icon($service, true, true) . "</td>\n";
        echo "<td valign=\"middle\" class=\"list nowrap\">" . get_service_control_links($service);
        $scut = get_shortcut_by_service_name($service['name']);
        if (!empty($scut)) {
            echo get_shortcut_main_link($scut, true, $service);
            echo get_shortcut_status_link($scut, true, $service);
            echo get_shortcut_log_link($scut, true);
        }
        echo "</td></tr>\n";
    }
} else {
开发者ID:nmccurdy,项目名称:pfsense,代码行数:31,代码来源:status_services.php

示例2: get_service_status

<?php

// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
use LibreNMS\ObjectCache;
$service_status = get_service_status();
$typeahead_limit = $config['webui']['global_search_result_limit'];
$if_alerts = dbFetchCell("SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0'");
if ($_SESSION['userlevel'] >= 5) {
    $links['count'] = dbFetchCell("SELECT COUNT(*) FROM `links`");
} else {
    $links['count'] = dbFetchCell("SELECT COUNT(*) FROM `links` AS `L`, `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` AND `L`.`local_device_id` = `D`.`device_id`", array($_SESSION['user_id']));
}
if (isset($config['enable_bgp']) && $config['enable_bgp']) {
    $bgp_alerts = dbFetchCell("SELECT COUNT(bgpPeer_id) FROM bgpPeers AS B where (bgpPeerAdminStatus = 'start' OR bgpPeerAdminStatus = 'running') AND bgpPeerState != 'established'");
}
if (isset($config['site_style']) && ($config['site_style'] == 'dark' || $config['site_style'] == 'mono')) {
    $navbar = 'navbar-inverse';
} else {
    $navbar = '';
}
?>

<nav class="navbar navbar-default <?php 
echo $navbar;
?>
 navbar-fixed-top" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navHeaderCollapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:print-menubar.php

示例3: update_services_status_all

function update_services_status_all()
{
    $result = DBselect('SELECT s.serviceid,s.algorithm,s.triggerid' . ' FROM services s' . ' WHERE s.serviceid NOT IN (' . 'SELECT DISTINCT sl.serviceupid' . ' FROM services_links sl' . ')');
    while ($row = DBfetch($result)) {
        $status = get_service_status($row['serviceid'], $row['algorithm'], $row['triggerid']);
        DBexecute('UPDATE services SET status=' . zbx_dbstr($status) . ' WHERE serviceid=' . $row['serviceid']);
        add_service_alarm($row['serviceid'], $status, time());
    }
    $result = DBselect('SELECT MAX(sl.servicedownid) AS serviceid,sl.serviceupid' . ' FROM services_links sl' . ' WHERE sl.servicedownid NOT IN (' . 'SELECT DISTINCT sl.serviceupid FROM services_links sl' . ')' . ' GROUP BY sl.serviceupid');
    while ($row = DBfetch($result)) {
        update_services_rec($row['serviceid']);
    }
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:13,代码来源:services.inc.php

示例4: explode

<?php 
$skipservices = explode(",", $config['widgets']['servicestatusfilter']);
if (count($services) > 0) {
    uasort($services, "service_name_compare");
    foreach ($services as $service) {
        if (!$service['name'] || in_array($service['name'], $skipservices) || !is_service_enabled($service['name'])) {
            continue;
        }
        if (empty($service['description'])) {
            $service['description'] = get_pkg_descr($service['name']);
        }
        $service_desc = explode(".", $service['description']);
        ?>
		<tr>
			<td><i class="fa fa-<?php 
        echo get_service_status($service) ? 'check-circle text-success' : 'times-circle text-warning';
        ?>
"></i></td>
			<td><?php 
        echo $service['name'];
        ?>
</td>
			<td><?php 
        echo $service_desc[0];
        ?>
</td>
			<td><?php 
        echo get_service_control_GET_links($service);
        ?>
</td>
		</tr>
开发者ID:calvinbui,项目名称:pfsense,代码行数:31,代码来源:services_status.widget.php

示例5: dbFetchCell

<?php

$overview = 1;
$ports['total'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = ?", array($device['device_id']));
$ports['up'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifOperStatus` = 'up' AND `ifAdminStatus` = 'up'", array($device['device_id']));
$ports['down'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up'", array($device['device_id']));
$ports['disabled'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifAdminStatus` = 'down'", array($device['device_id']));
$services = get_service_status($device['device_id']);
$services['total'] = array_sum($services);
if ($services[2]) {
    $services_colour = $warn_colour_a;
} else {
    $services_colour = $list_colour_a;
}
if ($ports['down']) {
    $ports_colour = $warn_colour_a;
} else {
    $ports_colour = $list_colour_a;
}
echo '
<div class="container-fluid">
  <div class="row">
    <div class="col-md-12">
      &nbsp;
    </div>
  </div>
  <div class="row">
    <div class="col-md-6">
';
require 'includes/dev-overview-data.inc.php';
Plugins::call('device_overview_container', array($device));
开发者ID:greggcz,项目名称:librenms,代码行数:31,代码来源:overview.inc.php

示例6: update_services_status_all

function update_services_status_all()
{
    clear_parents_from_trigger();
    $result = DBselect('SELECT s.serviceid,s.algorithm,s.triggerid ' . ' FROM services s ' . ' WHERE s.serviceid NOT IN (select distinct sl.serviceupid from services_links sl)');
    while ($rows = DBfetch($result)) {
        $status = get_service_status($rows['serviceid'], $rows['algorithm'], $rows['triggerid']);
        DBexecute('UPDATE services SET status = ' . $status . ' WHERE serviceid=' . $rows['serviceid']);
        add_service_alarm($rows['serviceid'], $status, time());
    }
    $result = DBselect('SELECT MAX(sl.servicedownid) as serviceid, sl.serviceupid ' . ' FROM services_links sl ' . ' WHERE sl.servicedownid NOT IN (select distinct sl.serviceupid from services_links sl) ' . ' GROUP BY sl.serviceupid');
    while ($rows = DBfetch($result)) {
        update_services_rec($rows['serviceid']);
    }
}
开发者ID:phedders,项目名称:zabbix,代码行数:14,代码来源:services.inc.php

示例7: explode

<?php 
$skipservices = explode(",", $config['widgets']['servicestatusfilter']);
if (count($services) > 0) {
    uasort($services, "service_name_compare");
    foreach ($services as $service) {
        if (!$service['name'] || in_array($service['name'], $skipservices) || !is_service_enabled($service['name'])) {
            continue;
        }
        if (empty($service['description'])) {
            $service['description'] = get_pkg_descr($service['name']);
        }
        $service_desc = explode(".", $service['description']);
        ?>
		<tr>
			<td><i class="icon icon-<?php 
        echo get_service_status($service) ? 'ok' : 'remove';
        ?>
-sign"></i></td>
			<td><?php 
        echo $service['name'];
        ?>
</td>
			<td><?php 
        echo $service_desc[0];
        ?>
</td>
			<td><?php 
        echo get_service_control_links($service);
        ?>
</td>
		</tr>
开发者ID:simudream,项目名称:pfsense,代码行数:31,代码来源:services_status.widget.php

示例8: check_action

<?php

require_once "includes/functions.inc.php";
require_once "includes/format.inc.php";
require_once "includes/config.inc.php";
if ($_POST["client"] && ($action = $_POST["action"])) {
    $client = $_POST["client"];
    $action = $_POST["action"];
    $msj = check_action($service, $client, $action);
}
// Print Document Headers
doc_header($msj);
// Get service status
$service_status = get_service_status($service, $status_opts);
// Get playback status
$playback_status = get_playback_status();
print "<strong>now playing:</strong>";
print '<div style="width:50%;"><marquee behavior="scroll" direction="left"><pre>' . $playback_status . '</pre></marquee></div>';
print '<hr align="center" width="80%" noshade="noshade" />';
// Separate each instance
$delimiters = array("\n");
$result = multiexplode($delimiters, $service_status);
// Process each instance
foreach ($result as $pre_status) {
    // Separate name and process status
    $delimiters = array(" ");
    $info = multiexplode($delimiters, $pre_status);
    // Get usefull data
    $replace = array("(", ")");
    $name = str_replace($replace, " ", "{$info['0']}");
    $status = $info[1];
开发者ID:jefonseca,项目名称:kimbo,代码行数:31,代码来源:index.php

示例9: explode

<?php 
$skipservices = explode(",", $config['widgets']['servicestatusfilter']);
if (count($services) > 0) {
    uasort($services, "service_name_compare");
    foreach ($services as $service) {
        if (!$service['name'] || in_array($service['name'], $skipservices) || !is_service_enabled($service['name'])) {
            continue;
        }
        if (empty($service['description'])) {
            $service['description'] = get_pkg_descr($service['name']);
        }
        $service_desc = explode(".", $service['description']);
        ?>
		<tr>
			<td><i class="fa fa-<?php 
        echo get_service_status($service) ? 'check' : 'times';
        ?>
-circle"></i></td>
			<td><?php 
        echo $service['name'];
        ?>
</td>
			<td><?php 
        echo $service_desc[0];
        ?>
</td>
			<td><?php 
        echo get_service_control_GET_links($service);
        ?>
</td>
		</tr>
开发者ID:michaeleino,项目名称:pfsense,代码行数:31,代码来源:services_status.widget.php


注:本文中的get_service_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。