Ad Widget

Collapse

Errors deactivating items in zabbix 1.6.6 with Postgres

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EvilShadow
    Junior Member
    • Mar 2007
    • 13

    #1

    Errors deactivating items in zabbix 1.6.6 with Postgres

    I've installed zabbix on Debian from lenny-backports:
    Code:
    db:/var/log/zabbix-server# db:/var/log/postgresql# dpkg -l | grep zabbix
    ii  zabbix-agent                      1:1.6.6-1~bpo50+1        network monitoring solution - agent
    ii  zabbix-server-pgsql               1:1.6.6-1~bpo50+1        network monitoring solution - server (using PostgreSQL)
    and created new host from Template_SNMPv2_Device. Now I want to deactivate some items that my devices does not support. Trying to do this from web-interface gives me such error:
    Code:
    pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xd12e HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:465]
    Error in query [INSERT INTO auditlog (auditid,userid,clock,action,resourcetype,details) values (506,3,1256378993,1,15,'Элемент данных [lmemBufferNoMem] [22591] Узел сети [4012]Элементы данных деактиви�...')] [ERROR: invalid byte sequence for encoding "UTF8": 0xd12e HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".]
    pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:392]
    Error in query [SELECT itemid, hostid FROM items WHERE (templateid IN (22591)) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:522]
    pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:392]
    Error in query [SELECT itemid, status FROM items WHERE (itemid IN (22591)) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:522]
    pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:392]
    Error in query [SELECT DISTINCT t.triggerid FROM triggers t,functions f WHERE f.triggerid=t.triggerid AND (f.itemid IN (22591)) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:522]
    pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block[/var/www/adm.dominion.dn.ua/html/zab/include/db.inc.php:465]
    Error in query [UPDATE items SET status=1 WHERE (itemid IN (22591)) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    If I try to deactivate few items at a time, web-interface hangs and postgres log fills with errors until zabbix-server is stopped and postgres process killed:
    Code:
    2009-10-24 13:08:56 EEST STATEMENT:  SELECT nextid FROM ids WHERE nodeid=0 AND table_name='auditlog' AND field_name='auditid'
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  SELECT max(auditid) AS id FROM auditlog WHERE auditid>=0 AND auditid<=99999999999
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  INSERT INTO ids (nodeid,table_name,field_name,nextid)  VALUES (0,'auditlog','auditid',0)
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  SELECT nextid FROM ids WHERE nodeid=0 AND table_name='auditlog' AND field_name='auditid'
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  SELECT max(auditid) AS id FROM auditlog WHERE auditid>=0 AND auditid<=99999999999
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  INSERT INTO ids (nodeid,table_name,field_name,nextid)  VALUES (0,'auditlog','auditid',0)
    2009-10-24 13:08:56 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:56 EEST STATEMENT:  SELECT nextid FROM ids WHERE nodeid=0 AND table_name='auditlog' AND field_name='auditid'
    2009-10-24 13:08:57 EEST ERROR:  current transaction is aborted, commands ignored until end of transaction block
    2009-10-24 13:08:57 EEST STATEMENT:  SELECT max(auditid) AS id FROM auditlog WHERE auditid>=0 AND auditid<=99999999999
    ..... and much more here
    I haven't noticed such problems on my previous MySQL zabbix installation, but after zabbix lost few items after mysql server poweroff, I no longer want to use MySQL for such data.
  • EvilShadow
    Junior Member
    • Mar 2007
    • 13

    #2
    Today I noticed, that not only deactivation triggers eternal errors in postgres logs. I checked 4 items and clicked 'activate' and got just the same result.
    Does zabbix support postgres only in 'marketing mode', or it really can be used in production?

    Comment

    • Aly
      ZABBIX developer
      • May 2007
      • 1126

      #3
      1. ZABBIX 1.6.x doesn't support officially UTF8 encodings.
      2. Some problems with postgresql hanging have been fixed in the latest sources.
      Zabbix | ex GUI developer

      Comment

      • EvilShadow
        Junior Member
        • Mar 2007
        • 13

        #4
        Originally posted by Aly
        1. ZABBIX 1.6.x doesn't support officially UTF8 encodings.
        I was recommended to replace
        $details = substr($details, 0, 125).'...';
        with
        $details = mb_substr($details, 0, 125).'...';
        in include/audit.inc.php, it helps. Logs show that problems happen when inserting zabbix's own localized strings, so instead of using fix with mb_substr one can just switch to english interface localization.
        Is full UTF8 support scheduled for near future?
        2. Some problems with postgresql hanging have been fixed in the latest sources.
        In 1.7.1? Will try it, thanks

        Comment

        • Aly
          ZABBIX developer
          • May 2007
          • 1126

          #5
          Try setting in php.ini mbstring.func_overload = 2, that will help with unicode in frontend.
          Zabbix | ex GUI developer

          Comment

          • EvilShadow
            Junior Member
            • Mar 2007
            • 13

            #6
            Yes, it helps for zabbix, but unfortunately it also breaks Joomla that works on the same host. I'd better stay with fixes in audit.inc.php for now.
            Thank you for explanations, i'm glad i can continue using postgres for zabbix

            Comment

            • kozian
              Junior Member
              • Oct 2009
              • 7

              #7
              Hello everyone.

              Seems like i have the same problem:
              Code:
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [2-1] ERROR:  invalid byte sequence for encoding "UTF8": 0xcff0
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [2-2] HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [3-1] ERROR:  invalid byte sequence for encoding "UTF8": 0xcff0
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [3-2] HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [4-1] ERROR:  current transaction is aborted, commands ignored until end of transaction block
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [4-2] STATEMENT:  select distinct function,parameter,itemid,lastvalue from functions where itemid=36683
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [5-1] ERROR:  current transaction is aborted, commands ignored until end of transaction block
              Dec  4 20:14:27 BTC-SRV-MNTR3a postgres[98831]: [5-2] STATEMENT:  select distinct t.triggerid,t.expression,t.description,t.url,t.comments,t.status,t.value,t.priority,t.type from triggers t,functions f,items i where i.status<>3 and i.itemid=f.itemid and t.status=0 and f.triggerid=t.triggerid and f.itemid=36683
              But nither changing substr to mb_substr, nor setting func_overload = 2 solve my problem.
              Using zabbix 1.6.7...

              This items type is eventlog.

              is there any way to get it working?

              Comment

              Working...