summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-29 21:46:12 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-29 21:46:12 +0000
commitca4ff0d32a2833d7a8b06dbff08ac1ee74e0a325 (patch)
treead6fe9c1a4777f066a965fdd70c09cc6d8d8f855 /include
parent4b8e5e6fc8f01ac6a26f137f32d79e5cf72670ea (diff)
- support for zabbix[trends] (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1073 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include')
-rw-r--r--include/db.c26
-rw-r--r--include/db.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/include/db.c b/include/db.c
index 91c46046..bb97eefa 100644
--- a/include/db.c
+++ b/include/db.c
@@ -942,6 +942,32 @@ int DBget_history_count(void)
return res;
}
+int DBget_trends_count(void)
+{
+ int res;
+ char sql[MAX_STRING_LEN+1];
+ DB_RESULT *result;
+
+ zabbix_log(LOG_LEVEL_DEBUG,"In DBget_trends_count()");
+
+ sprintf(sql,"select count(*) from trends");
+
+ 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_queue_count(void)
{
int res;
diff --git a/include/db.h b/include/db.h
index 8f86793d..2e5a2eaa 100644
--- a/include/db.h
+++ b/include/db.h
@@ -194,6 +194,7 @@ void DBdelete_host(int hostid);
int DBget_items_count(void);
int DBget_items_unsupported_count(void);
int DBget_history_count(void);
+int DBget_trends_count(void);
int DBget_triggers_count(void);
int DBget_queue_count(void);
#endif