Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Levijev <vladimir.levijev@zabbix.com>2016-01-18 17:42:50 +0300
committerVladimir Levijev <vladimir.levijev@zabbix.com>2016-01-18 17:42:50 +0300
commit058abd3a0e3b57bfc5a57bd115b2e5a85935cf16 (patch)
tree5d42a02d1be8ba51de394ed7715c3ea1fcd58a54 /include/sysinfo.h
parent9a653370af797762ced5a9965386f02e2093e2e0 (diff)
...GI..PS. [ZBX-10102] add support for log file meta information update for items with value type other than log (disregard r57741)
By accident, commit r57741 that claims adding this functionality does nothing. Please consider this commit.
Diffstat (limited to 'include/sysinfo.h')
-rw-r--r--include/sysinfo.h143
1 files changed, 75 insertions, 68 deletions
diff --git a/include/sysinfo.h b/include/sysinfo.h
index 67fffefad48..69e6b82e694 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -31,80 +31,89 @@
#define ISSET_TEXT(res) ((res)->type & AR_TEXT)
#define ISSET_LOG(res) ((res)->type & AR_LOG)
#define ISSET_MSG(res) ((res)->type & AR_MESSAGE)
+#define ISSET_META(res) ((res)->type & AR_META)
+
+#define ISSET_VALUE(res) ((res)->type & (AR_UINT64 | AR_DOUBLE | AR_STRING | AR_TEXT | AR_LOG))
/* UNSET RESULT */
-#define UNSET_UI64_RESULT(res) \
-( \
- (res)->type &= ~AR_UINT64, \
- (res)->ui64 = (zbx_uint64_t)0 \
-)
-
-#define UNSET_DBL_RESULT(res) \
-( \
- (res)->type &= ~AR_DOUBLE, \
- (res)->dbl = (double)0 \
-)
-
-#define UNSET_STR_RESULT(res) \
- \
-do \
-{ \
- if ((res)->type & AR_STRING) \
- { \
- zbx_free((res)->str); \
- (res)->type &= ~AR_STRING; \
- } \
-} \
+#define UNSET_UI64_RESULT(res) \
+ \
+do \
+{ \
+ (res)->type &= ~AR_UINT64; \
+ (res)->ui64 = (zbx_uint64_t)0; \
+} \
+while (0)
+
+#define UNSET_DBL_RESULT(res) \
+ \
+do \
+{ \
+ (res)->type &= ~AR_DOUBLE; \
+ (res)->dbl = (double)0; \
+} \
while (0)
-#define UNSET_TEXT_RESULT(res) \
- \
-do \
-{ \
- if ((res)->type & AR_TEXT) \
- { \
- zbx_free((res)->text); \
- (res)->type &= ~AR_TEXT; \
- } \
-} \
+#define UNSET_STR_RESULT(res) \
+ \
+do \
+{ \
+ if ((res)->type & AR_STRING) \
+ { \
+ zbx_free((res)->str); \
+ (res)->type &= ~AR_STRING; \
+ } \
+} \
while (0)
-#define UNSET_LOG_RESULT(res) \
- \
-do \
-{ \
- if ((res)->type & AR_LOG) \
- { \
- zbx_logs_free((res)->logs); \
- (res)->type &= ~AR_LOG; \
- } \
-} \
+#define UNSET_TEXT_RESULT(res) \
+ \
+do \
+{ \
+ if ((res)->type & AR_TEXT) \
+ { \
+ zbx_free((res)->text); \
+ (res)->type &= ~AR_TEXT; \
+ } \
+} \
while (0)
-#define UNSET_MSG_RESULT(res) \
- \
-do \
-{ \
- if ((res)->type & AR_MESSAGE) \
- { \
- zbx_free((res)->msg); \
- (res)->type &= ~AR_MESSAGE; \
- } \
-} \
+#define UNSET_LOG_RESULT(res) \
+ \
+do \
+{ \
+ if ((res)->type & AR_LOG) \
+ { \
+ zbx_log_free((res)->log); \
+ (res)->type &= ~AR_LOG; \
+ } \
+} \
while (0)
-#define UNSET_RESULT_EXCLUDING(res, exc_type) \
- \
-do \
-{ \
- if (!(exc_type & AR_UINT64)) UNSET_UI64_RESULT(res); \
- if (!(exc_type & AR_DOUBLE)) UNSET_DBL_RESULT(res); \
- if (!(exc_type & AR_STRING)) UNSET_STR_RESULT(res); \
- if (!(exc_type & AR_TEXT)) UNSET_TEXT_RESULT(res); \
- if (!(exc_type & AR_LOG)) UNSET_LOG_RESULT(res); \
- if (!(exc_type & AR_MESSAGE)) UNSET_MSG_RESULT(res); \
-} \
+#define UNSET_MSG_RESULT(res) \
+ \
+do \
+{ \
+ if ((res)->type & AR_MESSAGE) \
+ { \
+ zbx_free((res)->msg); \
+ (res)->type &= ~AR_MESSAGE; \
+ } \
+} \
+while (0)
+
+#define UNSET_RESULT_EXCLUDING(res, exc_type) \
+ \
+do \
+{ \
+ if (!(exc_type & AR_UINT64)) UNSET_UI64_RESULT(res); \
+ if (!(exc_type & AR_DOUBLE)) UNSET_DBL_RESULT(res); \
+ if (!(exc_type & AR_STRING)) UNSET_STR_RESULT(res); \
+ if (!(exc_type & AR_TEXT)) UNSET_TEXT_RESULT(res); \
+ if (!(exc_type & AR_LOG)) UNSET_LOG_RESULT(res); \
+ if (!(exc_type & AR_MESSAGE)) UNSET_MSG_RESULT(res); \
+} \
while (0)
/* RETRIEVE RESULT VALUE */
@@ -113,7 +122,7 @@ while (0)
#define GET_DBL_RESULT(res) ((double *)get_result_value_by_type(res, AR_DOUBLE))
#define GET_STR_RESULT(res) ((char **)get_result_value_by_type(res, AR_STRING))
#define GET_TEXT_RESULT(res) ((char **)get_result_value_by_type(res, AR_TEXT))
-#define GET_LOG_RESULT(res) ((zbx_log_t **)get_result_value_by_type(res, AR_LOG))
+#define GET_LOG_RESULT(res) ((zbx_log_t *)get_result_value_by_type(res, AR_LOG))
#define GET_MSG_RESULT(res) ((char **)get_result_value_by_type(res, AR_MESSAGE))
void *get_result_value_by_type(AGENT_RESULT *result, int require_type);
@@ -190,7 +199,7 @@ void test_parameters();
void test_parameter(const char *key);
void init_result(AGENT_RESULT *result);
-void zbx_logs_free(zbx_log_t **logs);
+void zbx_log_free(zbx_log_t *log);
void free_result(AGENT_RESULT *result);
void init_request(AGENT_REQUEST *request);
@@ -198,13 +207,11 @@ void free_request(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);
-
void unquote_key_param(char *param);
void quote_key_param(char **param, int forced);
int set_result_type(AGENT_RESULT *result, int value_type, int data_type, char *c);
+void set_result_meta(AGENT_RESULT *result, zbx_uint64_t lastlogsize, int mtime);
#ifdef HAVE_KSTAT_H
zbx_uint64_t get_kstat_numeric_value(const kstat_named_t *kn);