diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/common.h | 3 | ||||
| -rw-r--r-- | include/db.c | 2 | ||||
| -rw-r--r-- | include/functions.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h index 0562c541..82fbc7ab 100644 --- a/include/common.h +++ b/include/common.h @@ -17,6 +17,7 @@ /* Item types */ #define ITEM_TYPE_ZABBIX 0 #define ITEM_TYPE_SNMP 1 +#define ITEM_TYPE_TRAPPER 2 /* Item value types */ #define ITEM_VALUE_TYPE_FLOAT 0 @@ -31,7 +32,7 @@ /* Item statuses */ #define ITEM_STATUS_ACTIVE 0 #define ITEM_STATUS_DISABLED 1 -#define ITEM_STATUS_TRAPPED 2 +/*#define ITEM_STATUS_TRAPPED 2*/ #define ITEM_STATUS_NOTSUPPORTED 3 /* Host statuses */ diff --git a/include/db.c b/include/db.c index 3e2f0248..ca38e331 100644 --- a/include/db.c +++ b/include/db.c @@ -519,7 +519,7 @@ void DBupdate_triggers_status_after_restart(void) { triggerid=atoi(DBget_field(result,i,0)); - sprintf(sql,"select min(i.nextcheck+i.delay) from hosts h,items i,triggers t,functions f where f.triggerid=t.triggerid and f.itemid=i.itemid and h.hostid=i.hostid and i.nextcheck<>0 and t.triggerid=%d and i.status<>%d",triggerid,ITEM_STATUS_TRAPPED); + sprintf(sql,"select min(i.nextcheck+i.delay) from hosts h,items i,triggers t,functions f where f.triggerid=t.triggerid and f.itemid=i.itemid and h.hostid=i.hostid and i.nextcheck<>0 and t.triggerid=%d and i.type<>%d",triggerid,ITEM_TYPE_TRAPPER); zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); result2 = DBselect(sql); if( DBnum_rows(result2) == 0 ) diff --git a/include/functions.c b/include/functions.c index 2f3a568c..3f25c599 100644 --- a/include/functions.c +++ b/include/functions.c @@ -885,7 +885,7 @@ int process_data(int sockfd,char *server,char *key,char *value) zabbix_log( LOG_LEVEL_DEBUG, "In process_data()"); - sprintf(sql,"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.value_type,i.trapper_hosts from items i,hosts h where h.status in (0,2) and h.hostid=i.hostid and h.host='%s' and i.key_='%s' and i.status=%d", server, key, ITEM_STATUS_TRAPPED); + sprintf(sql,"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.value_type,i.trapper_hosts from items i,hosts h where h.status in (0,2) and h.hostid=i.hostid and h.host='%s' and i.key_='%s' and i.status=%d and i.type=%d", server, key, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER); result = DBselect(sql); if(DBnum_rows(result) == 0) |
