summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/discoverer
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-09 11:21:57 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-09 11:21:57 +0000
commitd18d7152bbdf0930483697e24fec5cddec219873 (patch)
tree830cda93cda61f484b91da3dea3e69d209ab476f /src/zabbix_server/discoverer
parentea27e84071e3d5558d1af74aed4a80d97c3748d6 (diff)
downloadzabbix-d18d7152bbdf0930483697e24fec5cddec219873.tar.gz
zabbix-d18d7152bbdf0930483697e24fec5cddec219873.tar.xz
zabbix-d18d7152bbdf0930483697e24fec5cddec219873.zip
- fixed processing of uptime/downtime timestamps for DM (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@4106 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/discoverer')
-rw-r--r--src/zabbix_server/discoverer/discoverer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zabbix_server/discoverer/discoverer.c b/src/zabbix_server/discoverer/discoverer.c
index ae883baf..37beff4a 100644
--- a/src/zabbix_server/discoverer/discoverer.c
+++ b/src/zabbix_server/discoverer/discoverer.c
@@ -350,7 +350,7 @@ static void update_service(DB_DRULE *rule, DB_DCHECK *check, char *ip, int port)
DB_DHOST host;
DB_DSERVICE service;
- zabbix_log(LOG_LEVEL_DEBUG, "In update_check(ip:%s, port:%d, status:%s)",
+ zabbix_log(LOG_LEVEL_DEBUG, "In update_service(ip:%s, port:%d, status:%s)",
ip,
port,
(check->status==DOBJECT_STATUS_UP?"up":"down"));
@@ -377,7 +377,7 @@ static void update_service(DB_DRULE *rule, DB_DCHECK *check, char *ip, int port)
if(check->status == DOBJECT_STATUS_UP)
{
/* Update host status */
- if((host.status == DOBJECT_STATUS_DOWN)||(host.lastup==0 && host.lastdown==0))
+ if(host.status == DOBJECT_STATUS_DOWN || host.lastup==0)
{
host.status=DOBJECT_STATUS_UP;
host.lastdown=0;
@@ -385,7 +385,7 @@ static void update_service(DB_DRULE *rule, DB_DCHECK *check, char *ip, int port)
update_dhost(&host);
}
/* Update service status */
- if((service.status == DOBJECT_STATUS_DOWN)||(service.lastup==0 && service.lastdown==0))
+ if(service.status == DOBJECT_STATUS_DOWN || service.lastup==0)
{
service.status=DOBJECT_STATUS_UP;
service.lastdown=0;
@@ -396,19 +396,19 @@ static void update_service(DB_DRULE *rule, DB_DCHECK *check, char *ip, int port)
/* DOBJECT_STATUS_DOWN */
else
{
- if((host.status == DOBJECT_STATUS_UP)||(host.lastup==0 && host.lastdown==0))
+ if(host.status == DOBJECT_STATUS_UP || host.lastdown==0)
{
host.status=DOBJECT_STATUS_DOWN;
- host.lastup=now;
- host.lastdown=0;
+ host.lastdown=now;
+ host.lastup=0;
update_dhost(&host);
}
/* Update service status */
- if((service.status == DOBJECT_STATUS_UP)||(service.lastup==0 && service.lastdown==0))
+ if(service.status == DOBJECT_STATUS_UP || service.lastdown==0)
{
service.status=DOBJECT_STATUS_DOWN;
- service.lastup=now;
- service.lastdown=0;
+ service.lastdown=now;
+ service.lastup=0;
update_dservice(&service);
}
}