diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-07 10:18:23 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-07 10:18:23 +0000 |
commit | 81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8 (patch) | |
tree | 617de2ff61c0c14558bf32064f5e4fb09e6f7b72 /src/libs/zbxdbhigh/db.c | |
parent | 7f522167399f26f908eee6385a5a3bd02a8a2728 (diff) | |
download | zabbix-81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8.tar.gz zabbix-81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8.tar.xz zabbix-81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8.zip |
- [DEV-140] Heartbeat alerts configuration
[added support of zabbix[proxy,<proxyname>,lastaccess]]
git-svn-id: svn://svn.zabbix.com/trunk@5594 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxdbhigh/db.c')
-rw-r--r-- | src/libs/zbxdbhigh/db.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index a58662fc..7610cc83 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -1536,6 +1536,34 @@ int DBget_queue_count(void) return res; } +zbx_uint64_t DBget_proxy_lastaccess(const char *hostname) +{ + zbx_uint64_t res; + DB_RESULT result; + DB_ROW row; + + zabbix_log(LOG_LEVEL_DEBUG,"In D()"); + + result = DBselect("select lastaccess from hosts where host='%s' and status in (%d)", + hostname, + HOST_STATUS_PROXY); + + if (NULL == (row = DBfetch(result)) || SUCCEED == DBis_null(row[0])) { + zabbix_log(LOG_LEVEL_ERR, "Proxy \"%s\" not exists", + hostname); + zabbix_syslog("Proxy \"%s\" not exists", + hostname); + DBfree_result(result); + return FAIL; + } + + res = zbx_atoui64(row[0]); + + DBfree_result(result); + + return res; +} + int DBadd_alert(zbx_uint64_t actionid, zbx_uint64_t userid, zbx_uint64_t eventid, zbx_uint64_t mediatypeid, char *sendto, char *subject, char *message) { int now; |