本文整理汇总了PHP中PluginMonitoringProfile类的典型用法代码示例。如果您正苦于以下问题:PHP PluginMonitoringProfile类的具体用法?PHP PluginMonitoringProfile怎么用?PHP PluginMonitoringProfile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginMonitoringProfile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pluginMonitoringInstall
function pluginMonitoringInstall($version)
{
global $DB, $LANG, $CFG_GLPI;
// ** Insert in DB
$DB_file = GLPI_ROOT . "/plugins/monitoring/install/mysql/plugin_monitoring-" . $version . "-empty.sql";
$DBf_handle = fopen($DB_file, "rt");
$sql_query = fread($DBf_handle, filesize($DB_file));
fclose($DBf_handle);
foreach (explode(";\n", "{$sql_query}") as $sql_line) {
if (get_magic_quotes_runtime()) {
$sql_line = stripslashes_deep($sql_line);
}
if (!empty($sql_line)) {
$DB->query($sql_line);
}
}
include GLPI_ROOT . "/plugins/monitoring/inc/profile.class.php";
$pmProfile = new PluginMonitoringProfile();
$pmProfile->initProfile();
include GLPI_ROOT . "/plugins/monitoring/inc/command.class.php";
$pmCommand = new PluginMonitoringCommand();
$pmCommand->initCommands();
include GLPI_ROOT . "/plugins/monitoring/inc/notificationcommand.class.php";
$pmNotificationcommand = new PluginMonitoringNotificationcommand();
$pmNotificationcommand->initCommands();
include GLPI_ROOT . "/plugins/monitoring/inc/check.class.php";
$pmCheck = new PluginMonitoringCheck();
$pmCheck->initChecks();
include GLPI_ROOT . "/plugins/monitoring/inc/hostconfig.class.php";
$pmHostconfig = new PluginMonitoringHostconfig();
$pmHostconfig->initConfig();
include GLPI_ROOT . "/plugins/monitoring/inc/config.class.php";
$pmConfig = new PluginMonitoringConfig();
$pmConfig->initConfig();
$query = "UPDATE `glpi_plugin_monitoring_configs`\n SET `version`='" . PLUGIN_MONITORING_VERSION . "'\n WHERE `id`='1'";
$DB->query($query);
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring");
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring/templates')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring/templates");
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring/weathermapbg')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring/weathermapbg");
}
CronTask::Register('PluginMonitoringServiceevent', 'updaterrd', '300', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
CronTask::Register('PluginMonitoringLog', 'cleanlogs', '96400', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
CronTask::Register('PluginMonitoringUnavaibility', 'unavaibility', '300', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:49,代码来源:install.php
示例2: defineTabs
function defineTabs($options = array())
{
global $LANG, $CFG_GLPI;
if (isset($_GET['glpi_tab'])) {
setActiveTab("PluginMonitoringDisplay", $_GET['glpi_tab']);
}
$pmDisplayview = new PluginMonitoringDisplayview();
$ong = array();
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$ong[1] = $LANG['plugin_monitoring']['servicescatalog'][0];
}
if (PluginMonitoringProfile::haveRight("componentscatalog", 'r')) {
$ong[2] = $LANG['plugin_monitoring']['componentscatalog'][0];
}
$ong[3] = $LANG['plugin_monitoring']['service'][21];
$ong[4] = $LANG['plugin_monitoring']['host'][1];
if (PluginMonitoringProfile::haveRight("view", 'r')) {
$i = 5;
$a_views = $pmDisplayview->getViews();
foreach ($a_views as $name) {
$ong[$i] = htmlentities($name);
$i++;
}
}
return $ong;
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:26,代码来源:display.class.php
示例3: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
$array_ret = array();
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$array_ret[49] = self::createTabEntry(__('Monitoring', 'monitoring') . "-" . __('Services catalog', 'monitoring'));
}
return $array_ret;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:8,代码来源:servicescatalog.class.php
示例4: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
$array_ret = array();
if ($item->getID() > -1) {
if (PluginMonitoringProfile::haveRight("config", 'r')) {
$array_ret[0] = self::createTabEntry(__('Monitoring', 'monitoring'));
}
}
return $array_ret;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:10,代码来源:entity.class.php
示例5: getMessages
static function getMessages()
{
global $CFG_GLPI;
$pmMessage = new self();
// Display if shinken is in restart or if restarted less than 5 minutes
echo "<div id='shikenrestart'></div>";
echo "<script type=\"text/javascript\">\n var elshikenrestart = Ext.get(\"shikenrestart\");\n var mgrshikenrestart = elshikenrestart.getUpdateManager();\n mgrshikenrestart.loadScripts=true;\n mgrshikenrestart.showLoadIndicator=false;\n mgrshikenrestart.startAutoRefresh(20, \"" . $CFG_GLPI["root_doc"] . "/plugins/monitoring/ajax/updateshinkenrestartmessage.php\", \"\", \"\", true);";
echo "</script>";
$servicecatalog = '';
$confchanges = '';
if (PluginMonitoringProfile::haveRight("servicescatalog", 'w')) {
$servicecatalog = $pmMessage->servicescatalogMessage();
}
$confchanges = $pmMessage->configurationchangesMessage();
$runningshinken = $pmMessage->ShinkennotrunMessage();
$i = 0;
if ($servicecatalog != '' or $confchanges != '') {
echo "<div class='msgboxmonit msgboxmonit-orange'>";
if ($confchanges != '') {
echo $confchanges;
$i++;
}
if ($servicecatalog != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-orange'>";
}
echo $servicecatalog;
$i++;
}
if ($runningshinken != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-red'>";
}
echo $runningshinken . "!";
$i++;
}
echo "</div>";
}
}
开发者ID:geldarr,项目名称:hack-space,代码行数:41,代码来源:message.class.php
示例6: getMessages
static function getMessages()
{
$pmMessage = new self();
$servicecatalog = '';
$confchanges = '';
if (PluginMonitoringProfile::haveRight("servicescatalog", 'w')) {
$servicecatalog = $pmMessage->servicescatalogMessage();
}
$confchanges = $pmMessage->configurationchangesMessage();
$runningshinken = $pmMessage->ShinkennotrunMessage();
$i = 0;
if ($servicecatalog != '' or $confchanges != '') {
echo "<div class='msgboxmonit msgboxmonit-orange'>";
if ($confchanges != '') {
echo $confchanges;
$i++;
}
if ($servicecatalog != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-orange'>";
}
echo $servicecatalog;
$i++;
}
if ($runningshinken != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-red'>";
}
echo $runningshinken . "!";
$i++;
}
echo "</div>";
}
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:36,代码来源:message.class.php
示例7: canView
static function canView()
{
return PluginMonitoringProfile::haveRight("componentscatalog", 'r');
}
开发者ID:geldarr,项目名称:hack-space,代码行数:4,代码来源:networkport.class.php
示例8: Copyright
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2012 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
define('GLPI_ROOT', '../../..');
include GLPI_ROOT . "/inc/includes.php";
PluginMonitoringProfile::checkRight("view", "w");
commonHeader($LANG['plugin_monitoring']['title'][0], $_SERVER["PHP_SELF"], "plugins", "monitoring", "displayview");
$pmDisplayview = new PluginMonitoringDisplayview();
if (isset($_POST['users_id'])) {
if ($_POST['users_id'] == 'public') {
$_POST['users_id'] = '0';
} else {
$_POST['users_id'] = $_SESSION['glpiID'];
}
}
if (isset($_POST["add"])) {
$pmDisplayview->add($_POST);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST["update"])) {
$pmDisplayview->update($_POST);
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:30,代码来源:displayview.form.php
示例9: __
echo "</th>";
echo "<th rowspan='2'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/tag.php'>" . __('Tag', 'monitoring') . "</a>";
}
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th width='15%' height='25'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/command.php'>" . __('Commands', 'monitoring') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (PluginMonitoringProfile::haveRight("check", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/check.php'>" . __('Check definition', 'monitoring') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (Session::haveRight('calendar', 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/calendar.php'>" . __('Calendar') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/eventhandler.php'>" . __('Event handler', 'monitoring') . "</a>";
}
echo "</th>";
echo "</table>";
}
Html::footer();
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:menu.php
示例10: Copyright
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2012 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
define('GLPI_ROOT', '../../..');
include GLPI_ROOT . "/inc/includes.php";
PluginMonitoringProfile::checkRight("config", "w");
commonHeader($LANG['plugin_monitoring']['title'][0], $_SERVER["PHP_SELF"], "plugins", "monitoring", "config");
$pmConfig = new PluginMonitoringConfig();
if (isset($_POST["update"])) {
$pmConfig->update($_POST);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST['timezones_add'])) {
$input = array();
$pmConfig->getFromDB($_POST['id']);
$input['id'] = $_POST['id'];
$a_timezones = importArrayFromDB($pmConfig->fields['timezones']);
foreach ($_POST['timezones_to_add'] as $timezone) {
$a_timezones[] = $timezone;
}
$input['timezones'] = exportArrayToDB($a_timezones);
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:30,代码来源:config.form.php
示例11: canView
function canView()
{
return PluginMonitoringProfile::haveRight("servicescatalog", 'r');
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:4,代码来源:businessrule.class.php
示例12: Copyright
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Monitoring. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------------
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2013 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
PluginMonitoringProfile::checkRight("servicescatalog", "w");
$dropdown = new PluginMonitoringServicescatalog();
if (isset($_GET['detail']) and isset($_GET['id'])) {
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "servicescatalog");
$dropdown->showBADetail($_GET['id']);
Html::footer();
} else {
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "servicescatalog");
include GLPI_ROOT . "/front/dropdown.common.form.php";
}
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:servicescatalog.form.php
示例13: canUndo
function canUndo()
{
return PluginMonitoringProfile::haveRight("view", 'w');
}
开发者ID:geldarr,项目名称:hack-space,代码行数:4,代码来源:displayview_item.class.php
示例14:
}
echo "</th>";
echo "<th rowspan='2'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/realm.php'>" . $LANG['plugin_monitoring']['realms'][0] . "</a>";
}
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th width='18%' height='25'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/command.php'>" . $LANG['plugin_monitoring']['command'][0] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (PluginMonitoringProfile::haveRight("check", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/check.php'>" . $LANG['plugin_monitoring']['check'][0] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (haveRight('calendar', 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/calendar.php'>" . $LANG['buttons'][15] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/rrdtemplate.php'>" . $LANG['plugin_monitoring']['rrdtemplates'][0] . "</a>";
}
echo "</th>";
echo "</table>";
commonFooter();
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:31,代码来源:menu.php
示例15: canCancel
function canCancel()
{
return PluginMonitoringProfile::haveRight("config", 'w');
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:4,代码来源:contacttemplate.class.php
示例16: Copyright
You should have received a copy of the GNU Affero General Public License
along with Monitoring. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------------
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2013 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkRight("profile", "r");
$pmProfile = new PluginMonitoringProfile();
Session::checkRight("profile", "w");
if ($pmProfile->getFromDB($_POST['profiles_id'])) {
$pmProfile->update($_POST);
$pmProfile->changeprofile();
Html::back();
} else {
$pmProfile->add($_POST);
$pmProfile->changeprofile();
Html::back();
}
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:profile.form.php
示例17: checkRight
static function checkRight($module, $right)
{
global $CFG_GLPI;
if (!PluginMonitoringProfile::haveRight($module, $right)) {
// Gestion timeout session
if (!Session::getLoginUserID()) {
Html::redirect($CFG_GLPI["root_doc"] . "/index.php");
exit;
}
Html::displayRightError();
}
}
开发者ID:geldarr,项目名称:hack-space,代码行数:12,代码来源:profile.class.php
示例18: pluginMonitoringInstall
function pluginMonitoringInstall($version)
{
global $DB, $CFG_GLPI;
// ** Insert in DB
$DB_file = GLPI_ROOT . "/plugins/monitoring/install/mysql/plugin_monitoring-" . $version . "-empty.sql";
$DBf_handle = fopen($DB_file, "rt");
$sql_query = fread($DBf_handle, filesize($DB_file));
fclose($DBf_handle);
foreach (explode(";\n", "{$sql_query}") as $sql_line) {
if (get_magic_quotes_runtime()) {
$sql_line = Toolbox::stripslashes_deep($sql_line);
}
if (!empty($sql_line)) {
$DB->query($sql_line);
}
}
include GLPI_ROOT . "/plugins/monitoring/inc/profile.class.php";
$pmProfile = new PluginMonitoringProfile();
$pmProfile->initProfile();
include GLPI_ROOT . "/plugins/monitoring/inc/command.class.php";
$pmCommand = new PluginMonitoringCommand();
$pmCommand->initCommands();
include GLPI_ROOT . "/plugins/monitoring/inc/notificationcommand.class.php";
$pmNotificationcommand = new PluginMonitoringNotificationcommand();
$pmNotificationcommand->initCommands();
include GLPI_ROOT . "/plugins/monitoring/inc/check.class.php";
$pmCheck = new PluginMonitoringCheck();
$pmCheck->initChecks();
include GLPI_ROOT . "/plugins/monitoring/inc/hostconfig.class.php";
$pmHostconfig = new PluginMonitoringHostconfig();
$pmHostconfig->initConfig();
include GLPI_ROOT . "/plugins/monitoring/inc/config.class.php";
$pmConfig = new PluginMonitoringConfig();
$pmConfig->initConfig();
$query = "UPDATE `glpi_plugin_monitoring_configs`\n SET `version`='" . PLUGIN_MONITORING_VERSION . "'\n WHERE `id`='1'";
$DB->query($query);
$query = "SELECT * FROM `glpi_calendars`\n WHERE `name`='24x7'\n LIMIT 1";
$result = $DB->query($query);
if ($DB->numrows($result) == 0) {
$calendar = new Calendar();
$input = array();
$input['name'] = '24x7';
$input['is_recursive'] = 1;
$calendars_id = $calendar->add($input);
$calendarSegment = new CalendarSegment();
$input = array();
$input['calendars_id'] = $calendars_id;
$input['is_recursive'] = 1;
$input['begin'] = '00:00:00';
$input['end'] = '24:00:00';
$input['day'] = '0';
$calendarSegment->add($input);
$input['day'] = '1';
$calendarSegment->add($input);
$input['day'] = '2';
$calendarSegment->add($input);
$input['day'] = '3';
$calendarSegment->add($input);
$input['day'] = '4';
$calendarSegment->add($input);
$input['day'] = '5';
$calendarSegment->add($input);
$input['day'] = '6';
$calendarSegment->add($input);
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring");
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring/templates')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring/templates");
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR . '/monitoring/weathermapbg')) {
mkdir(GLPI_PLUGIN_DOC_DIR . "/monitoring/weathermapbg");
}
CronTask::Register('PluginMonitoringServiceevent', 'updaterrd', '300', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
CronTask::Register('PluginMonitoringLog', 'cleanlogs', '96400', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
CronTask::Register('PluginMonitoringUnavaibility', 'unavaibility', '300', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
CronTask::Register('PluginMonitoringDisplayview_rule', 'replayallviewrules', '1200', array('mode' => 2, 'allowmode' => 3, 'logs_lifetime' => 30));
}
开发者ID:geldarr,项目名称:hack-space,代码行数:79,代码来源:install.php
示例19: Copyright
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2013 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkCentralAccess();
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "services");
$pmService = new PluginMonitoringService();
if (isset($_POST['update'])) {
foreach ($_POST['arg'] as $key => $value) {
if ($value == '') {
unset($_POST['arg'][$key]);
}
}
$_POST['arguments'] = exportArrayToDB($_POST['arg']);
$pmService->update($_POST);
Html::back();
}
if (PluginMonitoringProfile::haveRight("componentscatalog", 'w')) {
$pmService->showCustomArguments($_GET['id']);
}
Html::footer();
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:servicearg.form.php
示例20: displayLine
//.........这里部分代码省略.........
echo "</td>";
if ($displayhost == '1') {
$pmComponentscatalog_Host->getFromDB($data["plugin_monitoring_componentscatalogs_hosts_id"]);
if (isset($pmComponentscatalog_Host->fields['itemtype']) and $pmComponentscatalog_Host->fields['itemtype'] != '') {
$itemtype = $pmComponentscatalog_Host->fields['itemtype'];
$item = new $itemtype();
$item->getFromDB($pmComponentscatalog_Host->fields['items_id']);
echo "<td>";
echo $item->getTypeName() . " : " . $item->getLink();
if (!is_null($pMonitoringService->fields['networkports_id']) and $pMonitoringService->fields['networkports_id'] > 0) {
$networkPort->getFromDB($pMonitoringService->fields['networkports_id']);
echo " [" . $networkPort->getLink() . "]";
}
echo "</td>";
} else {
echo "<td>" . __('Resources', 'monitoring') . "</td>";
}
}
echo "<td>" . $pMonitoringComponent->getLink();
if (!is_null($pMonitoringService->fields['networkports_id']) and $pMonitoringService->fields['networkports_id'] > 0) {
$networkPort->getFromDB($pMonitoringService->fields['networkports_id']);
echo " [" . $networkPort->getLink() . "]";
}
echo "</td>";
// $nameitem = '';
// if (isset($itemmat->fields['name'])) {
// $nameitem = "[".$itemmat->getLink(1)."]";
// }
//if ($pMonitoringService->fields['plugin_monitoring_services_id'] == '0') {
//echo "<td>".$itemmat->getLink(1)."</td>";
// } else {
// $pMonitoringServiceH->getFromDB($pMonitoringService->fields['plugin_monitoring_services_id']);
// $itemtypemat = $pMonitoringServiceH->fields['itemtype'];
// $itemmat = new $itemtypemat();
// $itemmat->getFromDB($pMonitoringServiceH->fields['items_id']);
// echo "<td>".$pMonitoringService->getLink(1).$nameitem." ".__('on', 'monitoring')." ".$itemmat->getLink(1)."</td>";
// }
// unset($itemmat);
echo "<td class='center'>";
if ($shortstate == 'red') {
echo "<table>";
echo "<tr>";
echo "<td>";
echo $data['state'];
echo "</td>";
echo "<td>";
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/acknowledge.form.php?id=" . $data['id'] . "'>" . "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/acknowledge_checked.png'" . " alt='" . __('Define an acknowledge', 'monitoring') . "'" . " title='" . __('Define an acknowledge', 'monitoring') . "'/>" . "</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
} else {
echo $data['state'];
}
echo "</td>";
echo "<td>";
echo Html::convDate($data['last_check']) . ' ' . substr($data['last_check'], 11, 8);
echo "</td>";
echo "<td>";
echo $data['event'];
echo "</td>";
echo "<td align='center'>";
$segments = CalendarSegment::getSegmentsBetween($pMonitoringComponent->fields['calendars_id'], date('w', date('U')), date('H:i:s'), date('w', date('U')), date('H:i:s'));
if (count($segments) == '0') {
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/service_pause.png' />";
} else {
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/service_run.png' />";
}
echo "</td>";
if ($displayhost == '0') {
$pmUnavaibility = new PluginMonitoringUnavaibility();
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'currentmonth', 1);
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'lastmonth', 1);
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'currentyear', 1);
echo "<td class='center'>";
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/unavaibility.php?" . "field[0]=2&searchtype[0]=equals&contains[0]=" . $pMonitoringService->fields['id'] . "&sort=3&order=DESC&itemtype=PluginMonitoringUnavaibility'>\n <img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/info.png'/></a>";
echo "</td>";
}
echo "<td>";
if ($shortstate == 'redblue') {
echo "<i>" . _n('User', 'Users', 1) . " : </i>";
$user = new User();
$user->getFromDB($data['acknowledge_users_id']);
echo $user->getName(1);
echo "<br/>";
echo "<i>" . __('Comments') . " : </i>" . $data['acknowledge_comment'];
}
echo "</td>";
if ($displayhost == '0') {
echo "<td>";
if (PluginMonitoringProfile::haveRight("componentscatalog", 'w')) {
$a_arg = importArrayFromDB($pMonitoringService->fields['arguments']);
$cnt = '';
if (count($a_arg) > 0) {
$cnt = " (" . count($a_arg) . ")";
}
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/servicearg.form.php?id=" . $data['id'] . "'>" . __('Configure', 'monitoring') . $cnt . "</a>";
}
echo "</td>";
}
}
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:display.class.php
注:本文中的PluginMonitoringProfile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论