Ad Widget

Collapse

[1.3.8] Error in items / perf_counter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    [1.3.8] Error in items / perf_counter

    Hi,

    I am happy that the length of the performance counters were increased.

    There is one problem (at least) left if I add a new (large) performance
    counter item, the error message (from the auditing part) is:

    Code:
       * pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(128)[/usr/local/www/data/zabbix/include/db.inc.php:355]
       * Error in query [insert into auditlog (auditid,userid,clock,action,resourcetype,details) values (100000000000058,100000000000001,1179906499,0,15,'Item [perf_counter[\\Network Interface(Broadcom NetXtreme Gigabit Ethernet)\\Packets Received Errors]] [100000000018559] Host [Template_Windows-Net-Broadcom]')] [ERROR: value too long for type character varying(128)]
    Either the details should be trimmed to max. 128 characters or the
    table column enlarged accordingly.

    Regards,

    Norbert.
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #2
    Temporary work-aorund

    Hi,

    I checked the size for the details field in audit.inc.php and limited the size to
    the first 128 characters as a work-around.

    The real fix would be to enlarge the length of the details field.
    I don't know how long it can get, so I didn't fix it the right way

    Patch:
    Code:
    --- include/audit.inc.php.orig  Thu May 17 19:26:01 2007
    +++ include/audit.inc.php       Thu May 24 08:07:11 2007
    @@ -65,6 +65,8 @@
     
                    $auditid        = get_dbid("auditlog","auditid");
     
    +# NBL: limit length of details to 128 characters (as in the DB)
    +               if (strlen($details) > 128) $details = substr($details,0,127);
                    if(($result = DBexecute("insert into auditlog (auditid,userid,clock,action,resourcetype,details) ".
                            " values ($auditid,".$USER_DETAILS["userid"].",".time().",$action,$resourcetype,".zbx_dbstr($details).")")))
                    {
    Regards,

    Norbert.

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Thanks for repoting this! Fixed.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      Working...