diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-07 14:22:08 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-07 14:22:08 +0000 |
| commit | e0531e491d0fc52fb3d662890dbd3dbedebfa754 (patch) | |
| tree | fd3de04b7570e4d6493a218dfdce85ff45724fa1 | |
| parent | a5e27c0c89d5a3e89e48cbbc73efb0731799f1cc (diff) | |
| download | zabbix-e0531e491d0fc52fb3d662890dbd3dbedebfa754.tar.gz zabbix-e0531e491d0fc52fb3d662890dbd3dbedebfa754.tar.xz zabbix-e0531e491d0fc52fb3d662890dbd3dbedebfa754.zip | |
- [ZBX-130] Refresh unsupported active checks (Sasha)
[svn merge -r4975:4977 svn://svn.zabbix.com/branches/1.4.j]
git-svn-id: svn://svn.zabbix.com/trunk@4978 97f52cf1-0a1b-0410-bd0e-c28be96e8082
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | include/db.h | 1 | ||||
| -rw-r--r-- | src/libs/zbxdbhigh/db.c | 6 | ||||
| -rw-r--r-- | src/zabbix_server/actions.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/alerter/alerter.h | 7 | ||||
| -rw-r--r-- | src/zabbix_server/discoverer/discoverer.h | 1 | ||||
| -rw-r--r-- | src/zabbix_server/evalfunc.h | 1 | ||||
| -rw-r--r-- | src/zabbix_server/functions.c | 4 | ||||
| -rw-r--r-- | src/zabbix_server/housekeeper/housekeeper.h | 5 | ||||
| -rw-r--r-- | src/zabbix_server/httppoller/httppoller.h | 1 | ||||
| -rw-r--r-- | src/zabbix_server/operations.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/pinger/pinger.h | 7 | ||||
| -rw-r--r-- | src/zabbix_server/poller/checks_aggregate.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/poller/poller.h | 1 | ||||
| -rw-r--r-- | src/zabbix_server/timer/timer.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/active.c | 25 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/active.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/nodecommand.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/nodeevents.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/nodehistory.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/trapper/nodesync.h | 2 | ||||
| -rw-r--r-- | src/zabbix_server/watchdog/watchdog.h | 2 |
22 files changed, 30 insertions, 52 deletions
@@ -28,9 +28,12 @@ Changes for 1.5: Changes for 1.4.3: + - [ZBX-130] Refresh unsupported active checks (Sasha) - [ZBX-134] fixes for hostid/groupid validation on Node switch (Artem) - [ZBX-131] fixed viewing password on install in plain text (Artem) - [ZBX-81] fix for item delay calculation problem in graphs (Artem) + - [DEV-75] Empty command result window (Sasha) + - [DEV-74] Scripts of all nodes are displayed (Sasha) - [ZBX-107] do not display log related items in the queue (Alexei) - [DEV-43] support of new macros {ITEM.VALUE}, {ITEM.VALUE1}, etc (Alexei) - [ZBX-102] Distributed monitoring: overwriting information (Sasha) diff --git a/include/db.h b/include/db.h index 5e60eddc..b0a2cf38 100644 --- a/include/db.h +++ b/include/db.h @@ -37,6 +37,7 @@ extern int CONFIG_NODEID; extern int CONFIG_MASTER_NODEID; extern int CONFIG_DBSYNCER_FORKS; extern int CONFIG_NODE_NOHISTORY; +extern int CONFIG_REFRESH_UNSUPPORTED; typedef enum { GRAPH_TYPE_NORMAL = 0, diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index 5f60359a..038bf7ce 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -955,6 +955,7 @@ void DBupdate_host_availability(zbx_uint64_t hostid,int available,int clock, cha int DBupdate_item_status_to_notsupported(zbx_uint64_t itemid, const char *error) { char error_esc[MAX_STRING_LEN]; + int now; zabbix_log(LOG_LEVEL_DEBUG,"In DBupdate_item_status_to_notsupported()"); @@ -967,9 +968,12 @@ int DBupdate_item_status_to_notsupported(zbx_uint64_t itemid, const char *error) strscpy(error_esc,""); } + now = time(NULL); + /* '%s ' to make Oracle happy */ - DBexecute("update items set status=%d,error='%s' where itemid=" ZBX_FS_UI64, + DBexecute("update items set status=%d,nextcheck=%d,error='%s ' where itemid=" ZBX_FS_UI64, ITEM_STATUS_NOTSUPPORTED, + CONFIG_REFRESH_UNSUPPORTED+now, error_esc, itemid); diff --git a/src/zabbix_server/actions.h b/src/zabbix_server/actions.h index 31fce33d..eb2ab1f5 100644 --- a/src/zabbix_server/actions.h +++ b/src/zabbix_server/actions.h @@ -24,8 +24,6 @@ #include "common.h" #include "db.h" -extern int CONFIG_NODEID; - void process_actions(DB_EVENT *event); #endif diff --git a/src/zabbix_server/alerter/alerter.h b/src/zabbix_server/alerter/alerter.h index 416d8823..327b0f1e 100644 --- a/src/zabbix_server/alerter/alerter.h +++ b/src/zabbix_server/alerter/alerter.h @@ -23,15 +23,8 @@ #include "db.h" extern int CONFIG_SENDER_FREQUENCY; -extern char *CONFIG_DBHOST; -extern char *CONFIG_DBNAME; -extern char *CONFIG_DBUSER; -extern char *CONFIG_DBPASSWORD; -extern char *CONFIG_DBSOCKET; extern char *CONFIG_ALERT_SCRIPTS_PATH; -extern int CONFIG_NODEID; - extern void signal_handler( int sig ); int main_alerter_loop(); diff --git a/src/zabbix_server/discoverer/discoverer.h b/src/zabbix_server/discoverer/discoverer.h index 38a453b5..12f30728 100644 --- a/src/zabbix_server/discoverer/discoverer.h +++ b/src/zabbix_server/discoverer/discoverer.h @@ -20,7 +20,6 @@ #ifndef ZABBIX_DISCOVERER_H #define ZABBIX_DISCOVERER_H -extern int CONFIG_NODEID; extern int CONFIG_DISCOVERER_FORKS; void main_discoverer_loop(int num); diff --git a/src/zabbix_server/evalfunc.h b/src/zabbix_server/evalfunc.h index 77826c3d..4ed9ebc8 100644 --- a/src/zabbix_server/evalfunc.h +++ b/src/zabbix_server/evalfunc.h @@ -30,7 +30,6 @@ #define ZBX_FLAG_SEC 0 #define ZBX_FLAG_VALUES 1 -extern int CONFIG_NODEID; extern int CONFIG_SERVER_STARTUP_TIME; int evaluate_function(char *value,DB_ITEM *item,char *function,char *parameter); diff --git a/src/zabbix_server/functions.c b/src/zabbix_server/functions.c index 5bdbd439..db94440c 100644 --- a/src/zabbix_server/functions.c +++ b/src/zabbix_server/functions.c @@ -289,12 +289,12 @@ int process_data(zbx_sock_t *sock,char *server,char *key,char *value,char *lastl DBescape_string(server, server_esc, MAX_STRING_LEN); DBescape_string(key, key_esc, MAX_STRING_LEN); - result = DBselect("select %s where h.status=%d and h.hostid=i.hostid and h.host='%s' and i.key_='%s' and i.status=%d and i.type in (%d,%d) and" ZBX_COND_NODEID, + result = DBselect("select %s where h.status=%d and h.hostid=i.hostid and h.host='%s' and i.key_='%s' and i.status in (%d,%d) and i.type in (%d,%d) and" ZBX_COND_NODEID, ZBX_SQL_ITEM_SELECT, HOST_STATUS_MONITORED, server_esc, key_esc, - ITEM_STATUS_ACTIVE, + ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, LOCAL_NODE("h.hostid")); diff --git a/src/zabbix_server/housekeeper/housekeeper.h b/src/zabbix_server/housekeeper/housekeeper.h index 987c23fe..ecb9bb52 100644 --- a/src/zabbix_server/housekeeper/housekeeper.h +++ b/src/zabbix_server/housekeeper/housekeeper.h @@ -22,11 +22,6 @@ extern int CONFIG_DISABLE_HOUSEKEEPING; extern int CONFIG_HOUSEKEEPING_FREQUENCY; -extern char *CONFIG_DBHOST; -extern char *CONFIG_DBNAME; -extern char *CONFIG_DBUSER; -extern char *CONFIG_DBPASSWORD; -extern char *CONFIG_DBSOCKET; extern char *CONFIG_FPING_LOCATION; int main_housekeeper_loop(); diff --git a/src/zabbix_server/httppoller/httppoller.h b/src/zabbix_server/httppoller/httppoller.h index 444aaaee..eb0d63e0 100644 --- a/src/zabbix_server/httppoller/httppoller.h +++ b/src/zabbix_server/httppoller/httppoller.h @@ -23,7 +23,6 @@ extern void signal_handler(int); extern int server_num; -extern int CONFIG_NODEID; extern int CONFIG_HTTPPOLLER_FORKS; void main_httppoller_loop(int num); diff --git a/src/zabbix_server/operations.h b/src/zabbix_server/operations.h index 44196ea2..523f03c3 100644 --- a/src/zabbix_server/operations.h +++ b/src/zabbix_server/operations.h @@ -24,8 +24,6 @@ #include "common.h" #include "db.h" -extern int CONFIG_NODEID; - void op_template_add(DB_EVENT *event, DB_ACTION *action, DB_OPERATION *operation); void op_template_del(DB_EVENT *event, DB_ACTION *action, DB_OPERATION *operation); void op_group_add(DB_EVENT *event, DB_ACTION *action, DB_OPERATION *operation); diff --git a/src/zabbix_server/pinger/pinger.h b/src/zabbix_server/pinger/pinger.h index 19510dc2..bf52b8d7 100644 --- a/src/zabbix_server/pinger/pinger.h +++ b/src/zabbix_server/pinger/pinger.h @@ -22,15 +22,8 @@ extern int CONFIG_PINGER_FORKS; extern int CONFIG_PINGER_FREQUENCY; -extern char *CONFIG_DBHOST; -extern char *CONFIG_DBNAME; -extern char *CONFIG_DBUSER; -extern char *CONFIG_DBPASSWORD; -extern char *CONFIG_DBSOCKET; extern char *CONFIG_FPING_LOCATION; -extern int CONFIG_NODEID; - extern void signal_handler( int sig ); void main_pinger_loop(int num); diff --git a/src/zabbix_server/poller/checks_aggregate.h b/src/zabbix_server/poller/checks_aggregate.h index 01b92010..0d42b2bd 100644 --- a/src/zabbix_server/poller/checks_aggregate.h +++ b/src/zabbix_server/poller/checks_aggregate.h @@ -25,8 +25,6 @@ #include "log.h" #include "sysinfo.h" -extern int CONFIG_NODEID; - extern int get_value_aggregate(DB_ITEM *item, AGENT_RESULT *result); #endif diff --git a/src/zabbix_server/poller/poller.h b/src/zabbix_server/poller/poller.h index cadbd680..6f08111c 100644 --- a/src/zabbix_server/poller/poller.h +++ b/src/zabbix_server/poller/poller.h @@ -26,7 +26,6 @@ extern int server_num; extern int CONFIG_TIMEOUT; extern int CONFIG_POLLER_FORKS; extern int CONFIG_UNREACHABLE_POLLER_FORKS; -extern int CONFIG_REFRESH_UNSUPPORTED; extern int CONFIG_UNAVAILABLE_DELAY; extern int CONFIG_UNREACHABLE_PERIOD; extern int CONFIG_UNREACHABLE_DELAY; diff --git a/src/zabbix_server/timer/timer.h b/src/zabbix_server/timer/timer.h index 469eb099..9589e5ee 100644 --- a/src/zabbix_server/timer/timer.h +++ b/src/zabbix_server/timer/timer.h @@ -20,8 +20,6 @@ #ifndef ZABBIX_TIMER_H #define ZABBIX_TIMER_H -extern int CONFIG_NODEID; - void main_timer_loop(); #endif diff --git a/src/zabbix_server/trapper/active.c b/src/zabbix_server/trapper/active.c index fef5d5d9..43371865 100644 --- a/src/zabbix_server/trapper/active.c +++ b/src/zabbix_server/trapper/active.c @@ -68,12 +68,25 @@ int send_list_of_active_checks(zbx_sock_t *sock, const char *host) zabbix_log( LOG_LEVEL_DEBUG, "In send_list_of_active_checks()"); - result = DBselect("select i.key_,i.delay,i.lastlogsize from items i,hosts h where i.hostid=h.hostid and h.status=%d and i.status=%d and i.type=%d and h.host='%s' and" ZBX_COND_NODEID, - HOST_STATUS_MONITORED, - ITEM_STATUS_ACTIVE, - ITEM_TYPE_ZABBIX_ACTIVE, - host, - LOCAL_NODE("h.hostid")); + if (0 != CONFIG_REFRESH_UNSUPPORTED) { + result = DBselect("select i.key_,i.delay,i.lastlogsize from items i,hosts h " + "where i.hostid=h.hostid and h.status=%d and i.type=%d and h.host='%s' " + "and (i.status=%d or (i.status=%d and i.nextcheck<=%d)) and"ZBX_COND_NODEID, + HOST_STATUS_MONITORED, + ITEM_TYPE_ZABBIX_ACTIVE, + host, + ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, time(NULL), + LOCAL_NODE("h.hostid")); + } else { + result = DBselect("select i.key_,i.delay,i.lastlogsize from items i,hosts h " + "where i.hostid=h.hostid and h.status=%d and i.type=%d and h.host='%s' " + "and i.status=%d and"ZBX_COND_NODEID, + HOST_STATUS_MONITORED, + ITEM_TYPE_ZABBIX_ACTIVE, + host, + ITEM_STATUS_ACTIVE, + LOCAL_NODE("h.hostid")); + } while((row=DBfetch(result))) { diff --git a/src/zabbix_server/trapper/active.h b/src/zabbix_server/trapper/active.h index fea909e2..3b31ea74 100644 --- a/src/zabbix_server/trapper/active.h +++ b/src/zabbix_server/trapper/active.h @@ -25,8 +25,6 @@ #include "db.h" #include "comms.h" -extern int CONFIG_NODEID; - int send_list_of_active_checks(zbx_sock_t *sock, const char *host); #endif diff --git a/src/zabbix_server/trapper/nodecommand.h b/src/zabbix_server/trapper/nodecommand.h index 20623ddd..4bf87603 100644 --- a/src/zabbix_server/trapper/nodecommand.h +++ b/src/zabbix_server/trapper/nodecommand.h @@ -21,8 +21,6 @@ #ifndef ZABBIX_NODECOMMAND_H #define ZABBIX_NODECOMMAND_H -extern int CONFIG_NODEID; - int node_process_command(const char *data, char **result); #endif diff --git a/src/zabbix_server/trapper/nodeevents.h b/src/zabbix_server/trapper/nodeevents.h index d8ce34bb..d990c9b0 100644 --- a/src/zabbix_server/trapper/nodeevents.h +++ b/src/zabbix_server/trapper/nodeevents.h @@ -21,8 +21,6 @@ #ifndef ZABBIX_NODEEVENTS_H #define ZABBIX_NODEEVENTS_H -extern int CONFIG_NODEID; - int node_events(char *data); #endif diff --git a/src/zabbix_server/trapper/nodehistory.h b/src/zabbix_server/trapper/nodehistory.h index e7c046d3..fbed322d 100644 --- a/src/zabbix_server/trapper/nodehistory.h +++ b/src/zabbix_server/trapper/nodehistory.h @@ -21,8 +21,6 @@ #ifndef ZABBIX_NODEHISTORY_H #define ZABBIX_NODEHISTORY_H -extern int CONFIG_NODEID; - int node_history(char *data); #endif diff --git a/src/zabbix_server/trapper/nodesync.h b/src/zabbix_server/trapper/nodesync.h index 34beb17b..94c3a594 100644 --- a/src/zabbix_server/trapper/nodesync.h +++ b/src/zabbix_server/trapper/nodesync.h @@ -21,8 +21,6 @@ #ifndef ZABBIX_NODESYNC_H #define ZABBIX_NODESYNC_H -extern int CONFIG_NODEID; - int node_sync(char *data, int *sender_nodeid, int *nodeid); #endif diff --git a/src/zabbix_server/watchdog/watchdog.h b/src/zabbix_server/watchdog/watchdog.h index 015a412e..4a1ec56c 100644 --- a/src/zabbix_server/watchdog/watchdog.h +++ b/src/zabbix_server/watchdog/watchdog.h @@ -20,8 +20,6 @@ #ifndef ZABBIX_WATCHDOG_H #define ZABBIX_WATCHDOG_H -extern int CONFIG_NODEID; - void main_watchdog_loop(); #endif |
