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/db.c | |
| parent | 29ec7fb26b1523d0a0e36dd2244aa74ab2ca7f23 (diff) | |
- 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/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 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; |
