diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-05 12:51:41 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-05 12:51:41 +0000 |
commit | e44191a6fe4a5a879b8c5badb6fda8d78853bec1 (patch) | |
tree | 0298ecc9e753480e008955bf0081688e45f03a89 /src | |
parent | 46f4daf879cb71b022874fc3b6551d97d400fe1b (diff) | |
download | zabbix-e44191a6fe4a5a879b8c5badb6fda8d78853bec1.tar.gz zabbix-e44191a6fe4a5a879b8c5badb6fda8d78853bec1.tar.xz zabbix-e44191a6fe4a5a879b8c5badb6fda8d78853bec1.zip |
- added new server parameter UnavailablePeriod (Alexei)
- dropped column hosts.network_errors (Alexei)
- added column hosts.errors_from (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2604 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rwxr-xr-x | src/alphacode/poller/go | 3 | ||||
-rw-r--r-- | src/alphacode/poller/poller_epoll.c | 20 | ||||
-rw-r--r-- | src/libs/zbxdbhigh/db.c | 12 | ||||
-rw-r--r-- | src/libs/zbxdbhigh/host.c | 4 | ||||
-rw-r--r-- | src/zabbix_server/poller/poller.c | 51 | ||||
-rw-r--r-- | src/zabbix_server/poller/poller.h | 1 | ||||
-rw-r--r-- | src/zabbix_server/server.c | 4 |
7 files changed, 58 insertions, 37 deletions
diff --git a/src/alphacode/poller/go b/src/alphacode/poller/go index f2505af8..a38d9819 100755 --- a/src/alphacode/poller/go +++ b/src/alphacode/poller/go @@ -1 +1,2 @@ -gcc snmp.c -I/usr/include/net-snmp -lsnmp +#gcc snmp.c -I/usr/include/net-snmp -lsnmp +gcc poller_epoll.c -o poller_epoll diff --git a/src/alphacode/poller/poller_epoll.c b/src/alphacode/poller/poller_epoll.c index 2841c315..749d67db 100644 --- a/src/alphacode/poller/poller_epoll.c +++ b/src/alphacode/poller/poller_epoll.c @@ -26,7 +26,7 @@ ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ -#define NUM 5 +#define NUM 1000 int s; @@ -47,6 +47,7 @@ void wait_connect() printf("epfd [%d]\n", epfd); printf("NUM [%d]\n", NUM); + events=malloc(NUM*sizeof(struct epoll_event)); retval = epoll_wait(epfd, events, NUM, -1); if(retval == -1) { @@ -54,6 +55,9 @@ void wait_connect() printf("Retval [%d]\n", errno); exit(-1); } + printf("Retval [%d]\n", retval); + sleep(1); + continue; for(i=0;i<retval;i++) { @@ -120,7 +124,7 @@ int main() { if(errno == EINPROGRESS) { - printf("Connection in progress\n"); +// printf("Connection in progress\n"); } else { @@ -129,11 +133,11 @@ int main() } } - if(fcntl(s, F_SETFL, O_NONBLOCK) == -1) - { - perror("fcntl() failed\n"); - exit(-1); - } +// if(fcntl(s, F_SETFL, O_NONBLOCK) == -1) +// { +// perror("fcntl() failed\n"); +// exit(-1); +// } ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLOUT; ev.data.fd = s; @@ -142,7 +146,7 @@ int main() perror("epoll_ctl, adding listenfd\n"); exit(1); } - printf("epoll_ctl ok fd [%d]\n", s); +// printf("epoll_ctl ok fd [%d]\n", s); } wait_connect(); diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index b4369c9b..adeb637d 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -870,7 +870,7 @@ 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+DELAY_ON_NETWORK_FAILURE>disable_until) ) + &&(clock+SLEEP_ON_UNREACHABLE>disable_until) ) { } else @@ -885,19 +885,19 @@ void DBupdate_host_availability(int hostid,int available,int clock, char *error) if(available==HOST_AVAILABLE_TRUE) { - snprintf(sql,sizeof(sql)-1,"update hosts set available=%d where hostid=%d",HOST_AVAILABLE_TRUE,hostid); + snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,error='',errors_from=0 where hostid=%d",HOST_AVAILABLE_TRUE,hostid); zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); DBexecute(sql); } else if(available==HOST_AVAILABLE_FALSE) { - if(disable_until+DELAY_ON_NETWORK_FAILURE>clock) + if(disable_until+SLEEP_ON_UNREACHABLE>clock) { - snprintf(sql,sizeof(sql)-1,"update hosts set available=%d,disable_until=disable_until+%d,error='%s' where hostid=%d",HOST_AVAILABLE_FALSE,DELAY_ON_NETWORK_FAILURE,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,SLEEP_ON_UNREACHABLE,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+DELAY_ON_NETWORK_FAILURE,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+SLEEP_ON_UNREACHABLE,error_esc,hostid); } zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); DBexecute(sql); @@ -1377,7 +1377,7 @@ void DBget_item_from_db(DB_ITEM *item,DB_RESULT *result, int row) item->host_status=atoi(DBget_field(result,i,16)); item->value_type=atoi(DBget_field(result,i,17)); - item->host_network_errors=atoi(DBget_field(result,i,18)); + item->host_errors_from=atoi(DBget_field(result,i,18)); item->snmp_port=atoi(DBget_field(result,i,19)); item->delta=atoi(DBget_field(result,i,20)); diff --git a/src/libs/zbxdbhigh/host.c b/src/libs/zbxdbhigh/host.c index f9ef30de..8a7630a2 100644 --- a/src/libs/zbxdbhigh/host.c +++ b/src/libs/zbxdbhigh/host.c @@ -178,7 +178,7 @@ int DBget_host_by_hostid(int hostid,DB_HOST *host) zabbix_log( LOG_LEVEL_DEBUG, "In DBget_host_by_hostid(%d)", hostid); - snprintf(sql,sizeof(sql)-1,"select hostid,host,useip,ip,port,status,disable_until,network_errors,error,available from hosts where hostid=%d", hostid); + snprintf(sql,sizeof(sql)-1,"select hostid,host,useip,ip,port,status,disable_until,errors_from,error,available from hosts where hostid=%d", hostid); result=DBselect(sql); if(DBnum_rows(result)==0) @@ -194,7 +194,7 @@ int DBget_host_by_hostid(int hostid,DB_HOST *host) host->port=atoi(DBget_field(result,0,4)); host->status=atoi(DBget_field(result,0,5)); host->disable_until=atoi(DBget_field(result,0,6)); - host->network_errors=atoi(DBget_field(result,0,7)); + host->errors_from=atoi(DBget_field(result,0,7)); strscpy(host->error,DBget_field(result,0,8)); host->available=atoi(DBget_field(result,0,9)); } diff --git a/src/zabbix_server/poller/poller.c b/src/zabbix_server/poller/poller.c index 7db7db3f..dd9cfed8 100644 --- a/src/zabbix_server/poller/poller.c +++ b/src/zabbix_server/poller/poller.c @@ -113,11 +113,13 @@ static int get_minnextcheck(int now) 2 == UNREACHABLE */ if(CONFIG_REFRESH_UNSUPPORTED != 0) { - snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and h.hostid=i.hostid and i.status in (%d,%d) and i.type not in (%d,%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE,HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); +/* snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and h.hostid=i.hostid and i.status in (%d,%d) and i.type not in (%d,%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE,HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY);*/ + snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where h.status=%d and h.disable_until<%d and h.hostid=i.hostid and i.status in (%d,%d) and i.type not in (%d,%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); } else { - snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and h.hostid=i.hostid and i.status in (%d) and i.type not in (%d,%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE,HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); +/* snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and h.hostid=i.hostid and i.status in (%d) and i.type not in (%d,%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE,HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY);*/ + snprintf(sql,sizeof(sql)-1,"select count(*),min(nextcheck) from items i,hosts h where h.status=%d and h.disable_until<%d and h.hostid=i.hostid and i.status in (%d,%d) and i.type not in (%d) and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s')", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); } result = DBselect(sql); @@ -155,7 +157,7 @@ static void update_key_status(int hostid,int host_status) zabbix_log(LOG_LEVEL_DEBUG, "In update_key_status()"); - snprintf(sql,sizeof(sql)-1,"select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.network_errors,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status from items i,hosts h where h.hostid=i.hostid and h.hostid=%d and i.key_='%s'", hostid,SERVER_STATUS_KEY); + snprintf(sql,sizeof(sql)-1,"select %s where h.hostid=i.hostid and h.hostid=%d and i.key_='%s'", ZBX_SQL_ITEM_SELECT, hostid,SERVER_STATUS_KEY); result = DBselect(sql); if( DBnum_rows(result) == 0) @@ -213,11 +215,13 @@ int get_values(void) if(CONFIG_REFRESH_UNSUPPORTED != 0) { - snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d,%d) and i.type not in (%d,%d) and ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<=%d)) and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); +/* snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d,%d) and i.type not in (%d,%d) and ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<=%d)) and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY);*/ + snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d,%d) and i.type not in (%d,%d) and h.status=%d and h.disable_until<=%d and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_STATUS_NOTSUPPORTED, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); } else { - snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d) and i.type not in (%d,%d) and ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<=%d)) and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); +/* snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d) and i.type not in (%d,%d) and ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<=%d)) and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY);*/ + snprintf(sql,sizeof(sql)-1,"select %s where i.nextcheck<=%d and i.status in (%d) and i.type not in (%d,%d) and h.status=%d and h.disable_until<=%d and h.hostid=i.hostid and i.itemid%%%d=%d and i.key_ not in ('%s','%s','%s','%s') order by i.nextcheck", ZBX_SQL_ITEM_SELECT, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER, ITEM_TYPE_ZABBIX_ACTIVE, HOST_STATUS_MONITORED, now, CONFIG_SUCKERD_FORKS-5,server_num-5,SERVER_STATUS_KEY, SERVER_ICMPPING_KEY, SERVER_ICMPPINGSEC_KEY,SERVER_ZABBIXLOG_KEY); } result = DBselect(sql); @@ -233,10 +237,9 @@ int get_values(void) { process_new_value(&item,&agent); - if(item.host_network_errors>0) + if(item.host_errors_from!=0) { - snprintf(sql,sizeof(sql)-1,"update hosts set network_errors=0,error='' where hostid=%d and network_errors>0", item.hostid); - DBexecute(sql); + zabbix_log( LOG_LEVEL_WARNING, "No network errors for [%s]", item.host); } /* if(HOST_STATUS_UNREACHABLE == item.host_status)*/ @@ -279,24 +282,34 @@ int get_values(void) } else if(res == NETWORK_ERROR) { - item.host_network_errors++; - if(item.host_network_errors>=3) + if(item.host_errors_from==0) + { + zabbix_log( LOG_LEVEL_WARNING, "Started network errors for [%s]", item.host); + item.host_errors_from=now; + snprintf(sql,sizeof(sql)-1,"update hosts set errors_from=%d,disable_until=%d where hostid=%d", now, now+(int)(CONFIG_UNAVAILABLE_PERIOD/CHECKS_PER_UNAVAILABLE_PERIOD), item.hostid); + zabbix_log( LOG_LEVEL_DEBUG, "SQL [%s]", sql); + DBexecute(sql); + } + + zabbix_log( LOG_LEVEL_WARNING, "errors_from [%d]+[%d]<[%d]", item.host_errors_from,CONFIG_UNAVAILABLE_PERIOD,now); + if(item.host_errors_from+CONFIG_UNAVAILABLE_PERIOD<now) { - zabbix_log( LOG_LEVEL_WARNING, "Host [%s] will be checked after [%d] seconds", item.host, DELAY_ON_NETWORK_FAILURE ); - zabbix_syslog("Host [%s] will be checked after [%d] seconds", item.host, DELAY_ON_NETWORK_FAILURE ); + zabbix_log( LOG_LEVEL_WARNING, "Host [%s] will be checked after [%d] seconds", item.host, 60); + zabbix_syslog("Host [%s] will be checked after [%d] seconds", item.host, 60); DBupdate_host_availability(item.hostid,HOST_AVAILABLE_FALSE,now,agent.msg); update_key_status(item.hostid,HOST_AVAILABLE_FALSE); /* 2 */ item.host_available=HOST_AVAILABLE_FALSE; - - snprintf(sql,sizeof(sql)-1,"update hosts set network_errors=3 where hostid=%d", item.hostid); - DBexecute(sql); } + /* Still unavailable, but won't change status to UNAVAILABLE yet */ else { - snprintf(sql,sizeof(sql)-1,"update hosts set network_errors=%d where hostid=%d", item.host_network_errors, item.hostid); + zabbix_log( LOG_LEVEL_WARNING, "Host [%s]: another network error, Wait for %d seconds", item.host, (int)(CONFIG_UNAVAILABLE_PERIOD/CHECKS_PER_UNAVAILABLE_PERIOD)); + snprintf(sql,sizeof(sql)-1,"update hosts set disable_until=%d where hostid=%d", now+(int)(CONFIG_UNAVAILABLE_PERIOD/CHECKS_PER_UNAVAILABLE_PERIOD), item.hostid); + zabbix_log( LOG_LEVEL_DEBUG, "SQL [%s]", sql); DBexecute(sql); } + stop=1; } /* Possibly, other logic required? */ @@ -343,7 +356,7 @@ void main_poller_loop() if( FAIL == nextcheck) { - sleeptime=SUCKER_DELAY; + sleeptime=POLLER_DELAY; } else { @@ -355,9 +368,9 @@ void main_poller_loop() } if(sleeptime>0) { - if(sleeptime > SUCKER_DELAY) + if(sleeptime > POLLER_DELAY) { - sleeptime = SUCKER_DELAY; + sleeptime = POLLER_DELAY; } zabbix_log( LOG_LEVEL_DEBUG, "Sleeping for %d seconds", sleeptime ); diff --git a/src/zabbix_server/poller/poller.h b/src/zabbix_server/poller/poller.h index 9c828bb6..28156222 100644 --- a/src/zabbix_server/poller/poller.h +++ b/src/zabbix_server/poller/poller.h @@ -26,6 +26,7 @@ extern int server_num; extern int CONFIG_TIMEOUT; extern int CONFIG_SUCKERD_FORKS; extern int CONFIG_REFRESH_UNSUPPORTED; +extern int CONFIG_UNAVAILABLE_PERIOD; void main_poller_loop(); diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 6d94571b..991b4a80 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -79,6 +79,7 @@ int CONFIG_SENDER_FREQUENCY = 30; int CONFIG_PINGER_FREQUENCY = 60; int CONFIG_DISABLE_PINGER = 0; int CONFIG_DISABLE_HOUSEKEEPING = 0; +int CONFIG_UNAVAILABLE_PERIOD = 20; int CONFIG_LOG_LEVEL = LOG_LEVEL_WARNING; char *CONFIG_FILE = NULL; char *CONFIG_PID_FILE = NULL; @@ -319,6 +320,7 @@ 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}, {"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32768}, {"NoTimeWait",&CONFIG_NOTIMEWAIT,0,TYPE_INT,PARM_OPT,0,1}, {"DisablePinger",&CONFIG_DISABLE_PINGER,0,TYPE_INT,PARM_OPT,0,1}, @@ -573,7 +575,7 @@ int main(int argc, char **argv) for(i=0;i<CONFIG_SUCKERD_FORKS+CONFIG_TRAPPERD_FORKS-1;i++) { - zabbix_log( LOG_LEVEL_WARNING, "%d. PID=[%d]", i, pids[i]); + zabbix_log( LOG_LEVEL_DEBUG, "%d. PID=[%d]", i, pids[i]); } zabbix_log( LOG_LEVEL_CRIT, "ZABBIX server is up."); |