diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-05-30 11:57:20 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-05-30 11:57:20 +0000 |
| commit | 567cf582cd11ff034ee19208ff24c7882dd45907 (patch) | |
| tree | 63136f6fe1b75e85f5c3b6c51ad7879b2fdca4a0 /include | |
| parent | 29ec7fb26b1523d0a0e36dd2244aa74ab2ca7f23 (diff) | |
| download | zabbix-567cf582cd11ff034ee19208ff24c7882dd45907.tar.gz zabbix-567cf582cd11ff034ee19208ff24c7882dd45907.tar.xz zabbix-567cf582cd11ff034ee19208ff24c7882dd45907.zip | |
- added support for zabbix[triggers_count] (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@795 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include')
| -rw-r--r-- | include/db.c | 26 | ||||
| -rw-r--r-- | include/db.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/db.c b/include/db.c index 72c6f9ec..e31225f2 100644 --- a/include/db.c +++ b/include/db.c @@ -702,6 +702,32 @@ int DBget_items_count(void) return res; } +int DBget_triggers_count(void) +{ + int res; + char sql[MAX_STRING_LEN+1]; + DB_RESULT *result; + + zabbix_log(LOG_LEVEL_DEBUG,"In DBget_triggers_count()"); + + sprintf(sql,"select count(*) from triggers"); + + 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_items_unsupported_count(void) { int res; diff --git a/include/db.h b/include/db.h index 4523e49f..7799e9a3 100644 --- a/include/db.h +++ b/include/db.h @@ -178,4 +178,5 @@ int DBupdate_trigger_value(int triggerid,int value,int clock); int DBget_items_count(void); int DBget_items_unsupported_count(void); int DBget_history_count(void); +int DBget_triggers_count(void); #endif |
