diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | frontends/php/include/classes/graph.inc.php | 92 | ||||
-rw-r--r-- | src/zabbix_server/poller/checks_snmp.c | 2 |
4 files changed, 46 insertions, 51 deletions
@@ -1,5 +1,6 @@ Changes for 1.1beta6: + - fixed two different units in two graph axes (Alexei) - renamed latestalarms.php and alerts.php (Alexei) - fix crash in processing of autoregistration (Alexei) - added validate.inc.php (Alexei) @@ -5,10 +5,8 @@ - http://www.zabbix.com/forum/showthread.php?p=7006#post7006 - http://www.zabbix.com/forum/showthread.php?t=1997 - dos style EOL: http://www.zabbix.com/forum/showthread.php?t=1993 - - unknown SNMP type: http://www.zabbix.com/forum/showthread.php?t=1990 - http://www.zabbix.com/forum/showthread.php?t=1992 - http://www.zabbix.com/forum/showthread.php?t=1657 - - Graphs: http://www.zabbix.com/forum/showthread.php?t=1781 - http://www.zabbix.com/forum/showthread.php?t=1971 - make failed: http://www.zabbix.com/forum/showthread.php?t=1957 - check if ZABBIX server accepts values returned by W32 agent diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index 2ca55bc7..adaafdb7 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -571,14 +571,54 @@ } } + function DrawLeftSide($minYleft, $maxYleft) + { + if($this->yaxisleft == 1) + { + for($item=0;$item<$this->num;$item++) + { + if($this->items[$item]["axisside"] == GRAPH_YAXIS_SIDE_LEFT) + { + $units=$this->items[$item]["units"]; + break; + } + } + for($i=0;$i<=6;$i++) + { + $str = str_pad(convert_units($this->sizeY*$i/6*($maxYleft-$minYleft)/$this->sizeY+$minYleft,$units),10," ", STR_PAD_LEFT); + ImageString($this->im, 1, 5, $this->sizeY-$this->sizeY*$i/6-4+$this->shiftY, $str, $this->colors["Dark Red No Alpha"]); + } + } + } + + function DrawRightSide($minYright, $maxYright) + { + if($this->yaxisright == 1) + { + for($item=0;$item<$this->num;$item++) + { + if($this->items[$item]["axisside"] == GRAPH_YAXIS_SIDE_RIGHT) + { + $units=$this->items[$item]["units"]; + break; + } + } + for($i=0;$i<=6;$i++) + { + $str = str_pad(convert_units($this->sizeY*$i/6*($maxYright-$minYright)/$this->sizeY+$minYright,$units),10," "); + ImageString($this->im, 1, $this->sizeX+$this->shiftXleft+2, $this->sizeY-$this->sizeY*$i/6-4+$this->shiftY, $str, $this->colors["Dark Red No Alpha"]); + } + } + } + function Draw() { $start_time=getmicrotime(); // $this->im = imagecreate($this->sizeX+$this->shiftX+61,$this->sizeY+2*$this->shiftY+40); -// Header( "Content-type: text/html"); - Header( "Content-type: image/png"); + Header( "Content-type: text/html"); +// Header( "Content-type: image/png"); Header( "Expires: Mon, 17 Aug 1998 12:51:50 GMT"); check_authorisation(); @@ -675,19 +715,9 @@ } } - if($this->yaxisright == 1) - for($i=0;$i<=6;$i++) - { - $str = str_pad(convert_units($this->sizeY*$i/6*($maxYright-$minYright)/$this->sizeY+$minYright,$this->items[0]["units"]),10," "); - ImageString($this->im, 1, $this->sizeX+$this->shiftXleft+2, $this->sizeY-$this->sizeY*$i/6-4+$this->shiftY, $str, $this->colors["Dark Red No Alpha"]); - } - if($this->yaxisleft == 1) - for($i=0;$i<=6;$i++) - { - $str = str_pad(convert_units($this->sizeY*$i/6*($maxYleft-$minYleft)/$this->sizeY+$minYleft,$this->items[0]["units"]),10," ", STR_PAD_LEFT); - ImageString($this->im, 1, 5, $this->sizeY-$this->sizeY*$i/6-4+$this->shiftY, $str, $this->colors["Dark Red No Alpha"]); - } + $this->DrawLeftSide($minYleft, $maxYleft); + $this->DrawRightSide($minYright, $maxYright); $this->drawLogo(); @@ -701,38 +731,4 @@ ImageDestroy($this->im); } } - - class Item - { - var $data; - - function Item($itemid=0) - { - if($itemid!=0) - { - $i=get_item_by_itemid($itemid); - if($i) - { - $data=$i; - } - else unset($data); - } - } - - function GetData($element) - { - if(isset($this->data)) - { - return $this->data[$element]; - } - else - { - return false; - } - } - - function SetData($element) - { - } - } ?> diff --git a/src/zabbix_server/poller/checks_snmp.c b/src/zabbix_server/poller/checks_snmp.c index 937b4685..3dfe5b01 100644 --- a/src/zabbix_server/poller/checks_snmp.c +++ b/src/zabbix_server/poller/checks_snmp.c @@ -384,7 +384,7 @@ int get_value_snmp(DB_ITEM *item, AGENT_RESULT *value) /* count is not really used. Has to be removed */ count++; - snprintf(error,MAX_STRING_LEN-1,"value #%d has unknow type [%X]",count,vars->type); + snprintf(error,MAX_STRING_LEN-1,"OID [%s] value #%d has unknow type [%X]",item->snmp_oid, count,vars->type); zabbix_log( LOG_LEVEL_ERR, error); SET_MSG_RESULT(value, strdup(error)); |