Hi to all,
I already opened this some time ago but I think now it is time to realize this relative easily.
SVG is pure xml, so easy to make templates with macros (see example).
So creating svg map from php is really easy. Get template from DB, expand macros and embed it into html. Visualisation is on client so server does not need to hard work with bitmaps.
This could be maybe totaly external thing to zabbix. It is enaught to use zabbix php function to expand macros.
What do you thing ?
Nice with this design is, that there are no limits in map. You can make box as big as some value. Or you can do some gauge showing percents. Everything is in xml code.
I already opened this some time ago but I think now it is time to realize this relative easily.
SVG is pure xml, so easy to make templates with macros (see example).
So creating svg map from php is really easy. Get template from DB, expand macros and embed it into html. Visualisation is on client so server does not need to hard work with bitmaps.
This could be maybe totaly external thing to zabbix. It is enaught to use zabbix php function to expand macros.
What do you thing ?
Nice with this design is, that there are no limits in map. You can make box as big as some value. Or you can do some gauge showing percents. Everything is in xml code.
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
id="svg602"
sodipodi:version="0.34"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="210mm"
height="297mm"
xml:space="preserve"
sodipodi:docbase="/tmp"
sodipodi:docname="/tmp/test.svg"><defs
id="defs604" /><sodipodi:namedview
id="base" /><rect
style="font-size:12;fill:#808080;fill-rule:evenodd;stroke-width:1;"
id="rect605"
width="123.404022"
height="164.538742"
x="106.264587"
y="239.952286" /><rect
style="font-size:12;fill:#808080;fill-rule:evenodd;stroke-width:1;"
id="rect606"
width="113.120392"
height="195.389709"
x="356.500549"
y="555.318176" /><rect
style="font-size:12;fill:#808080;fill-rule:evenodd;stroke-width:1;"
id="rect607"
width="75.4136047"
height="78.8414001"
x="503.899811"
y="137.115601" /><text
style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;"
x="123.404037"
y="435.34198"
id="text608"><tspan
id="tspan609">host1 - {host1:item.last(0)}</tspan></text><text
style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;"
x="534.750854"
y="246.80806"
id="text611"><tspan
id="tspan612">host2 - {host2:item2.last(1)}</tspan></text><text
style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;"
x="387.351562"
y="774.703064"
id="text614"><tspan
id="tspan615">host3 - {host3:item2.last(1)}</tspan></text></svg>

Comment