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


PHP PluginMonitoringProfile类代码示例

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


在下文中一共展示了PluginMonitoringProfile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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