diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-05 12:23:20 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-05 12:23:20 +0000 |
| commit | 604ce300ed68ee4ac4fb6bcd74c2b4dec26cfb9e (patch) | |
| tree | 3b9b3e78245161d9d5e89ba3d7b8ca960b870152 /src | |
| parent | c9b5f984679804b7903866160533cd6515b74ad8 (diff) | |
- added server's parameter UnreachableDelay (Alexei)
- added server's parameter UnreachablePeriod (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2801 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
| -rw-r--r-- | src/libs/zbxdbhigh/db.c | 17 | ||||
| -rw-r--r-- | src/zabbix_server/poller/poller.c | 18 | ||||
| -rw-r--r-- | src/zabbix_server/poller/poller.h | 3 | ||||
| -rw-r--r-- | src/zabbix_server/server.c | 8 |
4 files changed, 25 insertions, 21 deletions
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index c0caf5ff..1961f939 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -869,16 +869,16 @@ void DBupdate_host_availability(int hostid,int available,int clock, char *error) if(available == atoi(DBget_field(result,0,0))) { - if((available==HOST_AVAILABLE_FALSE) - &&(clock+SLEEP_ON_UNREACHABLE>disable_until) ) +/* if((available==HOST_AVAILABLE_FALSE) + &&(clock+CONFIG_UNREACHABLE_PERIOD>disable_until) ) { } else - { + {*/ zabbix_log(LOG_LEVEL_DEBUG, "Host already has availability [%d]",available); DBfree_result(result); return; - } +/* }*/ } DBfree_result(result); @@ -891,14 +891,15 @@ void DBupdate_host_availability(int hostid,int available,int clock, char *error) } else if(available==HOST_AVAILABLE_FALSE) { - if(disable_until+SLEEP_ON_UNREACHABLE>clock) +/* if(disable_until+CONFIG_UNREACHABLE_PERIOD>clock) { - snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,disable_until=disable_until+%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,SLEEP_ON_UNREACHABLE,error_esc,hostid); + snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,disable_until=disable_until+%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,CONFIG_UNREACHABLE_DELAY,error_esc,hostid); } else { - snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,disable_until=%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,clock+SLEEP_ON_UNREACHABLE,error_esc,hostid); - } + snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,disable_until=%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,clock+CONFIG_UNREACHABLE_DELAY,error_esc,hostid); + }*/ + snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,error_esc,hostid); zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); DBexecute(sql); } diff --git a/src/zabbix_server/poller/poller.c b/src/zabbix_server/poller/poller.c index 5ffd0e65..32976f3a 100644 --- a/src/zabbix_server/poller/poller.c +++ b/src/zabbix_server/poller/poller.c @@ -306,20 +306,20 @@ int get_values(void) /* First error */ if(item.host_errors_from==0) { - zabbix_log( LOG_LEVEL_WARNING, "Host [%s]: first network error, wait for %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); - zabbix_syslog("Host [%s]: first network error, wait for %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); + zabbix_log( LOG_LEVEL_WARNING, "Host [%s]: first network error, wait for %d seconds", item.host, CONFIG_UNREACHABLE_DELAY); + zabbix_syslog("Host [%s]: first network error, wait for %d seconds", item.host, CONFIG_UNREACHABLE_DELAY); item.host_errors_from=now; - snprintf(sql,sizeof(sql)-1,"update hosts set errors_from=%d,disable_until=%d where hostid=%d", now, now+CONFIG_UNAVAILABLE_DELAY, item.hostid); + snprintf(sql,sizeof(sql)-1,"update hosts set errors_from=%d,disable_until=%d where hostid=%d", now, now+CONFIG_UNREACHABLE_DELAY, item.hostid); zabbix_log( LOG_LEVEL_DEBUG, "SQL [%s]", sql); DBexecute(sql); } else { - if(now-item.host_errors_from>CONFIG_UNAVAILABLE_PERIOD) + if(now-item.host_errors_from>CONFIG_UNREACHABLE_PERIOD) { - zabbix_log( LOG_LEVEL_WARNING, "Host [%s] will be checked after [%d] seconds", item.host, CONFIG_UNAVAILABLE_PERIOD); - zabbix_syslog("Host [%s] will be checked after [%d] seconds", item.host, CONFIG_UNAVAILABLE_PERIOD); + zabbix_log( LOG_LEVEL_WARNING, "Host [%s] will be checked after %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); + zabbix_syslog("Host [%s] will be checked after %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); DBupdate_host_availability(item.hostid,HOST_AVAILABLE_FALSE,now,agent.msg); update_key_status(item.hostid,HOST_AVAILABLE_FALSE); /* 2 */ @@ -332,10 +332,10 @@ int get_values(void) /* Still unavailable, but won't change status to UNAVAILABLE yet */ else { - zabbix_log( LOG_LEVEL_WARNING, "Host [%s]: another network error, wait for %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); - zabbix_syslog("Host [%s]: another network error, wait for %d seconds", item.host, CONFIG_UNAVAILABLE_DELAY); + zabbix_log( LOG_LEVEL_WARNING, "Host [%s]: another network error, wait for %d seconds", item.host, CONFIG_UNREACHABLE_DELAY); + zabbix_syslog("Host [%s]: another network error, wait for %d seconds", item.host, CONFIG_UNREACHABLE_DELAY); - snprintf(sql,sizeof(sql)-1,"update hosts set disable_until=%d where hostid=%d", now+CONFIG_UNAVAILABLE_DELAY, item.hostid); + snprintf(sql,sizeof(sql)-1,"update hosts set disable_until=%d where hostid=%d", now+CONFIG_UNREACHABLE_DELAY, item.hostid); zabbix_log( LOG_LEVEL_DEBUG, "SQL [%s]", sql); DBexecute(sql); } diff --git a/src/zabbix_server/poller/poller.h b/src/zabbix_server/poller/poller.h index a8d16eda..2a04e1d3 100644 --- a/src/zabbix_server/poller/poller.h +++ b/src/zabbix_server/poller/poller.h @@ -26,8 +26,9 @@ extern int server_num; extern int CONFIG_TIMEOUT; extern int CONFIG_POLLER_FORKS; extern int CONFIG_REFRESH_UNSUPPORTED; -extern int CONFIG_UNAVAILABLE_PERIOD; extern int CONFIG_UNAVAILABLE_DELAY; +extern int CONFIG_UNREACHABLE_PERIOD; +extern int CONFIG_UNREACHABLE_DELAY; void main_poller_loop(); diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 5c4935da..32fea743 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -109,8 +109,9 @@ int CONFIG_SENDER_FREQUENCY = 30; int CONFIG_PINGER_FREQUENCY = 60; int CONFIG_DISABLE_PINGER = 0; int CONFIG_DISABLE_HOUSEKEEPING = 0; -int CONFIG_UNAVAILABLE_PERIOD = 60; -int CONFIG_UNAVAILABLE_DELAY = 15; +int CONFIG_UNREACHABLE_PERIOD = 45; +int CONFIG_UNREACHABLE_DELAY = 15; +int CONFIG_UNAVAILABLE_DELAY = 60; int CONFIG_LOG_LEVEL = LOG_LEVEL_WARNING; char *CONFIG_FILE = NULL; char *CONFIG_PID_FILE = NULL; @@ -327,7 +328,8 @@ void init_config(void) {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, {"StartTrappers",&CONFIG_TRAPPERD_FORKS,0,TYPE_INT,PARM_OPT,2,255}, {"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, - {"UnavailablePeriod",&CONFIG_UNAVAILABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600}, + {"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600}, + {"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, {"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, {"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32768}, /* {"NoTimeWait",&CONFIG_NOTIMEWAIT,0,TYPE_INT,PARM_OPT,0,1},*/ |
