0)) { $icon=$icon_on; } if(@gettype($icons["$icon"])!="resource") { /* if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $icons[$icon]=ImageCreateFromPNG("images/sysmaps/$icon.png"); } else { $icons[$icon]=ImageCreateFromPNG("images/sysmaps/old/$icon.png"); } */ $sql="select image from images where imagetype=1 and name='$icon'"; $result2=DBselect($sql); if(DBnum_rows($result2)!=1) { $icons[$icon] = imagecreatetruecolor(48,48); } else { $row2=DBfetch($result2); $icons[$icon]=ImageCreateFromString($row2["image"]); } } $img=$icons[$icon]; // imagecolortransparent ($img, imagecolorat ($img, 0, 0)); // imagecolortransparent ($img, 0, 0, 0); ImageCopy($im,$img,$x,$y,0,0,ImageSX($img),ImageSY($img)); $first_line=""; if($label_type==MAP_LABEL_TYPE_HOSTNAME) { $first_line=$host; } else if($label_type==MAP_LABEL_TYPE_HOSTLABEL) { $first_line=$label; } else if($label_type==MAP_LABEL_TYPE_IP) { $first_line=$ip; } if($first_line!="") { $x1=$x+ImageSX($img)/2-ImageFontWidth(2)*strlen($first_line)/2; $y1=$y+ImageSY($img); ImageFilledRectangle($im,$x1-2, $y1,$x1+ImageFontWidth(2)*strlen($first_line), $y1+ImageFontHeight(2),$white); ImageString($im, 2, $x1, $y1, $first_line,$black); } if($status == HOST_STATUS_NOT_MONITORED) { $color=$darkred; # $label="Not monitored"; $label=""; } else { if($count==1) { $result1=DBselect("select distinct t.description,t.triggerid, t.priority from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status=".HOST_STATUS_MONITORED." and i.status=0"); $row1=DBfetch($result1); $label=$row1["description"]; if ($row1["priority"] > 3) $color=$red; else $color=$darkyellow; $label=expand_trigger_description_simple($row1["triggerid"]); } else if($count>1) { $color=$red; $label=$count." ".S_PROBLEMS_SMALL; } else { $color=$darkgreen; $label=S_OK_BIG; } } $x1=$x+ImageSX($img)/2-ImageFontWidth(2)*strlen($label)/2; $y1=$y+ImageSY($img); if($first_line!="") { $y1=$y1+ImageFontHeight(2); } if($label_type!=MAP_LABEL_TYPE_NOTHING) { ImageFilledRectangle($im,$x1-2, $y1,$x1+ImageFontWidth(2)*strlen($label), $y1+ImageFontHeight(2),$white); ImageString($im, 2, $x1, $y1, $label,$color); } } ImageStringUp($im,0,imagesx($im)-10,imagesy($im)-50, S_ZABBIX_URL, $gray); if(MAP_OUTPUT_FORMAT == "JPG") ImageJPEG($im); else ImageOut($im); #default ImageDestroy($im); ?>