thank you for your reply, i use cacti for administration purpose of a router which have multiple links the total of bandwidth is displayed on a link between two nodes. the goal is when i have a pic of traffic i can get the map.png file from the output directory of weathermap. so i developped an application to get this map and i check the max-bandwidth from text file named in my case bbtt_data.txt. i modified the weathermap.class.php to get from cacti the max-bandwidth and store this value into text file. the application work fine but recently i installed this version of weathermap 0.98 and i can't find the same files and code.
this is the older code from the weathermap.class.php 0.92 version
Code:
var $my_bb_tt_res = array();
if (!is_null($q1_x))
{
$outbound=array
(
$q1_x,
$q1_y,
0,
0,
$this->outpercent,
$this->bandwidth_out,
$q1_angle
);
$inbound=array
(
$q3_x,
$q3_y,
0,
0,
$this->inpercent,
$this->bandwidth_in,
$q3_angle
);
foreach (array($inbound, $outbound)as $task)
{
$thelabel="";
if ($this->labelstyle != 'none')
{
debug("Bandwidth is ".$task[5]."\n");
if ($this->labelstyle == 'bits') { $thelabel=nice_bandwidth($task[5], $this->owner->kilo); $this->my_bb_tt_res[] = nice_bandwidth($task[5], $this->owner->kilo); }
elseif ($this->labelstyle == 'unformatted') { $thelabel=$task[5]; $this->my_bb_tt_res[] = $task[5];}
elseif ($this->labelstyle == 'percent') { $thelabel=format_number($task[4]) . "%"; $this->my_bb_tt_res[] = format_number($task[4]) . "%"; }
$padding = intval($this->get_hint('bwlabel_padding'));
if($this->labelboxstyle == 'angled')
{
$map->DrawLabelRotated($im, $task[0], $task[1],$task[6], $thelabel, $this->bwfont, $padding,
$this->name, $this->bwfontcolour, $this->bwboxcolour, $this->bwoutlinecolour,$map);
}
else
{
$map->DrawLabel($im, $task[0], $task[1], $thelabel, $this->bwfont, $padding,
$this->name, $this->bwfontcolour, $this->bwboxcolour, $this->bwoutlinecolour,$map);
}
}
}
}
}
// this code is inserted in the function MakeHTML
$html .= '<div id="bbttel" style="display:none;">';
$bbtt_max = 0;
foreach($this->links as $link){
foreach($link->my_bb_tt_res as $key => $value){
if(substr($value, -1) == 'G'){
if(floatval($value) > $bbtt_max){
$bbtt_max = floatval($value);
}
}
//$html .= $value . '|';
}
}
$html .= $bbtt_max;
file_put_contents('output/bbtt_data.txt',$bbtt_max);
$html .= '</div>';
how can i adapt this code to weathermap 0.98
