Ad Widget

Collapse

SNMP Trap Handler and PostgreSQL 9.0.5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nateK
    Junior Member
    • Nov 2011
    • 1

    #1

    SNMP Trap Handler and PostgreSQL 9.0.5

    I'm using the SNMP trap handler detailed at http://www.zabbix.com/wiki/howto/mon...a_new_solution and it works just find with Zabbix 1.8.5 and PostgreSQL 9.0.4.

    I'm using FreeBSD ports to manage Zabbix and PostgreSQL and I noticed that when I update to Zabbix 1.8.8 and PostgreSQL 9.0.5 the SNMP trap handler script breaks.

    The script is grabbing a template name instead of a host.

    For example:

    /usr/local/bin/zabbix_sender --zabbix-server 127.0.0.1 --port 10051 --host Template_Dell_OpenManage

    This should return the proper hostname in Zabbix as it does under PostgreSQL 9.0.4.

    I have tracked down the issue to the following line in the script:

    $dbh->selectrow_hashref("SELECT itemid,description,key_ FROM items where \hostid='$hostid' and '$keyoidvaluenum' like concat(key_,'%') order by \
    length(key_) desc limit 1;");

    The script debug log file is showing the following:

    ERROR: function concat(character varying, unknown) does not exist at character 98

    HINT: No function matches the given name and argument types. You might need to add explicit type casts.

    STATEMENT: SELECT itemid,description,key_ FROM items where \
    hostid='10022' and '.1.3.6.1.4.1.318.0.77' like concat(key_,'%') order by \
    length(key_) desc limit 1;

    I'm pretty sure that the problem is concat(key_,'%') but I'm not entirely sure how to fix it as far as adding an explicit cast type in the SQL statement.

    Any PostgreSQL gurus out there who can point me in the right direction?

    I will post this in the PostgreSQL mailing list as well to see if I can get some help which will then be posted back to the original script page in the Zabbix howto
    Last edited by nateK; 10-11-2011, 00:54. Reason: Cleaned up script output to be more legible
Working...