<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi list.<br><br></div>I was working on a bash script to save the change of routes on smokeping Target devices.<br></div>The script is quite simple, It's read the Target file and get the IP address and the check if the device is reachable, if so, then it's make and mtr and store the route in a database (mysql)<br>
</div>This script runs on cron each 5 minutes.<br></div>Also I wrote a php web that recives an IP address as a parameter and show the changes of routes for these IP.<br></div>I want to add this php web as a link in the title of the detailed graphs. So I edited the Target file and add in the title variable something like this:<br>
<br></div><div>menu = Some place<br></div>title= Some place <a href=/ruteo/search.php?ip=192.168.2.234>192.168.2.234</a><br></div><span>host= <a href="#" class="" title=" IP " style="color:rgb(0,0,0);background-color:rgb(238,253,252)">192.168.2.234</a><br>
<br></span></div><span>This works so so, because the links appear ok in the detailed graphs as a title (html title) but in the main view of the smokeping </span>the graphs generated by rrdtool show as a title this: <br><br>
Some place <a href=/ruteo/search.php?ip=192.168.2.234>192.168.2.234</a><br><br></div>And so the graph It's look no good.<br><br></div>Then I edit the Smokeping.pm and this block of code <br><div><div><div>
------------------------------------------------<br> my ($graphret,$xs,$ys) = RRDs::graph<br> ($cfg->{General}{imgcache}.$dir."/${prop}_mini.png",<br> # '--lazy',<br> '--start','-'.exp2seconds($cfg->{Presentation}{overview}{range}),<br>
'--title',$phys_tree->{title},<br> '--height',$cfg->{Presentation}{overview}{height},<br> '--width',$cfg->{Presentation}{overview}{width},<br> '--vertical-label', $ProbeUnit,<br>
'--imgformat','PNG',<br> '--alt-autoscale-max',<br> '--alt-y-grid',<br> '--rigid',<br> '--lower-limit','0',<br> @G,<br>
"COMMENT:$date\\r");<br> my $ERROR = RRDs::error();<br> $page .= "<div>";<br><br>------------------------------------------------<br><br></div><div>I've changed the line '--title',$phys_tree->{title}, <br>
for this line '--title',$phys_tree->{mytitle},<br><br></div><div>With this change It's work so so, because in the rrdtool main graph It's appear no title.<br></div><div>Trying to solve this, in the file Targets I've add a new variable defined on this way<br>
<br><div>menu = Some place<br></div>title= Some place <a href=/ruteo/search.php?ip=192.168.2.234>192.168.2.234</a><br></div><div>mytitle= Some place 192.168.2.234</div><div><span>host= <a href="https://mail.google.com/mail/u/0/#" class="" title=" IP " style="color:rgb(0,0,0);background-color:rgb(238,253,252)">192.168.2.234</a></span><br>
<br></div><div>But with this change when I restart smokeping I've an error. Unknown variable mytitle.<br><br></div><div>Any ideas?<br><br></div><div>Thanks in advance and sorry for my english :(<br><br><br><br><br></div>
<div><br></div><div><br><br><br><br><br></div><div><div><div><div><br><br></div></div></div></div></div></div></div>