/*
** Zabbix
** Copyright (C) 2001-2016 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (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.
**/
#include <stddef.h>
#include "common.h"
#include "log.h"
#include "threads.h"
#include "dbcache.h"
#include "ipc.h"
#include "mutexs.h"
#include "memalloc.h"
#include "strpool.h"
#include "zbxserver.h"
#include "zbxalgo.h"
#include "dbcache.h"
#include "zbxregexp.h"
#include "cfg.h"
#include "../zbxcrypto/tls_tcp_active.h"
static int sync_in_progress = 0;
#define LOCK_CACHE if (0 == sync_in_progress) zbx_mutex_lock(&config_lock)
#define UNLOCK_CACHE if (0 == sync_in_progress) zbx_mutex_unlock(&config_lock)
#define START_SYNC LOCK_CACHE; sync_in_progress = 1
#define FINISH_SYNC sync_in_progress = 0; UNLOCK_CACHE
#define ZBX_LOC_NOWHERE 0
#define ZBX_LOC_QUEUE 1
#define ZBX_LOC_POLLER 2
#define ZBX_SNMP_OID_TYPE_NORMAL 0
#define ZBX_SNMP_OID_TYPE_DYNAMIC 1
#define ZBX_SNMP_OID_TYPE_MACRO 2
/* trigger is functional unless its expression contains disabled or not monitored items */
#define TRIGGER_FUNCTIONAL_TRUE 0
#define TRIGGER_FUNCTIONAL_FALSE 1
/* shorthand macro for calling in_maintenance_without_data_collection() */
#define DCin_maintenance_without_data_collection(dc_host, dc_item) \
in_maintenance_without_data_collection(dc_host->maintenance_status, \
dc_host->maintenance_type, dc_item->type)
/* validator function optionally used to validate macro values when expanding user macros */
/******************************************************************************
* *
* Function: zbx_value_validator_func_t *
* *
* Purpose: validate macro value when expanding user macros *
* *
* Parameters: macro - [IN] the user macro *
* value - [IN] the macro value *
* error - [OUT] the error message *
* *
* Return value: SUCCEED - the value is valid *
* FAIL - otherwise *
* *
******************************************************************************/
typedef int (*zbx_value_validator_func_t)(const char *macro, const char *value, char **error);
typedef struct
{
zbx_uint64_t triggerid;
const char *description;
const char *expression;
const char *recovery_expression;
/* cached expressions with expanded user macros, can be NULL */
const char *expression_ex;
const char *recovery_expression_ex;
const char *error;
const char *correlation_tag;
int lastchange;
unsigned char topoindex;
unsigned char priority;
unsigned char type;
unsigned char value;
unsigned char state;
unsigned char locked;
unsigned char status;
unsigned char functional; /* see TRIGGER_FUNCTIONAL_* defines */
unsigned char recovery_mode; /* TRIGGER_RECOVERY_MODE_* defines */
unsigned char correlation_mode; /* ZBX_TRIGGER_CORRELATION_* defines */
zbx_vector_ptr_t tags;
}
ZBX_DC_TRIGGER;
typedef struct zbx_dc_trigger_deplist
{
zbx_uint64_t triggerid;
ZBX_DC_TRIGGER *trigger;
const struct zbx_dc_trigger_deplist **dependencies;
}
ZBX_DC_TRIGGER_DEPLIST;
typedef struct
{
zbx_uint64_t functionid;
zbx_uint64_t triggerid;
zbx_uint64_t itemid;
const char *function;
const char *parameter;
}
ZBX_DC_FUNCTION;
typedef struct
{
zbx_uint64_t itemid;
zbx_uint64_t hostid;
zbx_uint64_t interfaceid;
zbx_uint64_t lastlogsize;
zbx_uint64_t valuemapid;
const char *key;
const char *port;
const char *units;
const char *db_error;
ZBX_DC_TRIGGER **triggers;
int delay;
int nextcheck;
int lastclock;
int mtime;
int data_expected_from;
int history;
unsigned char type;
unsigned char data_type;
unsigned char value_type;
unsigned char poller_type;
unsigned char state;
unsigned char db_state;
unsigned char inventory_link;
unsigned char location;
unsigned char flags;
unsigned char status;
unsigned char unreachable;
}
ZBX_DC_ITEM;
typedef struct
{
zbx_uint64_t hostid;
const char *key;
ZBX_DC_ITEM *item_ptr;
}
ZBX_DC_ITEM_HK;
typedef struct
{
zbx_uint64_t itemid;
const char *formula;
const char *units;
int trends;
unsigned char delta;
unsigned char multiplier;
}
ZBX_DC_NUMITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *snmp_oid;
const char *snmp_community;
const char *snmpv3_securityname;
const char *snmpv3_authpassphrase;
const char *snmpv3_privpassphrase;
const char *snmpv3_contextname;
unsigned char snmpv3_securitylevel;
unsigned char snmpv3_authprotocol;
unsigned char snmpv3_privprotocol;
unsigned char snmp_oid_type;
}
ZBX_DC_SNMPITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *ipmi_sensor;
}
ZBX_DC_IPMIITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *delay_flex;
}
ZBX_DC_FLEXITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *trapper_hosts;
}
ZBX_DC_TRAPITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *logtimefmt;
}
ZBX_DC_LOGITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *params;
const char *username;
const char *password;
}
ZBX_DC_DBITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *username;
const char *publickey;
const char *privatekey;
const char *password;
const char *params;
unsigned char authtype;
}
ZBX_DC_SSHITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *username;
const char *password;
const char *params;
}
ZBX_DC_TELNETITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *username;
const char *password;
}
ZBX_DC_SIMPLEITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *username;
const char *password;
}
ZBX_DC_JMXITEM;
typedef struct
{
zbx_uint64_t itemid;
const char *params;
}
ZBX_DC_CALCITEM;
typedef zbx_item_history_value_t ZBX_DC_DELTAITEM;
#if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
typedef struct
{
const char *tls_psk_identity; /* pre-shared key identity */
const char *tls_psk; /* pre-shared key value (hex-string) */
unsigned int refcount; /* reference count */
}
ZBX_DC_PSK;
#endif
typedef struct
{
zbx_uint64_t hostid;
zbx_uint64_t proxy_hostid;
const char *host;
const char *name;
int maintenance_from;
int data_expected_from;
int errors_from;
int disable_until;
int snmp_errors_from;
int snmp_disable_until;
int ipmi_errors_from;
int ipmi_disable_until;
int jmx_errors_from;
int jmx_disable_until;
/* timestamp of last availability status (available/error) field change on any interface */
int availability_ts;
unsigned char maintenance_status;
unsigned char maintenance_type;
unsigned char available;
unsigned char snmp_available;
unsigned char ipmi_available;
unsigned char jmx_available;
unsigned char status;
/* specifies which interfaces are being used (have enabled items) */
/* (see ZBX_FLAG_INTERFACE_* defines) */
unsigned char used_interfaces
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
zabbix-3.2.1.tar.gz官方源码 (1719个子文件)
configure.ac 46KB
Makefile.am 3KB
Makefile.am 3KB
Makefile.am 3KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 976B
Makefile.am 769B
Makefile.am 632B
Makefile.am 547B
Makefile.am 478B
Makefile.am 445B
Makefile.am 437B
Makefile.am 424B
Makefile.am 424B
Makefile.am 417B
Makefile.am 413B
Makefile.am 407B
Makefile.am 400B
Makefile.am 397B
Makefile.am 392B
Makefile.am 373B
Makefile.am 329B
Makefile.am 326B
Makefile.am 312B
Makefile.am 295B
Makefile.am 283B
Makefile.am 272B
Makefile.am 265B
Makefile.am 247B
Makefile.am 240B
Makefile.am 229B
Makefile.am 214B
Makefile.am 208B
Makefile.am 208B
Makefile.am 179B
Makefile.am 178B
Makefile.am 161B
Makefile.am 160B
Makefile.am 160B
Makefile.am 160B
Makefile.am 159B
Makefile.am 157B
Makefile.am 157B
Makefile.am 157B
Makefile.am 156B
Makefile.am 156B
Makefile.am 153B
Makefile.am 152B
Makefile.am 149B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 143B
Makefile.am 141B
Makefile.am 141B
Makefile.am 141B
Makefile.am 140B
Makefile.am 137B
Makefile.am 137B
Makefile.am 134B
Makefile.am 133B
Makefile.am 133B
Makefile.am 133B
Makefile.am 125B
Makefile.am 125B
Makefile.am 121B
Makefile.am 119B
AUTHORS 98B
dbconfig.c 346KB
tls.c 202KB
host.c 186KB
vmware.c 179KB
expression.c 175KB
str.c 170KB
gnuregex.c 160KB
dbschema.c 149KB
valuecache.c 135KB
dbcache.c 128KB
misc.c 119KB
lld_item.c 118KB
lld_trigger.c 115KB
lld_host.c 104KB
logfiles.c 103KB
evalfunc.c 94KB
proxy.c 88KB
db.c 85KB
escalator.c 79KB
checks_simple_vmware.c 77KB
events.c 75KB
checks_snmp.c 75KB
db.c 67KB
comms.c 63KB
active.c 59KB
actions.c 55KB
dbupgrade_3010.c 51KB
procstat.c 49KB
共 1719 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
凉_白开
- 粉丝: 5656
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页