diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-08-03 13:53:28 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-08-03 13:53:28 +0000 |
commit | 3fff8788c421d1cf2aa7a19fee9756355f0b666b (patch) | |
tree | 8a45491532ce369f3f653ba67cc280a3821a99e7 /include/db.c | |
parent | 45d9a5cfcd90e2086d74dce58338f75b721b647d (diff) | |
download | zabbix-3fff8788c421d1cf2aa7a19fee9756355f0b666b.tar.gz zabbix-3fff8788c421d1cf2aa7a19fee9756355f0b666b.tar.xz zabbix-3fff8788c421d1cf2aa7a19fee9756355f0b666b.zip |
- added support of zabbix[history_str] (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1369 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include/db.c')
-rw-r--r-- | include/db.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/db.c b/include/db.c index d36a1e65..aca21295 100644 --- a/include/db.c +++ b/include/db.c @@ -1002,6 +1002,32 @@ int DBget_items_unsupported_count(void) return res; } +int DBget_history_str_count(void) +{ + int res; + char sql[MAX_STRING_LEN]; + DB_RESULT *result; + + zabbix_log(LOG_LEVEL_DEBUG,"In DBget_history_str_count()"); + + snprintf(sql,sizeof(sql)-1,"select count(*) from history_str"); + + result=DBselect(sql); + + if(DBnum_rows(result) == 0) + { + zabbix_log(LOG_LEVEL_ERR, "Cannot execute query [%s]", sql); + DBfree_result(result); + return 0; + } + + res = atoi(DBget_field(result,0,0)); + + DBfree_result(result); + + return res; +} + int DBget_history_count(void) { int res; |