diff options
author | Andris Zeila <andris.zeila@zabbix.com> | 2014-08-14 10:39:10 +0400 |
---|---|---|
committer | Andris Zeila <andris.zeila@zabbix.com> | 2014-08-14 10:39:10 +0400 |
commit | d93f4497a0ecc179444fb7cd09b1b220d65da977 (patch) | |
tree | acff4f3586ba302148273f906d8d30f0a76d3487 /include | |
parent | 57063cbeeb8d6142cab7ab479ae5f3f1a81e6e47 (diff) | |
parent | 6e5aae1ea11ae1c4e28a29fc9ccbdd56ee3a1840 (diff) |
.......... [ZBX-8455] merged from upstream
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 11 | ||||
-rw-r--r-- | include/db.h | 3 | ||||
-rw-r--r-- | include/dbcache.h | 6 | ||||
-rw-r--r-- | include/gnuregex.h | 2 | ||||
-rw-r--r-- | include/module.h | 2 | ||||
-rw-r--r-- | include/sysinfo.h | 3 | ||||
-rw-r--r-- | include/version.h | 4 | ||||
-rw-r--r-- | include/zbxgetopt.h | 2 | ||||
-rw-r--r-- | include/zbxtypes.h | 6 |
9 files changed, 26 insertions, 13 deletions
diff --git a/include/common.h b/include/common.h index 22550e42064..959c7e36a50 100644 --- a/include/common.h +++ b/include/common.h @@ -93,7 +93,7 @@ const char *zbx_result_string(int result); #define MAX_ID_LEN 21 #define MAX_STRING_LEN 2048 #define MAX_BUFFER_LEN 65536 -#define MAX_ZBX_HOSTNAME_LEN 64 +#define MAX_ZBX_HOSTNAME_LEN 128 #define MAX_EXECUTE_OUTPUT_LEN (512 * ZBX_KIBIBYTE) #define ZBX_MAX_UINT64_LEN 21 @@ -152,6 +152,9 @@ const char *zbx_interface_type_string(zbx_interface_type_t type); #define INTERFACE_TYPE_COUNT 4 /* number of interface types */ extern const int INTERFACE_TYPE_PRIORITY[INTERFACE_TYPE_COUNT]; +#define SNMP_BULK_DISABLED 0 +#define SNMP_BULK_ENABLED 1 + #define ZBX_FLAG_DISCOVERY_NORMAL 0x00 #define ZBX_FLAG_DISCOVERY_RULE 0x01 #define ZBX_FLAG_DISCOVERY_PROTOTYPE 0x02 @@ -633,6 +636,8 @@ zbx_script_t; #define POLLER_DELAY 5 #define DISCOVERER_DELAY 60 +#define HOUSEKEEPER_STARTUP_DELAY 30 /* in minutes */ + #define GET_SENDER_TIMEOUT 60 #ifndef MAX @@ -876,7 +881,7 @@ void zbx_chrcpy_alloc(char **str, size_t *alloc_len, size_t *offset, char c); #define strscpy(x, y) zbx_strlcpy(x, y, sizeof(x)) #define strscat(x, y) zbx_strlcat(x, y, sizeof(x)) size_t zbx_strlcpy(char *dst, const char *src, size_t siz); -size_t zbx_strlcat(char *dst, const char *src, size_t siz); +void zbx_strlcat(char *dst, const char *src, size_t siz); char *zbx_dvsprintf(char *dest, const char *f, va_list args); @@ -997,7 +1002,7 @@ int MAIN_ZABBIX_ENTRY(); zbx_uint64_t zbx_letoh_uint64(zbx_uint64_t data); zbx_uint64_t zbx_htole_uint64(zbx_uint64_t data); -int zbx_check_hostname(const char *hostname); +int zbx_check_hostname(const char *hostname, char **error); int is_hostname_char(char c); int is_key_char(char c); diff --git a/include/db.h b/include/db.h index d18d88a88f2..4a0163f1fcd 100644 --- a/include/db.h +++ b/include/db.h @@ -78,7 +78,7 @@ struct _DC_TRIGGER; #define HOST_HOST_LEN MAX_ZBX_HOSTNAME_LEN #define HOST_HOST_LEN_MAX (HOST_HOST_LEN + 1) -#define HOST_NAME_LEN 64 +#define HOST_NAME_LEN 128 #define HOST_ERROR_LEN 128 #define HOST_ERROR_LEN_MAX (HOST_ERROR_LEN + 1) #define HOST_IPMI_USERNAME_LEN 16 @@ -508,7 +508,6 @@ int DBcopy_template_elements(zbx_uint64_t hostid, zbx_vector_uint64_t *lnk_templ int DBdelete_template_elements(zbx_uint64_t hostid, zbx_vector_uint64_t *del_templateids); void DBdelete_items(zbx_vector_uint64_t *itemids); -void DBdelete_triggers(zbx_vector_uint64_t *triggerids); void DBdelete_graphs(zbx_vector_uint64_t *graphids); void DBdelete_hosts(zbx_vector_uint64_t *hostids); diff --git a/include/dbcache.h b/include/dbcache.h index eefc97f446e..b5f841ebfb8 100644 --- a/include/dbcache.h +++ b/include/dbcache.h @@ -257,6 +257,9 @@ typedef struct } zbx_host_availability_t; +int is_item_processed_by_server(unsigned char type, const char *key); +int in_maintenance_without_data_collection(unsigned char maintenance_status, unsigned char maintenance_type, + unsigned char type); void dc_add_history(zbx_uint64_t itemid, unsigned char value_type, unsigned char flags, AGENT_RESULT *value, zbx_timespec_t *ts, unsigned char state, const char *error); void dc_flush_history(); @@ -311,8 +314,7 @@ void DCconfig_get_time_based_triggers(DC_TRIGGER **trigger_info, zbx_vector_ptr_ int process_num); void DCfree_triggers(zbx_vector_ptr_t *triggers); void DCconfig_update_interface_snmp_stats(zbx_uint64_t interfaceid, int max_snmp_succeed, int min_snmp_fail); -int DCconfig_get_interface_snmp_stats(zbx_uint64_t interfaceid, int *max_snmp_succeed, int *min_snmp_fail); -int DCconfig_get_suggested_snmp_vars(int max_snmp_succeed, int min_snmp_fail); +int DCconfig_get_suggested_snmp_vars(zbx_uint64_t interfaceid, int *bulk); int DCconfig_get_interface_by_type(DC_INTERFACE *interface, zbx_uint64_t hostid, unsigned char type); int DCconfig_get_poller_nextcheck(unsigned char poller_type); int DCconfig_get_poller_items(unsigned char poller_type, DC_ITEM *items); diff --git a/include/gnuregex.h b/include/gnuregex.h index 5b294847191..e427826ed87 100644 --- a/include/gnuregex.h +++ b/include/gnuregex.h @@ -428,7 +428,7 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); compiled into BUFFER. Start searching at position START, for RANGE characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register - information in REGS (if REGS and BUFFER->no_sub are nonzero). */ + information in REGS (if REGS and BUFFER->no_sub are non-zero). */ extern int re_search _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs)); diff --git a/include/module.h b/include/module.h index 654c35cd556..f70fe5c2f81 100644 --- a/include/module.h +++ b/include/module.h @@ -27,7 +27,7 @@ #define ZBX_MODULE_API_VERSION_ONE 1 -#define get_rparam(request, num) (request->nparam > num ? request->params[num] : NULL) +#define get_rparam(request, num) ((request)->nparam > num ? (request)->params[num] : NULL) /* flags for command */ #define CF_HAVEPARAMS 0x01 /* item accepts either optional or mandatory parameters */ diff --git a/include/sysinfo.h b/include/sysinfo.h index 5f900558c8e..4d48cda4d05 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -193,7 +193,7 @@ void free_result(AGENT_RESULT *result); void init_request(AGENT_REQUEST *request); void free_request(AGENT_REQUEST *request); -int parse_item_key(char *cmd, AGENT_REQUEST *request); +int parse_item_key(const char *itemkey, AGENT_REQUEST *request); zbx_log_t *add_log_result(AGENT_RESULT *result, const char *value); void set_log_result_empty(AGENT_RESULT *result); @@ -227,6 +227,7 @@ int SYSTEM_CPU_INTR(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_CPU_LOAD(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_CPU_UTIL(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_CPU_NUM(AGENT_REQUEST *request, AGENT_RESULT *result); +int SYSTEM_CPU_DISCOVERY(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_HOSTNAME(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_HW_CHASSIS(AGENT_REQUEST *request, AGENT_RESULT *result); int SYSTEM_HW_CPU(AGENT_REQUEST *request, AGENT_RESULT *result); diff --git a/include/version.h b/include/version.h index 3d5522f5163..599f3238313 100644 --- a/include/version.h +++ b/include/version.h @@ -24,10 +24,10 @@ #define ZBX_STR(str) ZBX_STR2(str) #define APPLICATION_NAME "Zabbix Agent" -#define ZABBIX_REVDATE "30 May 2014" +#define ZABBIX_REVDATE "5 August 2014" #define ZABBIX_VERSION_MAJOR 2 #define ZABBIX_VERSION_MINOR 3 -#define ZABBIX_VERSION_PATCH 2 +#define ZABBIX_VERSION_PATCH 4 #define ZABBIX_VERSION_REVISION {ZABBIX_REVISION} #define ZABBIX_VERSION_RC "" #define ZABBIX_VERSION ZBX_STR(ZABBIX_VERSION_MAJOR) "." ZBX_STR(ZABBIX_VERSION_MINOR) "." \ diff --git a/include/zbxgetopt.h b/include/zbxgetopt.h index 6501d5a23db..7222084bc64 100644 --- a/include/zbxgetopt.h +++ b/include/zbxgetopt.h @@ -69,7 +69,7 @@ extern int zbx_optopt; To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero + option's `flag' field to zero and its `val' field to a non-zero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ diff --git a/include/zbxtypes.h b/include/zbxtypes.h index 7c7b5c3dda4..f637de68f1c 100644 --- a/include/zbxtypes.h +++ b/include/zbxtypes.h @@ -20,6 +20,12 @@ #ifndef ZABBIX_TYPES_H #define ZABBIX_TYPES_H +#if defined(_WINDOWS) +# define ZBX_THREAD_LOCAL __declspec(thread) +#else +# define ZBX_THREAD_LOCAL +#endif + #define ZBX_FS_DBL "%lf" #define ZBX_FS_DBL_EXT(p) "%." #p "lf" |