Spent about 2 days setting Zabbix 3.0.4 on Debian, smooth sailing for the most part. One error almost made me want to switch to other monitoring solution, almost 2 days spent searching and trying to fix one silly error. I will just put source code of Zabbix where that error occurs for anyone else that’s getting it.

zabbix-3.0.4\src\zabbix_server\trapper\active.c

result =
#if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
    DBselect(
        "select hostid,status,tls_accept,tls_issuer,tls_subject,tls_psk_identity"
        " from hosts"
        " where host='%s'"
            " and status in (%d,%d)"
            " and flags<>%d"
            " and proxy_hostid is null",
        host_esc, HOST_STATUS_MONITORED, HOST_STATUS_NOT_MONITORED, ZBX_FLAG_DISCOVERY_PROTOTYPE);
#else
    DBselect(
        "select hostid,status,tls_accept"
        " from hosts"
        " where host='%s'"
            " and status in (%d,%d)"
            " and flags<>%d"
            " and proxy_hostid is null",
        host_esc, HOST_STATUS_MONITORED, HOST_STATUS_NOT_MONITORED, ZBX_FLAG_DISCOVERY_PROTOTYPE);
#endif
if (NULL != (row = DBfetch(result)))
{
    /* Code removed */
}
else
{
    zbx_snprintf(error, MAX_STRING_LEN, "host [%s] not found", host);

    /* Code removed */
}

 

zabbix-3.0.4\frontends\php\include\defines.inc.php

define('HOST_STATUS_MONITORED',        0);
define('HOST_STATUS_NOT_MONITORED',    1);
define('ZBX_FLAG_DISCOVERY_PROTOTYPE',    0x2);

 

Lesson learned, if project is open source and is throwing errors, look at source code. Googling – 1.5days, source code – 5min.

Comments


Comments are closed