Example #1
0
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/hosts.inc.php';
require_once 'include/html.inc.php';
$page["title"] = "S_SEARCH";
$page['file'] = 'search.php';
$page['hist_arg'] = array();
$page['scripts'] = array('pmaster.js', 'menu_scripts.js', 'showhint.js', 'scriptaculous.js?load=effects');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
include_once 'include/page_header.php';
//		VAR				TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('type' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'search' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'favcnt' => array(T_ZBX_INT, O_OPT, null, null, NULL), 'action' => array(T_ZBX_STR, O_OPT, P_ACT, IN("'add','remove'"), NULL), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj}) && ("hat"=={favobj})'));
check_fields($fields);
// ACTION /////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['favobj'])) {
    $_REQUEST['pmasterid'] = get_request('pmasterid', 'mainpage');
    if ('hat' == $_REQUEST['favobj']) {
        update_profile('web.dashboard.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT);
    }
    if ('refresh' == $_REQUEST['favobj']) {
        switch ($_REQUEST['favid']) {
            case 'hat_syssum':
                $syssum = make_system_summary();
                $syssum->show();
                break;
            case 'hat_stszbx':
                $stszbx = make_status_of_zbx();
Example #2
0
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/triggers.inc.php';
require_once dirname(__FILE__) . '/include/services.inc.php';
$page['title'] = _('IT services');
$page['file'] = 'srv_status.php';
$page['hist_arg'] = array();
define('ZBX_PAGE_DO_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
$periods = array('today' => _('Today'), 'week' => _('This week'), 'month' => _('This month'), 'year' => _('This year'), 24 => _('Last 24 hours'), 24 * 7 => _('Last 7 days'), 24 * 30 => _('Last 30 days'), 24 * DAY_IN_YEAR => _('Last 365 days'));
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('serviceid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'showgraph' => array(T_ZBX_INT, O_OPT, P_SYS, IN('1'), 'isset({serviceid})'), 'period' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"' . implode('","', array_keys($periods)) . '"'), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null));
check_fields($fields);
if (isset($_REQUEST['serviceid']) && isset($_REQUEST['showgraph'])) {
    $service = API::Service()->get(array('output' => array('serviceid'), 'serviceids' => getRequest('serviceid')));
    $service = reset($service);
    if ($service) {
        $table = new CTable(null, 'chart');
        $table->addRow(new CImg('chart5.php?serviceid=' . $service['serviceid'] . url_param('path')));
        $table->show();
    } else {
        access_deny();
    }
} else {
    $period = getRequest('period', 7 * 24);
    $period_end = time();
    switch ($period) {
Example #3
0
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
$page['title'] = _('Custom graphs');
$page['file'] = 'charts.php';
$page['hist_arg'] = array('hostid', 'groupid', 'graphid');
$page['scripts'] = array('class.calendar.js', 'gtlc.js', 'flickerfreescreen.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
ob_start();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'graphid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null));
check_fields($fields);
/*
 * Permissions
 */
if (getRequest('groupid') && !API::HostGroup()->isReadable(array($_REQUEST['groupid']))) {
    access_deny();
}
if (getRequest('hostid') && !API::Host()->isReadable(array($_REQUEST['hostid']))) {
    access_deny();
}
if (getRequest('graphid')) {
    $graphs = API::Graph()->get(array('graphids' => array($_REQUEST['graphid']), 'output' => array('graphid')));
    if (!$graphs) {
        access_deny();
    }
Example #4
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/graphs.inc.php';
$page['file'] = 'chart7.php';
$page['title'] = "S_CHART";
$page['type'] = PAGE_TYPE_IMAGE;
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'from' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'name' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('2,3'), null), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
$items = get_request('items', array());
asort_by_key($items, 'sortorder');
foreach ($items as $gitem) {
    if (!($host = DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid=' . $gitem['itemid'])))) {
        fatal_error(S_NO_ITEM_DEFINED);
    }
    if (!isset($available_hosts[$host['hostid']])) {
        access_deny();
    }
}
$effectiveperiod = navigation_bar_calc();
if (count($items) == 1) {
    $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, null, $items['itemid']));
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/maps.inc.php';
$page['title'] = _('Logo');
$page['file'] = 'zbxe-customer-logo.php';
$page['type'] = detect_page_type(PAGE_TYPE_IMAGE);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION		EXCEPTION
$fields = array('sysmapid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'selements' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'links' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'noselements' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nolinks' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nocalculations' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'expand_macros' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'show_triggers' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2,3'), null), 'severity_min' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5'), null), 'grid' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 500), null), 'base64image' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null));
check_fields($fields);
$maps = API::Map()->get(array('sysmapids' => $_REQUEST['sysmapid'], 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND, 'preservekeys' => true));
$map = reset($maps);
if (empty($map)) {
    access_deny();
}
$mapPainter = new CMapPainter($map, array('map' => array('drawAreas' => !isset($_REQUEST['selements']) && !isset($_REQUEST['noselements'])), 'grid' => array('size' => get_request('grid', 0))));
$im = $mapPainter->paint();
$colors['Red'] = imagecolorallocate($im, 255, 0, 0);
$colors['Dark Red'] = imagecolorallocate($im, 150, 0, 0);
$colors['Green'] = imagecolorallocate($im, 0, 255, 0);
$colors['Dark Green'] = imagecolorallocate($im, 0, 150, 0);
$colors['Blue'] = imagecolorallocate($im, 0, 0, 255);
$colors['Dark Blue'] = imagecolorallocate($im, 0, 0, 150);
$colors['Yellow'] = imagecolorallocate($im, 255, 255, 0);
Example #6
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/media.inc.php";
require_once "include/forms.inc.php";
$page["title"] = "S_MEDIA_TYPES";
$page["file"] = "media_types.php";
$page['hist_arg'] = array('form', 'mediatypeid');
include_once "include/page_header.php";
$fields = array("mediatypeid" => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), "type" => array(T_ZBX_INT, O_OPT, NULL, IN(implode(',', array(MEDIA_TYPE_EMAIL, MEDIA_TYPE_EXEC, MEDIA_TYPE_SMS, MEDIA_TYPE_JABBER))), '(isset({save}))'), "description" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({save}))'), "smtp_server" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_helo" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_email" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "exec_path" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EXEC . ')&&isset({save})'), "gsm_modem" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_SMS . ')&&isset({save})'), "username" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({type})&&{type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "password" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "delete" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "form" => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh" => array(T_ZBX_INT, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('mt.description', ZBX_SORT_UP);
/* MEDIATYPE ACTIONS */
$result = 0;
if (isset($_REQUEST["save"])) {
    if (isset($_REQUEST["mediatypeid"])) {
        /* UPDATE */
        /*			$action = AUDIT_ACTION_UPDATE;*/
        $result = update_mediatype($_REQUEST["mediatypeid"], $_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
        show_messages($result, S_MEDIA_TYPE_UPDATED, S_MEDIA_TYPE_WAS_NOT_UPDATED);
    } else {
        /* ADD */
        /*			$action = AUDIT_ACTION_ADD;*/
        $result = add_mediatype($_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
        show_messages($result, S_ADDED_NEW_MEDIA_TYPE, S_NEW_MEDIA_TYPE_WAS_NOT_ADDED);
Example #7
0
$param1Str = [['C' => 'T', 'T' => T_ZBX_STR]];
$param2SecCount = [['C' => 'V', 'T' => T_ZBX_STR], ['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics]];
$param3SecVal = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => 'V', 'T' => T_ZBX_STR], ['C' => 'O', 'T' => T_ZBX_STR], ['C' => _('Time shift'), 'T' => T_ZBX_INT]];
$param3SecPercent = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Percentage') . ' (P)', 'T' => T_ZBX_DBL]];
$paramSecIntCount = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Mask'), 'T' => T_ZBX_STR], ['C' => _('Time shift'), 'T' => T_ZBX_INT]];
$paramForecast = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Time') . ' (t)', 'T' => T_ZBX_INT], ['C' => _('Fit'), 'T' => T_ZBX_STR], ['C' => _('Mode'), 'T' => T_ZBX_STR]];
$paramTimeleft = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Threshold'), 'T' => T_ZBX_DBL], ['C' => _('Fit'), 'T' => T_ZBX_STR]];
$allowedTypesAny = [ITEM_VALUE_TYPE_FLOAT => 1, ITEM_VALUE_TYPE_STR => 1, ITEM_VALUE_TYPE_LOG => 1, ITEM_VALUE_TYPE_UINT64 => 1, ITEM_VALUE_TYPE_TEXT => 1];
$allowedTypesNumeric = [ITEM_VALUE_TYPE_FLOAT => 1, ITEM_VALUE_TYPE_UINT64 => 1];
$allowedTypesStr = [ITEM_VALUE_TYPE_STR => 1, ITEM_VALUE_TYPE_LOG => 1, ITEM_VALUE_TYPE_TEXT => 1];
$allowedTypesLog = [ITEM_VALUE_TYPE_LOG => 1];
$allowedTypesInt = [ITEM_VALUE_TYPE_UINT64 => 1];
$functions = ['abschange[<]' => ['description' => _('Absolute difference between last and previous value is < N'), 'allowed_types' => $allowedTypesAny], 'abschange[>]' => ['description' => _('Absolute difference between last and previous value is > N'), 'allowed_types' => $allowedTypesAny], 'abschange[=]' => ['description' => _('Absolute difference between last and previous value is = N'), 'allowed_types' => $allowedTypesAny], 'abschange[<>]' => ['description' => _('Absolute difference between last and previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'avg[<]' => ['description' => _('Average value of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[>]' => ['description' => _('Average value of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[=]' => ['description' => _('Average value of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[<>]' => ['description' => _('Average value of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[<]' => ['description' => _('Difference between MAX and MIN value of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[>]' => ['description' => _('Difference between MAX and MIN value of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[=]' => ['description' => _('Difference between MAX and MIN value of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[<>]' => ['description' => _('Difference between MAX and MIN value of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'change[<]' => ['description' => _('Difference between last and previous value is < N'), 'allowed_types' => $allowedTypesAny], 'change[>]' => ['description' => _('Difference between last and previous value is > N'), 'allowed_types' => $allowedTypesAny], 'change[=]' => ['description' => _('Difference between last and previous value is = N'), 'allowed_types' => $allowedTypesAny], 'change[<>]' => ['description' => _('Difference between last and previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'count[<]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is < N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[>]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is > N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[=]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is = N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[<>]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is NOT N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'diff[=]' => ['description' => _('Difference between last and preceding values, then N = 1, 0 - otherwise'), 'allowed_types' => $allowedTypesAny], 'diff[<>]' => ['description' => _('Difference between last and preceding values, then N NOT 1, 0 - otherwise'), 'allowed_types' => $allowedTypesAny], 'last[<]' => ['description' => _('Last (most recent) T value is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[>]' => ['description' => _('Last (most recent) T value is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[=]' => ['description' => _('Last (most recent) T value is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[<>]' => ['description' => _('Last (most recent) T value is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'max[<]' => ['description' => _('Maximum value for period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[>]' => ['description' => _('Maximum value for period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[=]' => ['description' => _('Maximum value for period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[<>]' => ['description' => _('Maximum value for period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[<]' => ['description' => _('Minimum value for period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[>]' => ['description' => _('Minimum value for period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[=]' => ['description' => _('Minimum value for period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[<>]' => ['description' => _('Minimum value for period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'percentile[<]' => ['description' => _('Percentile P of a period T is < N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[>]' => ['description' => _('Percentile P of a period T is > N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[=]' => ['description' => _('Percentile P of a period T is = N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[<>]' => ['description' => _('Percentile P of a period T is NOT N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'prev[<]' => ['description' => _('Previous value is < N'), 'allowed_types' => $allowedTypesAny], 'prev[>]' => ['description' => _('Previous value is > N'), 'allowed_types' => $allowedTypesAny], 'prev[=]' => ['description' => _('Previous value is = N'), 'allowed_types' => $allowedTypesAny], 'prev[<>]' => ['description' => _('Previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'str[=]' => ['description' => _('Find string V in last (most recent) value. N = 1 - if found, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'str[<>]' => ['description' => _('Find string V in last (most recent) value. N NOT 1 - if found, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'strlen[<]' => ['description' => _('Length of last (most recent) T value in characters is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[>]' => ['description' => _('Length of last (most recent) T value in characters is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[=]' => ['description' => _('Length of last (most recent) T value in characters is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[<>]' => ['description' => _('Length of last (most recent) T value in characters is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'sum[<]' => ['description' => _('Sum of values of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[>]' => ['description' => _('Sum of values of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[=]' => ['description' => _('Sum of values of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[<>]' => ['description' => _('Sum of values of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'date[<]' => ['description' => _('Current date is < N'), 'allowed_types' => $allowedTypesAny], 'date[>]' => ['description' => _('Current date is > N'), 'allowed_types' => $allowedTypesAny], 'date[=]' => ['description' => _('Current date is = N'), 'allowed_types' => $allowedTypesAny], 'date[<>]' => ['description' => _('Current date is NOT N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[<]' => ['description' => _('Day of week is < N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[>]' => ['description' => _('Day of week is > N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[=]' => ['description' => _('Day of week is = N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[<>]' => ['description' => _('Day of week is NOT N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[<]' => ['description' => _('Day of month is < N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[>]' => ['description' => _('Day of month is > N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[=]' => ['description' => _('Day of month is = N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[<>]' => ['description' => _('Day of month is NOT N'), 'allowed_types' => $allowedTypesAny], 'fuzzytime[=]' => ['description' => _('Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N = 0, 1 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'fuzzytime[<>]' => ['description' => _('Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N NOT 0, 1 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'regexp[=]' => ['description' => _('Regular expression V matching last value in period T, then N = 1, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'regexp[<>]' => ['description' => _('Regular expression V matching last value in period T, then N NOT 1, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'iregexp[=]' => ['description' => _('Regular expression V matching last value in period T, then N = 1, 0 - otherwise (non case-sensitive)'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'iregexp[<>]' => ['description' => _('Regular expression V matching last value in period T, then N NOT 1, 0 - otherwise (non case-sensitive)'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'logeventid[=]' => ['description' => _('Event ID of last log entry matching regular expression T, then N = 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logeventid[<>]' => ['description' => _('Event ID of last log entry matching regular expression T, then N NOT 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logseverity[<]' => ['description' => _('Log severity of the last log entry is < N'), 'allowed_types' => $allowedTypesLog], 'logseverity[>]' => ['description' => _('Log severity of the last log entry is > N'), 'allowed_types' => $allowedTypesLog], 'logseverity[=]' => ['description' => _('Log severity of the last log entry is = N'), 'allowed_types' => $allowedTypesLog], 'logseverity[<>]' => ['description' => _('Log severity of the last log entry is NOT N'), 'allowed_types' => $allowedTypesLog], 'logsource[=]' => ['description' => _('Log source of the last log entry matching parameter T, then N = 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logsource[<>]' => ['description' => _('Log source of the last log entry matching parameter T, then N NOT 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'now[<]' => ['description' => _('Number of seconds since the Epoch is < N'), 'allowed_types' => $allowedTypesAny], 'now[>]' => ['description' => _('Number of seconds since the Epoch is > N'), 'allowed_types' => $allowedTypesAny], 'now[=]' => ['description' => _('Number of seconds since the Epoch is = N'), 'allowed_types' => $allowedTypesAny], 'now[<>]' => ['description' => _('Number of seconds since the Epoch is NOT N'), 'allowed_types' => $allowedTypesAny], 'time[<]' => ['description' => _('Current time is < N'), 'allowed_types' => $allowedTypesAny], 'time[>]' => ['description' => _('Current time is > N'), 'allowed_types' => $allowedTypesAny], 'time[=]' => ['description' => _('Current time is = N'), 'allowed_types' => $allowedTypesAny], 'time[<>]' => ['description' => _('Current time is NOT N'), 'allowed_types' => $allowedTypesAny], 'nodata[=]' => ['description' => _('No data received during period of time T, then N = 1, 0 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'nodata[<>]' => ['description' => _('No data received during period of time T, then N NOT 1, 0 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'band[=]' => ['description' => _('Bitwise AND of last (most recent) T value and mask is = N'), 'params' => $paramSecIntCount, 'allowed_types' => $allowedTypesInt], 'band[<>]' => ['description' => _('Bitwise AND of last (most recent) T value and mask is NOT N'), 'params' => $paramSecIntCount, 'allowed_types' => $allowedTypesInt], 'forecast[<]' => ['description' => _('Forecast for next t seconds based on period T is < N'), 'params' => $paramForecast, 'allowed_types' => $allowedTypesNumeric], 'forecast[>]' => ['description' => _('Forecast for next t seconds based on period T is > N'), 'params' => $paramForecast, 'allowed_types' => $allowedTypesNumeric], 'forecast[=]' => ['description' => _('Forecast for next t seconds based on period T is = N'), 'params' => $paramForecast, 'allowed_types' => $allowedTypesNumeric], 'forecast[<>]' => ['description' => _('Forecast for next t seconds based on period T is NOT N'), 'params' => $paramForecast, 'allowed_types' => $allowedTypesNumeric], 'timeleft[<]' => ['description' => _('Time to reach threshold estimated based on period T is < N'), 'params' => $paramTimeleft, 'allowed_types' => $allowedTypesNumeric], 'timeleft[>]' => ['description' => _('Time to reach threshold estimated based on period T is > N'), 'params' => $paramTimeleft, 'allowed_types' => $allowedTypesNumeric], 'timeleft[=]' => ['description' => _('Time to reach threshold estimated based on period T is = N'), 'params' => $paramTimeleft, 'allowed_types' => $allowedTypesNumeric], 'timeleft[<>]' => ['description' => _('Time to reach threshold estimated based on period T is NOT N'), 'params' => $paramTimeleft, 'allowed_types' => $allowedTypesNumeric]];
order_result($functions, 'description');
//	VAR		TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = ['dstfrm' => [T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, null], 'dstfld1' => [T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, null], 'expression' => [T_ZBX_STR, O_OPT, null, null, null], 'itemid' => [T_ZBX_INT, O_OPT, null, null, 'isset({insert})'], 'parent_discoveryid' => [T_ZBX_INT, O_OPT, null, null, null], 'expr_type' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({insert})'], 'params' => [T_ZBX_STR, O_OPT, null, 0, null], 'paramtype' => [T_ZBX_INT, O_OPT, null, IN(PARAM_TYPE_TIME . ',' . PARAM_TYPE_COUNTS), 'isset({insert})'], 'value' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({insert})'], 'insert' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null]];
check_fields($fields);
$dstfrm = getRequest('dstfrm', 0);
$dstfld1 = getRequest('dstfld1', '');
$itemId = getRequest('itemid', 0);
$value = getRequest('value', 0);
$params = getRequest('params', []);
$paramType = getRequest('paramtype');
$exprType = getRequest('expr_type', 'last[=]');
// opening the popup when editing an expression in the trigger constructor
if (isset($_REQUEST['expression']) && $_REQUEST['dstfld1'] == 'expr_temp') {
    $_REQUEST['expression'] = utf8RawUrlDecode($_REQUEST['expression']);
    $expressionData = new CTriggerExpression();
    $result = $expressionData->parse(getRequest('expression'));
    if ($result) {
        // only one item function macro is supported in an expression
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of authentication');
$page['file'] = 'authentication.php';
$page['hist_arg'] = array('config');
require_once dirname(__FILE__) . '/include/page_header.php';
//	VAR						TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('config' => array(T_ZBX_INT, O_OPT, null, IN(ZBX_AUTH_INTERNAL . ',' . ZBX_AUTH_LDAP . ',' . ZBX_AUTH_HTTP), null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null), 'update' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'test' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'ldap_host' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))', _('LDAP host')), 'ldap_port' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))', _('Port')), 'ldap_base_dn' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))', _('Base DN')), 'ldap_bind_dn' => array(T_ZBX_STR, O_OPT, null, null, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))'), 'ldap_bind_password' => array(T_ZBX_STR, O_OPT, null, null, null, _('Bind password')), 'ldap_search_attribute' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))', _('Search attribute')), 'user' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))'), 'user_password' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({config}) && {config} == ' . ZBX_AUTH_LDAP . ' && (isset({update}) || isset({test}))', _('User password')), 'change_bind_password' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
$config = select_config();
if (hasRequest('config')) {
    $isAuthenticationTypeChanged = $config['authentication_type'] != getRequest('config');
    $config['authentication_type'] = getRequest('config');
} else {
    $isAuthenticationTypeChanged = false;
}
foreach ($config as $name => $value) {
    if (array_key_exists($name, $_REQUEST)) {
        $config[$name] = $_REQUEST[$name];
    }
}
/*
 * Actions
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = ['problem_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged PROBLEM events')], 'problem_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged PROBLEM events')], 'ok_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged OK events')], 'ok_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged OK events')], 'problem_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'problem_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('Display OK triggers for')], 'blink_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('On status change triggers blink for')], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null]];
check_fields($fields);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $result = update_config(['problem_unack_color' => getRequest('problem_unack_color'), 'problem_ack_color' => getRequest('problem_ack_color'), 'ok_unack_color' => getRequest('ok_unack_color'), 'ok_ack_color' => getRequest('ok_ack_color'), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period'), 'blink_period' => getRequest('blink_period')]);
    $result = DBend($result);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
/*
 * Display
 */
$config = select_config();
// form has been submitted
Example #10
0
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/items.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Configuration of item prototypes');
$page['file'] = 'disc_prototypes.php';
$page['scripts'] = ['effects.js', 'class.cviewswitcher.js', 'items.js'];
require_once dirname(__FILE__) . '/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(getRequest('type', 0));
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['parent_discoveryid' => [T_ZBX_INT, O_MAND, P_SYS, DB_ID, null], 'itemid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({form}) && ({form} == "update"))'], 'interfaceid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')], 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')], 'description' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'key' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Key')], 'delay' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, SEC_PER_DAY), '(isset({add}) || isset({update}))' . ' && (isset({type}) && ({type} != ' . ITEM_TYPE_TRAPPER . ' && {type} != ' . ITEM_TYPE_SNMPTRAP . '))', _('Update interval (in sec)')], 'delay_flex' => [T_ZBX_STR, O_OPT, null, null, null], 'status' => [T_ZBX_INT, O_OPT, null, IN(ITEM_STATUS_ACTIVE), null], 'type' => [T_ZBX_INT, O_OPT, null, IN([-1, ITEM_TYPE_ZABBIX, ITEM_TYPE_SNMPV1, ITEM_TYPE_TRAPPER, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV2C, ITEM_TYPE_INTERNAL, ITEM_TYPE_SNMPV3, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_AGGREGATE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI, ITEM_TYPE_SSH, ITEM_TYPE_TELNET, ITEM_TYPE_JMX, ITEM_TYPE_CALCULATED, ITEM_TYPE_SNMPTRAP]), 'isset({add}) || isset({update})'], 'value_type' => [T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4'), 'isset({add}) || isset({update})'], 'data_type' => [T_ZBX_INT, O_OPT, null, IN(ITEM_DATA_TYPE_DECIMAL . ',' . ITEM_DATA_TYPE_OCTAL . ',' . ITEM_DATA_TYPE_HEXADECIMAL . ',' . ITEM_DATA_TYPE_BOOLEAN), '(isset({add}) || isset({update})) && (isset({value_type}) && ({value_type} == ' . ITEM_VALUE_TYPE_UINT64 . '))'], 'valuemapid' => [T_ZBX_INT, O_OPT, null, DB_ID, '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN(ITEM_VALUE_TYPE_FLOAT . ',' . ITEM_VALUE_TYPE_UINT64, 'value_type')], 'authtype' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHTYPE_PASSWORD . ',' . ITEM_AUTHTYPE_PUBLICKEY), '(isset({add}) || isset({update})) && isset({type}) && ({type} == ' . ITEM_TYPE_SSH . ')'], 'username' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type'), _('User name')], 'password' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type')], 'publickey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type})' . ' && ({type}) == ' . ITEM_TYPE_SSH . ' && ({authtype}) == ' . ITEM_AUTHTYPE_PUBLICKEY], 'privatekey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type})' . ' && ({type}) == ' . ITEM_TYPE_SSH . ' && ({authtype}) == ' . ITEM_AUTHTYPE_PUBLICKEY], $paramsFieldName => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_DB_MONITOR . ',' . ITEM_TYPE_TELNET . ',' . ITEM_TYPE_CALCULATED, 'type'), getParamFieldLabelByType(getRequest('type', 0))], 'snmp_community' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C, 'type'), _('SNMP community')], 'snmp_oid' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('SNMP OID')], 'port' => [T_ZBX_STR, O_OPT, null, BETWEEN(0, 65535), '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('Port')], 'snmpv3_securitylevel' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_contextname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_securityname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_authprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHPROTOCOL_MD5 . ',' . ITEM_AUTHPROTOCOL_SHA), '(isset({add}) || isset({update})) && (isset({type})' . ' && ({type} == ' . ITEM_TYPE_SNMPV3 . ') && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'], 'snmpv3_authpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type})' . ' && ({type} == ' . ITEM_TYPE_SNMPV3 . ') && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'], 'snmpv3_privprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_PRIVPROTOCOL_DES . ',' . ITEM_PRIVPROTOCOL_AES), '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . ')' . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'], 'snmpv3_privpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . ')' . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'], 'ipmi_sensor' => [T_ZBX_STR, O_OPT, P_NO_TRIM, NOT_EMPTY, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_IPMI . '))', _('IPMI sensor')], 'trapper_hosts' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && ({type} == 2)'], 'units' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN('0,3', 'value_type') . ' (isset({data_type}) && ({data_type} != ' . ITEM_DATA_TYPE_BOOLEAN . '))'], 'multiplier' => [T_ZBX_INT, O_OPT, null, null, null], 'delta' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN('0,3', 'value_type') . ' (isset({data_type}) && ({data_type} != ' . ITEM_DATA_TYPE_BOOLEAN . '))'], 'formula' => [T_ZBX_DBL_STR, O_OPT, null, '({value_type} == 0 && {} != 0) || ({value_type} == 3 && {} > 0)', '(isset({add}) || isset({update})) && isset({multiplier}) && {multiplier} == 1', _('Custom multiplier')], 'logtimefmt' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({value_type}) && ({value_type} == 2))'], 'group_itemid' => [T_ZBX_INT, O_OPT, null, DB_ID, null], 'new_application' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'applications' => [T_ZBX_INT, O_OPT, null, DB_ID, null], 'new_application_prototype' => [T_ZBX_STR, O_OPT, null, null, 'isset({parent_discoveryid}) && (isset({add}) || isset({update}))'], 'application_prototypes' => [T_ZBX_STR, O_OPT, null, null, null], 'history' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('History storage period')], 'trends' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN(ITEM_VALUE_TYPE_FLOAT . ',' . ITEM_VALUE_TYPE_UINT64, 'value_type'), _('Trend storage period')], 'action' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"itemprototype.massdelete","itemprototype.massdisable","itemprototype.massenable"'), null], 'add' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'clone' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'delete' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null], 'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'sort' => [T_ZBX_STR, O_OPT, P_SYS, IN('"delay","history","key_","name","status","trends","type"'), null], 'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"' . ZBX_SORT_DOWN . '","' . ZBX_SORT_UP . '"'), null]];
check_fields($fields);
$_REQUEST['params'] = getRequest($paramsFieldName, '');
unset($_REQUEST[$paramsFieldName]);
// permissions
$discoveryRule = API::DiscoveryRule()->get(['output' => ['hostid'], 'itemids' => getRequest('parent_discoveryid'), 'editable' => true]);
$discoveryRule = reset($discoveryRule);
if (!$discoveryRule) {
    access_deny();
}
$itemPrototypeId = getRequest('itemid');
if ($itemPrototypeId && !API::ItemPrototype()->isWritable([$itemPrototypeId])) {
    access_deny();
}
/*
 * Actions
Example #11
0
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
require_once dirname(__FILE__) . '/include/regexp.inc.php';
$page['title'] = _('Configuration of regular expressions');
$page['file'] = 'adm.regexps.php';
$page['type'] = detect_page_type();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['regexpids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'regexpid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'], 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')], 'test_string' => [T_ZBX_STR, O_OPT, P_NO_TRIM, null, 'isset({add}) || isset({update})', _('Test string')], 'expressions' => [T_ZBX_STR, O_OPT, P_NO_TRIM, null, 'isset({add}) || isset({update})'], 'action' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"regexp.massdelete"'), null], 'add' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null], 'output' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'ajaxaction' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'ajaxdata' => [T_ZBX_STR, O_OPT, P_ACT | P_NO_TRIM, null, null]];
check_fields($fields);
/*
 * Ajax
 */
if (isset($_REQUEST['output']) && $_REQUEST['output'] == 'ajax') {
    $ajaxResponse = new CAjaxResponse();
    $ajaxData = getRequest('ajaxdata', []);
    if (isset($_REQUEST['ajaxaction']) && $_REQUEST['ajaxaction'] == 'test') {
        $result = ['expressions' => [], 'errors' => [], 'final' => true];
        $validator = new CRegexValidator(['messageInvalid' => _('Regular expression must be a string'), 'messageRegex' => _('Incorrect regular expression "%1$s": "%2$s"')]);
        foreach ($ajaxData['expressions'] as $id => $expression) {
            if (!in_array($expression['expression_type'], [EXPRESSION_TYPE_FALSE, EXPRESSION_TYPE_TRUE]) || $validator->validate($expression['expression'])) {
                $match = CGlobalRegexp::matchExpression($expression, $ajaxData['testString']);
                $result['expressions'][$id] = $match;
            } else {
Example #12
0
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/triggers.inc.php';
require_once 'include/services.inc.php';
$page["title"] = "S_IT_SERVICES";
$page["file"] = "srv_status.php";
$page['scripts'] = array('services.js');
$page['hist_arg'] = array();
define('ZBX_PAGE_DO_REFRESH', 1);
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('serviceid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, NULL), 'showgraph' => array(T_ZBX_INT, O_OPT, P_SYS, IN('1'), 'isset({serviceid})'), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"hat"'), NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'));
check_fields($fields);
/* AJAX */
if (isset($_REQUEST['favobj'])) {
    if ('hat' == $_REQUEST['favobj']) {
        update_profile('web.srv_status.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT);
    }
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
    exit;
}
//--------
if (isset($_REQUEST['serviceid']) && $_REQUEST['serviceid'] > 0 && !DBfetch(DBselect('select serviceid from services where serviceid=' . $_REQUEST['serviceid']))) {
    unset($_REQUEST['serviceid']);
}
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Host inventory overview');
$page['file'] = 'hostinventoriesoverview.php';
$page['hist_arg'] = array('groupid', 'hostid');
require_once dirname(__FILE__) . '/include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupby' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, NULL), 'sort' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"host_count","inventory_field"'), null), 'sortorder' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"' . ZBX_SORT_DOWN . '","' . ZBX_SORT_UP . '"'), null));
check_fields($fields);
$sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'host_count'));
$sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_DOWN));
CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
/*
 * Permissions
 */
if (getRequest('groupid') && !API::HostGroup()->isReadable(array($_REQUEST['groupid']))) {
    access_deny();
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
Example #14
0
function get_item_function_info($expr)
{
    $value_type = array(ITEM_VALUE_TYPE_UINT64 => _('Numeric (integer 64bit)'), ITEM_VALUE_TYPE_FLOAT => _('Numeric (float)'), ITEM_VALUE_TYPE_STR => _('Character'), ITEM_VALUE_TYPE_LOG => _('Log'), ITEM_VALUE_TYPE_TEXT => _('Text'));
    $type_of_value_type = array(ITEM_VALUE_TYPE_UINT64 => T_ZBX_INT, ITEM_VALUE_TYPE_FLOAT => T_ZBX_DBL, ITEM_VALUE_TYPE_STR => T_ZBX_STR, ITEM_VALUE_TYPE_LOG => T_ZBX_STR, ITEM_VALUE_TYPE_TEXT => T_ZBX_STR);
    $function_info = array('band' => array('value_type' => _('Numeric (integer 64bit)'), 'type' => T_ZBX_INT, 'validation' => NOT_EMPTY), 'abschange' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'avg' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'change' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'count' => array('value_type' => _('Numeric (integer 64bit)'), 'type' => T_ZBX_INT, 'validation' => NOT_EMPTY), 'date' => array('value_type' => 'YYYYMMDD', 'type' => T_ZBX_INT, 'validation' => '{}>=19700101&&{}<=99991231'), 'dayofmonth' => array('value_type' => '1-31', 'type' => T_ZBX_INT, 'validation' => '{}>=1&&{}<=31'), 'dayofweek' => array('value_type' => '1-7', 'type' => T_ZBX_INT, 'validation' => IN('1,2,3,4,5,6,7')), 'delta' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'diff' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'fuzzytime' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'iregexp' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'last' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'logeventid' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'logseverity' => array('value_type' => _('Numeric (integer 64bit)'), 'type' => T_ZBX_INT, 'validation' => NOT_EMPTY), 'logsource' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'max' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'min' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'nodata' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'now' => array('value_type' => _('Numeric (integer 64bit)'), 'type' => T_ZBX_INT, 'validation' => NOT_EMPTY), 'prev' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'regexp' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'str' => array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1')), 'strlen' => array('value_type' => _('Numeric (integer 64bit)'), 'type' => T_ZBX_INT, 'validation' => NOT_EMPTY), 'sum' => array('value_type' => $value_type, 'type' => $type_of_value_type, 'validation' => NOT_EMPTY), 'time' => array('value_type' => 'HHMMSS', 'type' => T_ZBX_INT, 'validation' => 'zbx_strlen({})==6'));
    $expressionData = new CTriggerExpression();
    if ($expressionData->parse($expr)) {
        if (isset($expressionData->macros[0])) {
            $result = array('value_type' => _('0 or 1'), 'type' => T_ZBX_INT, 'validation' => IN('0,1'));
        } elseif (isset($expressionData->usermacros[0]) || isset($expressionData->lldmacros[0])) {
            $result = array('value_type' => $value_type[ITEM_VALUE_TYPE_FLOAT], 'type' => T_ZBX_STR, 'validation' => 'preg_match("/^' . ZBX_PREG_NUMBER . '$/u", {})');
        } elseif (isset($expressionData->expressions[0])) {
            $exprPart = reset($expressionData->expressions);
            if (!isset($function_info[$exprPart['functionName']])) {
                return EXPRESSION_FUNCTION_UNKNOWN;
            }
            $hostFound = API::Host()->get(array('filter' => array('host' => array($exprPart['host'])), 'templated_hosts' => true));
            if (!$hostFound) {
                return EXPRESSION_HOST_UNKNOWN;
            }
            $itemFound = API::Item()->get(array('output' => array('value_type'), 'hostids' => zbx_objectValues($hostFound, 'hostid'), 'filter' => array('key_' => array($exprPart['item'])), 'webitems' => true));
            if (!$itemFound) {
                $itemFound = API::ItemPrototype()->get(array('output' => array('value_type'), 'hostids' => zbx_objectValues($hostFound, 'hostid'), 'filter' => array('key_' => array($exprPart['item']))));
                if (!$itemFound) {
                    return EXPRESSION_HOST_ITEM_UNKNOWN;
                }
            }
            $itemFound = reset($itemFound);
            $result = $function_info[$exprPart['functionName']];
            if (is_array($result['value_type'])) {
                $result['value_type'] = $result['value_type'][$itemFound['value_type']];
                $result['type'] = $result['type'][$itemFound['value_type']];
                if ($result['type'] == T_ZBX_INT || $result['type'] == T_ZBX_DBL) {
                    $result['type'] = T_ZBX_STR;
                    $result['validation'] = 'preg_match("/^' . ZBX_PREG_NUMBER . '$/u",{})';
                }
            }
        } else {
            return EXPRESSION_NOT_A_MACRO_ERROR;
        }
    }
    return $result;
}
Example #15
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/services.inc.php';
$page['title'] = _('IT services availability report');
$page['file'] = 'report3.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
//	VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('serviceid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'period' => array(T_ZBX_STR, O_OPT, null, IN('"daily","weekly","monthly","yearly"'), null), 'year' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
$period = getRequest('period', 'weekly');
$year = getRequest('year', date('Y'));
define('YEAR_LEFT_SHIFT', 5);
$service = API::Service()->get(array('output' => array('serviceid', 'name', 'showsla', 'goodsla'), 'serviceids' => $_REQUEST['serviceid']));
$service = reset($service);
if (!$service) {
    access_deny();
}
$form = new CForm();
$form->setMethod('get');
$form->addVar('serviceid', $_REQUEST['serviceid']);
$cmbPeriod = new CComboBox('period', $period, 'submit();');
$cmbPeriod->addItem('daily', _('Daily'));
$cmbPeriod->addItem('weekly', _('Weekly'));
Example #16
0
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Scripts');
$page['file'] = 'scripts_exec.php';
define('ZBX_PAGE_NO_MENU', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'scriptid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'execute' => array(T_ZBX_INT, O_OPT, P_ACT, IN('0,1'), null));
check_fields($fields);
if (isset($_REQUEST['execute'])) {
    $scriptid = get_request('scriptid');
    $hostid = get_request('hostid');
    $data = array('message' => '', 'info' => DBfetch(DBselect('SELECT s.name FROM scripts s WHERE s.scriptid=' . zbx_dbstr($scriptid))));
    $result = API::Script()->execute(array('hostid' => $hostid, 'scriptid' => $scriptid));
    $isErrorExist = false;
    if (empty($result)) {
        $isErrorExist = true;
    } elseif ($result['response'] == 'failed') {
        error($result['value']);
        $isErrorExist = true;
    } else {
        $data['message'] = $result['value'];
    }
Example #17
0
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/items.inc.php";
$page["title"] = "S_QUEUE_BIG";
$page["file"] = "queue.php";
$page['hist_arg'] = array('show');
define('ZBX_PAGE_DO_REFRESH', 1);
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("show" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1,2"), NULL));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
?>

<?php 
$_REQUEST["show"] = get_request("show", 0);
$form = new CForm();
$form->SetMethod('get');
$cmbMode = new CComboBox("show", $_REQUEST["show"], "submit();");
$cmbMode->AddItem(0, S_OVERVIEW);
$cmbMode->AddItem(1, S_OVERVIEW_BY_PROXY);
$cmbMode->AddItem(2, S_DETAILS);
$form->AddItem($cmbMode);
show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG, $form);
?>
Example #18
0
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
require_once dirname(__FILE__) . '/include/screens.inc.php';
require_once dirname(__FILE__) . '/include/blocks.inc.php';
$page['title'] = _('Custom screens');
$page['file'] = 'screens.php';
$page['hist_arg'] = array('elementid', 'screenname');
$page['scripts'] = array('class.calendar.js', 'gtlc.js', 'flickerfreescreen.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'elementid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'screenname' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'step' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'reset' => array(T_ZBX_STR, O_OPT, P_SYS, IN("'reset'"), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN("'add','remove','flop'"), null), 'favstate' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, null));
check_fields($fields);
/*
 * Permissions
 */
// validate group IDs
$validateGroupIds = array_filter(array(get_request('groupid'), get_request('tr_groupid')));
if ($validateGroupIds && !API::HostGroup()->isReadable($validateGroupIds)) {
    access_deny();
}
// validate host IDs
$validateHostIds = array_filter(array(get_request('hostid'), get_request('tr_hostid')));
if ($validateHostIds && !API::Host()->isReadable($validateHostIds)) {
    access_deny();
}
if (get_request('elementid')) {
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/audit.inc.php';
require_once dirname(__FILE__) . '/include/actions.inc.php';
require_once dirname(__FILE__) . '/include/users.inc.php';
$page['title'] = _('Audit logs');
$page['file'] = 'auditlogs.php';
$page['hist_arg'] = array();
$page['scripts'] = array('class.calendar.js', 'gtlc.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'action' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(-1, 6), null), 'resourcetype' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(-1, 31), null), 'filter_rst' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filter_set' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'alias' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'period' => array(T_ZBX_INT, O_OPT, null, null, null), 'dec' => array(T_ZBX_INT, O_OPT, null, null, null), 'inc' => array(T_ZBX_INT, O_OPT, null, null, null), 'left' => array(T_ZBX_INT, O_OPT, null, null, null), 'right' => array(T_ZBX_INT, O_OPT, null, null, null), 'stime' => array(T_ZBX_STR, O_OPT, null, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})&&("filter"=={favobj})'), 'favstate' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})&&("filter"=={favobj})'), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null));
check_fields($fields);
/*
 * Ajax
 */
if (isset($_REQUEST['favobj'])) {
    if ($_REQUEST['favobj'] == 'filter') {
        CProfile::update('web.auditlogs.filter.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
    }
    // saving fixed/dynamic setting to profile
    if ($_REQUEST['favobj'] == 'timelinefixedperiod') {
        if (isset($_REQUEST['favid'])) {
            CProfile::update('web.auditlogs.timelinefixed', $_REQUEST['favid'], PROFILE_TYPE_INT);
        }
    }
}
Example #20
0
require_once 'include/acknow.inc.php';
require_once 'include/triggers.inc.php';
require_once 'include/events.inc.php';
require_once 'include/scripts.inc.php';
$page['file'] = 'tr_status.php';
$page['title'] = 'S_STATUS_OF_TRIGGERS';
$page['scripts'] = array('effects.js');
$page['hist_arg'] = array('groupid', 'hostid');
$page['scripts'] = array('class.cswitcher.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
if ($page['type'] == PAGE_TYPE_HTML) {
    define('ZBX_PAGE_DO_REFRESH', 1);
}
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'btnSelect' => array(T_ZBX_STR, O_OPT, null, null, null), 'filter_rst' => array(T_ZBX_STR, O_OPT, P_ACT, null, NULL), 'filter_set' => array(T_ZBX_STR, O_OPT, P_ACT, null, NULL), 'show_triggers' => array(T_ZBX_INT, O_OPT, null, null, null), 'show_events' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'ack_status' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'show_severity' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'show_details' => array(T_ZBX_INT, O_OPT, null, null, null), 'status_change_days' => array(T_ZBX_INT, O_OPT, null, null, null), 'status_change' => array(T_ZBX_INT, O_OPT, null, null, null), 'txt_select' => array(T_ZBX_STR, O_OPT, null, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'));
check_fields($fields);
if (isset($_REQUEST['favobj'])) {
    if ('filter' == $_REQUEST['favobj']) {
        CProfile::update('web.tr_status.filter.state', $_REQUEST['state'], PROFILE_TYPE_INT);
    }
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
    include_once 'include/page_footer.php';
    exit;
}
//--------
$config = select_config();
$options = array('groups' => array('monitored_hosts' => 1, 'with_monitored_triggers' => 1), 'hosts' => array('monitored_hosts' => 1, 'with_monitored_triggers' => 1), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
Example #21
0
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/items.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Configuration of discovery rules');
$page['file'] = 'host_discovery.php';
$page['scripts'] = array('class.cviewswitcher.js');
$page['hist_arg'] = array('hostid');
require_once dirname(__FILE__) . '/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(get_request('type', 0));
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '!isset({form})'), 'itemid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), 'interfaceid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')), 'name' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})', _('Name')), 'description' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'filter_macro' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'filter_value' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'key' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})', _('Key')), 'delay' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, SEC_PER_DAY), 'isset({save})&&(isset({type})&&({type}!=' . ITEM_TYPE_TRAPPER . '&&{type}!=' . ITEM_TYPE_SNMPTRAP . '))', _('Update interval (in sec)')), 'delay_flex' => array(T_ZBX_STR, O_OPT, null, '', null), 'add_delay_flex' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'new_delay_flex' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add_delay_flex})&&(isset({type})&&({type}!=2))', _('New flexible interval')), 'status' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_STATUS_ACTIVE), null), 'type' => array(T_ZBX_INT, O_OPT, null, IN(array(-1, ITEM_TYPE_ZABBIX, ITEM_TYPE_SNMPV1, ITEM_TYPE_TRAPPER, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV2C, ITEM_TYPE_INTERNAL, ITEM_TYPE_SNMPV3, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI, ITEM_TYPE_SSH, ITEM_TYPE_TELNET, ITEM_TYPE_JMX)), 'isset({save})'), 'authtype' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHTYPE_PASSWORD . ',' . ITEM_AUTHTYPE_PUBLICKEY), 'isset({save})&&isset({type})&&({type}==' . ITEM_TYPE_SSH . ')'), 'username' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type'), _('User name')), 'password' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type')), 'publickey' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type})==' . ITEM_TYPE_SSH . '&&({authtype})==' . ITEM_AUTHTYPE_PUBLICKEY), 'privatekey' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type})==' . ITEM_TYPE_SSH . '&&({authtype})==' . ITEM_AUTHTYPE_PUBLICKEY), $paramsFieldName => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_DB_MONITOR . ',' . ITEM_TYPE_TELNET . ',' . ITEM_TYPE_CALCULATED, 'type'), getParamFieldLabelByType(get_request('type', 0))), 'snmp_community' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C, 'type'), _('SNMP community')), 'snmp_oid' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('SNMP OID')), 'port' => array(T_ZBX_STR, O_OPT, null, BETWEEN(0, 65535), 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('Port')), 'snmpv3_contextname' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_securitylevel' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_securityname' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_authprotocol' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHPROTOCOL_MD5 . ',' . ITEM_AUTHPROTOCOL_SHA), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '||{snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'), 'snmpv3_authpassphrase' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '||{snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'), 'snmpv3_privprotocol' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_PRIVPROTOCOL_DES . ',' . ITEM_PRIVPROTOCOL_AES), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'), 'snmpv3_privpassphrase' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'), 'ipmi_sensor' => array(T_ZBX_STR, O_OPT, NO_TRIM, NOT_EMPTY, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_IPMI . '))', _('IPMI sensor')), 'trapper_hosts' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type}==2)'), 'lifetime' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'go' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'g_hostdruleid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'update' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'favstate' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})&&("filter"=={favobj})'));
check_fields($fields);
validate_sort_and_sortorder('name', ZBX_SORT_UP);
$_REQUEST['go'] = get_request('go', 'none');
$_REQUEST['params'] = get_request($paramsFieldName, '');
unset($_REQUEST[$paramsFieldName]);
/*
 * Permissions
 */
if (get_request('itemid', false)) {
    $item = API::DiscoveryRule()->get(array('itemids' => $_REQUEST['itemid'], 'output' => API_OUTPUT_EXTEND, 'selectHosts' => array('status', 'flags'), 'editable' => true));
    $item = reset($item);
    if (!$item) {
        access_deny();
    }
    $_REQUEST['hostid'] = $item['hostid'];
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = array('problem_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'problem_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'blink_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
if (isset($_REQUEST['save'])) {
    $configs = array('ok_period' => get_request('ok_period'), 'blink_period' => get_request('blink_period'), 'problem_unack_color' => get_request('problem_unack_color'), 'problem_ack_color' => get_request('problem_ack_color'), 'ok_unack_color' => get_request('ok_unack_color'), 'ok_ack_color' => get_request('ok_ack_color'), 'problem_unack_style' => get_request('problem_unack_style', 0), 'problem_ack_style' => get_request('problem_ack_style', 0), 'ok_unack_style' => get_request('ok_unack_style', 0), 'ok_ack_style' => get_request('ok_ack_style', 0));
    $result = update_config($configs);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
$form = new CForm();
$form->cleanItems();
$cmbConf = new CComboBox('configDropDown', 'adm.triggerdisplayoptions.php', 'redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other')));
$form->addItem($cmbConf);
$cnf_wdgt = new CWidget();
$cnf_wdgt->addPageHeader(_('CONFIGURATION OF ZABBIX'), $form);
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
Example #23
0
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
require_once dirname(__FILE__) . '/include/screens.inc.php';
require_once dirname(__FILE__) . '/include/blocks.inc.php';
$page['title'] = _('Host screens');
$page['file'] = 'screens.php';
$page['hist_arg'] = array('elementid');
$page['scripts'] = array('effects.js', 'dragdrop.js', 'class.calendar.js', 'gtlc.js', 'flickerfreescreen.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'screenid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'step' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'reset' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null));
check_fields($fields);
/*
 * Ajax
 */
if (hasRequest('filterState')) {
    CProfile::update('web.hostscreen.filter.state', getRequest('filterState'), PROFILE_TYPE_INT);
}
if (getRequest('favobj') === 'timeline' && hasRequest('elementid') && hasRequest('period')) {
    navigation_bar_calc('web.hostscreen', getRequest('elementid'), true);
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
/*
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['file'] = 'chart.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('itemid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'screenid' => array(T_ZBX_STR, O_OPT, null, null, null), 'period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'profileIdx' => array(T_ZBX_STR, O_OPT, null, null, null), 'profileIdx2' => array(T_ZBX_STR, O_OPT, null, null, null), 'updateProfile' => array(T_ZBX_STR, O_OPT, null, null, null), 'from' => array(T_ZBX_INT, O_OPT, null, '{}>=0', null), 'width' => array(T_ZBX_INT, O_OPT, null, '{}>0', null), 'height' => array(T_ZBX_INT, O_OPT, null, '{}>0', null), 'border' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null));
check_fields($fields);
/*
 * Permissions
 */
if (!DBfetch(DBselect('SELECT i.itemid FROM items i WHERE i.itemid=' . $_REQUEST['itemid']))) {
    show_error_message(_('No items defined.'));
}
$dbItems = API::Item()->get(array('itemids' => $_REQUEST['itemid'], 'webitems' => true, 'nodeids' => get_current_nodeid(true), 'filter' => array('flags' => null)));
if (empty($dbItems)) {
    access_deny();
}
/*
 * Display
 */
$timeline = CScreenBase::calculateTime(array('profileIdx' => get_request('profileIdx', 'web.screens'), 'profileIdx2' => get_request('profileIdx2'), 'updateProfile' => get_request('updateProfile', true), 'period' => get_request('period'), 'stime' => get_request('stime')));
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
$page['file'] = 'chart3.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'httptestid' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'http_item_type' => array(T_ZBX_INT, O_OPT, null, null, null), 'name' => array(T_ZBX_STR, O_OPT, null, null, null), 'width' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'ymin_type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), null), 'ymax_type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), null), 'ymin_itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'ymax_itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'legend' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'showworkperiod' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'showtriggers' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'graphtype' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'yaxismin' => array(T_ZBX_DBL, O_OPT, null, null, null), 'yaxismax' => array(T_ZBX_DBL, O_OPT, null, null, null), 'percent_left' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 100), null), 'percent_right' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 100), null), 'items' => array(T_ZBX_STR, O_OPT, null, null, null));
$isDataValid = check_fields($fields);
if ($httptestid = get_request('httptestid', false)) {
    $color = array('current' => 0, 0 => array('next' => '1'), 1 => array('color' => 'Red', 'next' => '2'), 2 => array('color' => 'Dark Green', 'next' => '3'), 3 => array('color' => 'Blue', 'next' => '4'), 4 => array('color' => 'Dark Yellow', 'next' => '5'), 5 => array('color' => 'Cyan', 'next' => '6'), 6 => array('color' => 'Gray', 'next' => '7'), 7 => array('color' => 'Dark Red', 'next' => '8'), 8 => array('color' => 'Green', 'next' => '9'), 9 => array('color' => 'Dark Blue', 'next' => '10'), 10 => array('color' => 'Yellow', 'next' => '11'), 11 => array('color' => 'Black', 'next' => '1'));
    $items = array();
    $dbItems = DBselect('SELECT i.itemid' . ' FROM httpstepitem hi,items i,httpstep hs' . ' WHERE i.itemid=hi.itemid' . ' AND hs.httptestid=' . $httptestid . ' AND hs.httpstepid=hi.httpstepid' . ' AND hi.type=' . get_request('http_item_type', HTTPSTEP_ITEM_TYPE_TIME) . ' ORDER BY hs.no DESC');
    while ($item = DBfetch($dbItems)) {
        $itemColor = $color[$color['current'] = $color[$color['current']]['next']]['color'];
        $items[] = array('itemid' => $item['itemid'], 'color' => $itemColor);
    }
    $httptest = get_httptest_by_httptestid($httptestid);
    $name = $httptest['name'];
} else {
    $items = get_request('items', array());
    asort_by_key($items, 'sortorder');
    $dbItems = API::Item()->get(array('webitems' => true, 'itemids' => zbx_objectValues($items, 'itemid'), 'nodeids' => get_current_nodeid(true), 'output' => API_OUTPUT_SHORTEN, 'preservekeys' => true, 'filter' => array('flags' => null)));
Example #26
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/triggers.inc.php';
$page['title'] = _('Most busy triggers top 100');
$page['file'] = 'report5.php';
$page['hist_arg'] = array('period');
require_once dirname(__FILE__) . '/include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_STR, O_OPT, P_SYS | P_NZERO, IN('"day","week","month","year"'), NULL));
check_fields($fields);
$rprt_wdgt = new CWidget();
$_REQUEST['period'] = getRequest('period', 'day');
$admin_links = CWebUser::$data['type'] == USER_TYPE_ZABBIX_ADMIN || CWebUser::$data['type'] == USER_TYPE_SUPER_ADMIN;
$form = new CForm('get');
$cmbPeriod = new CComboBox('period', $_REQUEST['period'], 'submit()');
$cmbPeriod->addItem('day', _('Day'));
$cmbPeriod->addItem('week', _('Week'));
$cmbPeriod->addItem('month', _('Month'));
$cmbPeriod->addItem('year', _('Year'));
$form->addItem($cmbPeriod);
$rprt_wdgt->addPageHeader(_('MOST BUSY TRIGGERS TOP 100'));
$rprt_wdgt->addHeader(_('Report'), $form);
$rprt_wdgt->addItem(BR());
$table = new CTableInfo(_('No triggers found.'));
Example #27
0
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/triggers.inc.php';
require_once 'include/js.inc.php';
$dstfrm = get_request('dstfrm', 0);
// destination form
$page['title'] = "S_GRAPH_ITEM";
$page['file'] = 'popup_gitem.php';
$page['scripts'] = array();
define('ZBX_PAGE_NO_MENU', 1);
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('dstfrm' => array(T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, null), 'graphid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'gid' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3'), 'isset({save})'), 'list_name' => array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY, 'isset({save})&&isset({gid})'), 'itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID . '({}!=0)', 'isset({save})'), 'color' => array(T_ZBX_CLR, O_OPT, null, null, 'isset({save})'), 'drawtype' => array(T_ZBX_INT, O_OPT, null, IN(graph_item_drawtypes()), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'sortorder' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'yaxisside' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'calc_fnc' => array(T_ZBX_INT, O_OPT, null, IN('1,2,4,7,9'), 'isset({save})'), 'type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({save})'), 'periods_cnt' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 360), 'isset({save})'), 'only_hostid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'monitored_hosts' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'add' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
insert_js_function('add_graph_item');
insert_js_function('update_graph_item');
$_REQUEST['drawtype'] = get_request('drawtype', 0);
$_REQUEST['yaxisside'] = get_request('yaxisside', 0);
$_REQUEST['sortorder'] = get_request('sortorder', 0);
$graphid = get_request('graphid', false);
if (isset($_REQUEST['type']) && $_REQUEST['type'] == GRAPH_ITEM_SUM && $graphid !== false) {
    $sql = 'SELECT COUNT(itemid) as items' . ' FROM graphs_items ' . ' WHERE type=' . GRAPH_ITEM_SUM . ' AND graphid=' . $graphid . ' AND itemid<>' . $_REQUEST['itemid'];
    $res = DBselect($sql);
    while ($rows = DBfetch($res)) {
        if (isset($rows['items']) && $rows['items'] > 0) {
            show_messages(false, null, S_ANOTHER_ITEM_SUM);
            if (isset($_REQUEST['save'])) {
                unset($_REQUEST['save']);
Example #28
0
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/services.inc.php';
require_once 'include/triggers.inc.php';
require_once 'include/html.inc.php';
$page["title"] = "S_CONFIGURATION_OF_IT_SERVICES";
$page["file"] = "services.php";
$page['scripts'] = array('services.js');
$page['hist_arg'] = array();
include_once "include/page_header.php";
//---------------------------------- CHECKS ------------------------------------
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("msg" => array(T_ZBX_STR, O_OPT, null, null, NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, IN("'hat'"), NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'));
check_fields($fields);
/* AJAX */
if (isset($_REQUEST['favobj'])) {
    if ('hat' == $_REQUEST['favobj']) {
        update_profile('web.services.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT);
    }
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
    exit;
}
//--------
//--------------------------------------------------------------------------
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY);
$query = 'SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, ' . ' s.name as caption, s.algorithm, t.description, t.expression, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status ' . ' FROM services s ' . ' LEFT JOIN triggers t ON s.triggerid = t.triggerid ' . ' LEFT JOIN services_links sl ON  s.serviceid = sl.serviceupid and NOT(sl.soft=0) ' . ' LEFT JOIN services_links sl_p ON  s.serviceid = sl_p.servicedownid and sl_p.soft=0 ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (t.triggerid IS NULL OR ' . DBcondition('t.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder, sl_p.serviceupid, s.serviceid';
$result = DBSelect($query);
Example #29
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Status of Web monitoring');
$page['file'] = 'httpmon.php';
$page['hist_arg'] = array('groupid', 'hostid');
define('ZBX_PAGE_DO_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
//		VAR				TYPE		OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null));
check_fields($fields);
/*
 * Permissions
 */
if (get_request('groupid') && !API::HostGroup()->isReadable(array($_REQUEST['groupid']))) {
    access_deny();
}
if (get_request('hostid') && !API::Host()->isReadable(array($_REQUEST['hostid']))) {
    access_deny();
}
validate_sort_and_sortorder('name', ZBX_SORT_DOWN);
$options = array('groups' => array('real_hosts' => true, 'with_httptests' => true), 'hosts' => array('with_monitored_items' => true, 'with_httptests' => true), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
Example #30
0
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Host inventory');
$page['file'] = 'hostinventories.php';
require_once dirname(__FILE__) . '/include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = ['groupid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'filter_rst' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'filter_field' => [T_ZBX_STR, O_OPT, null, null, null], 'filter_field_value' => [T_ZBX_STR, O_OPT, null, null, null], 'filter_exact' => [T_ZBX_INT, O_OPT, null, 'IN(0,1)', null], 'sort' => [T_ZBX_STR, O_OPT, P_SYS, IN('"name","pr_macaddress_a","pr_name","pr_os","pr_serialno_a","pr_tag","pr_type"'), null], 'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"' . ZBX_SORT_DOWN . '","' . ZBX_SORT_UP . '"'), null]];
check_fields($fields);
/*
 * Permissions
 */
if (getRequest('groupid') && !API::HostGroup()->isReadable([getRequest('groupid')])) {
    access_deny();
}
if (getRequest('hostid') && !API::Host()->isReadable([getRequest('hostid')])) {
    access_deny();
}
$sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'name'));
$sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
$hostId = getRequest('hostid', 0);