summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-07 14:22:08 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-07 14:22:08 +0000
commite0531e491d0fc52fb3d662890dbd3dbedebfa754 (patch)
treefd3de04b7570e4d6493a218dfdce85ff45724fa1 /src/zabbix_server
parenta5e27c0c89d5a3e89e48cbbc73efb0731799f1cc (diff)
downloadzabbix-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
Diffstat (limited to 'src/zabbix_server')
-rw-r--r--src/zabbix_server/actions.h2
-rw-r--r--src/zabbix_server/alerter/alerter.h7
-rw-r--r--src/zabbix_server/discoverer/discoverer.h1
-rw-r--r--src/zabbix_server/evalfunc.h1
-rw-r--r--src/zabbix_server/functions.c4
-rw-r--r--src/zabbix_server/housekeeper/housekeeper.h5
-rw-r--r--src/zabbix_server/httppoller/httppoller.h1
-rw-r--r--src/zabbix_server/operations.h2
-rw-r--r--src/zabbix_server/pinger/pinger.h7
-rw-r--r--src/zabbix_server/poller/checks_aggregate.h2
-rw-r--r--src/zabbix_server/poller/poller.h1
-rw-r--r--src/zabbix_server/timer/timer.h2
-rw-r--r--src/zabbix_server/trapper/active.c25
-rw-r--r--src/zabbix_server/trapper/active.h2
-rw-r--r--src/zabbix_server/trapper/nodecommand.h2
-rw-r--r--src/zabbix_server/trapper/nodeevents.h2
-rw-r--r--src/zabbix_server/trapper/nodehistory.h2
-rw-r--r--src/zabbix_server/trapper/nodesync.h2
-rw-r--r--src/zabbix_server/watchdog/watchdog.h2
19 files changed, 21 insertions, 51 deletions
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