Ad Widget

Collapse

PATCH: Multiple fixes against 1.1.5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krelac
    Junior Member
    • Oct 2006
    • 24

    #16
    Originally posted by James Wells
    Okay, here is the current version, which corrects the issue that Palmertree and Krelac found


    hehe, compiling and running just fine

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #17
      I was noticing some errors in the httpd logs and I notice a Undefined index value on line 1018 in graphs.inc.php when viewing graphs. I also noticed that the SUM function in the graphs were not working correctly. I made an atemp to fix this below. James Wells, maybe you can take a look to see if what I am doing is correct or if I am going about it in the wrong way. I got rid of the "Gray" errors by replace "Gray" with the color "Grey".

      $curr_data = &$this->data[$this->items[$i]["itemid"]][$type];
      $curr_data->count = NULL;
      $curr_data->min = NULL;
      $curr_data->max = NULL;
      $curr_data->avg = NULL;
      $this->items[$i]["sum"] = NULL;

      foreach($sql_arr as $sql)
      {
      $result=DBselect($sql);
      while($row=DBfetch($result))
      {
      $idx=$row["i"];
      $curr_data->count[$idx] = $row["count"];
      $curr_data->min[$idx] = $row["min"];
      $curr_data->max[$idx] = $row["max"];
      $curr_data->avg[$idx] = $row["avg"];
      $curr_data->clock[$idx] = $row["clock"];
      $this->items[$i]["sum"] += $row["avg"];
      $curr_data->shift_min[$idx] = 0;
      $curr_data->shift_max[$idx] = 0;
      $curr_data->shift_avg[$idx] = 0

      HTTPD Logs:
      [Sun Feb 18 01:00:22 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: Gray in /var/www/html/zabbix/include/classes/graph.inc.php on line 402, referer: https://www.somesite.com/zabbix/hist...h&itemid=19634
      [Sun Feb 18 01:00:22 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: Gray in /var/www/html/zabbix/include/classes/graph.inc.php on line 402, referer: https://www.somesite.com/zabbix/hist...h&itemid=19634
      [Sun Feb 18 01:00:22 2007] [error] [client x.x.x.x] PHP Notice: Undefined variable: i in /var/www/html/zabbix/include/classes/graph.inc.php on line 1222, referer: https://www.somesite.com/zabbix/hist...h&itemid=19634
      [Sun Feb 18 01:00:22 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: in /var/www/html/zabbix/include/classes/graph.inc.php on line 1222, referer: https://www.somesite.com/zabbix/hist...h&itemid=19634
      [Sun Feb 11 16:50:02 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: value in /var/www/html/zabbix/include/classes/graph.inc.php on line 1018, referer: https://www.somesite.com/zabbix/hist...owgraph&from=0
      Last edited by Palmertree; 27-02-2007, 01:17.

      Comment

      • James Wells
        Senior Member
        • Jun 2005
        • 664

        #18
        Originally posted by Palmertree
        I got rid of the "Gray" errors by replace "Gray" with the color "Grey".
        This was me being a damn Yank. I have corrected it to use the British spelling of "Grey" and done a full search looking for instances of Gray, and replacing those as well. The only ones remaining now as Gray are those that are defined internally to PHP for the PDF report generator feature.... Will get that finished one of these days.

        $this->items[$i]["sum"] += $row["avg"];
        Good catch. When using history, you need to use "value" field, however, when you switch to the trends table, you need to convert to using "avg" field, which, while not truly accurate, is better than nothing. The problem is that the "avg" is an average for the last 30 entries in the history file. Eventually, I will re-write this to use as much history as we can get.

        I will be posting a new bulk patch, shortly, that contains these changes and the other things I have been doing recently.
        Unofficial Zabbix Developer

        Comment

        Working...