cd /usr/ports make search name="mrtg"
Port: mrtg-2.16.2_1,1 Path: /usr/ports/net-mgmt/mrtg Info: The multi-router traffic grapher Maint: mrtg@subnets.ru B-deps: freetype2-2.3.9_1 gd-2.0.35_1,1 jpeg-7 perl-5.8.9_3 pkg-config-0.23_1 png-1.2.40 R-deps: freetype2-2.3.9_1 gd-2.0.35_1,1 jpeg-7 p5-Pod-Parser-1.38 p5-SNMP_Session-1.12 perl-5.8.9_3 pkg-config-0.23_1 png-1.2.40 WWW: **********
cd /usr/ports/net-mgmt/mrtg make && make install && make clean
Refresh: 300 Language: russian WorkDir: /data/sites/su/http/statistica WriteExpires: Yes WithPeak[_]: dwmy XSize[_]: 600 YSize[_]: 200 Title[^]: Graphs:
#!/usr/local/bin/php <?php $file_name='http://localhost:8000/status2.xsl'; $r=fopen($file_name,'r'); $text=fread($r,1000); fclose($r); $mass=explode(",", $text); $list=$mass [9]; $mas=explode (" ", $mass [7]); $ti=substr($mas [0],7); $day=floor($ti/86500); $he=floor(($ti-$day*86500)/3600); $mi=floor(($ti-$day*86500-$he*3600)/60); $upt="".$day." days, ".$he." hours, ".$mi." minutes."; $s=0; echo $list."\n"; echo $s."\n"; echo $upt."\n"; echo "/all"; ?>
Target[all]: `/usr/local/etc/mrtg/list_all.php` Options[all]: nopercent, integer, gauge MaxBytes[all]: 1000 AbsMax[all]: 1000 Title[all]: Listens PageTop[all]: <H1>Radio Listens</H1> YLegend[all]: # of connections ShortLegend[all]: L/s Legend1[all]: # of listeners Legend2[all]: Legend3[all]: Maximal # of listeners Legend4[all]: LegendI[all]: # of listeners: LegendO[all]:
Refresh: 300 Language: russian WorkDir: /data/sites/su/http/statistica WriteExpires: Yes WithPeak[_]: dwmy XSize[_]: 600 YSize[_]: 200 Title[^]: Graphs: Target[wr]: `/usr/local/etc/mrtg/list_wr.php` Options[wr]: nopercent, integer, gauge MaxBytes[wr]: 1000 AbsMax[wr]: 1000 Title[wr]: Listens PageTop[wr]: <H1>Wasteland Radio Listens</H1> YLegend[wr]: # of connections ShortLegend[wr]: L/s Legend1[wr]: # of listeners Legend2[wr]: Legend3[wr]: Maximal # of listeners Legend4[wr]: LegendI[wr]: # of listeners: LegendO[wr]: Target[64]: `/usr/local/etc/mrtg/list_64.php` Options[64]: nopercent, integer, gauge MaxBytes[64]: 1000 AbsMax[64]: 1000 Title[64]: Listens PageTop[64]: <H1>MP3 64 Listens</H1> YLegend[64]: # of connections ShortLegend[64]: L/s Legend1[64]: # of listeners Legend2[64]: Legend3[64]: Maximal # of listeners Legend4[64]: LegendI[64]: # of listeners: LegendO[64]: Target[128]: `/usr/local/etc/mrtg/list_128.php` Options[128]: nopercent, integer, gauge MaxBytes[128]: 1000 AbsMax[128]: 1000 Title[128]: Listens PageTop[128]: <H1>MP3 128 Listens</H1> YLegend[128]: # of connections ShortLegend[128]: L/s Legend1[128]: # of listeners Legend2[128]: Legend3[128]: Maximal # of listeners Legend4[128]: LegendI[128]: # of listeners: LegendO[128]: Target[aac]: `/usr/local/etc/mrtg/list_aac.php` Options[aac]: nopercent, integer, gauge MaxBytes[aac]: 1000 AbsMax[aac]: 1000 Title[aac]: Listens PageTop[aac]: <H1>AAC+ Listens</H1> YLegend[aac]: # of connections ShortLegend[aac]: L/s Legend1[aac]: # of listeners Legend2[aac]: Legend3[aac]: Maximal # of listeners Legend4[aac]: LegendI[aac]: # of listeners: LegendO[aac]:
Interval: 5 RunAsDaemon: yes
@reboot /usr/local/bin/perl -w /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg
EACCELERATOR: Open for write failed for "/tmp/eaccelerator/1/9/eaccelerator-021.39162621": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/all.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/all.php': ' Expected a Number for 'out' but got 'Content-type: text/html EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.17528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/hr_192.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/hr_192.php': ' Expected a Number for 'out' but got 'Content-type: text/html EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.07528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/hr_128.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/hr_128.php': ' Expected a Number for 'out' but got 'Content-type: text/html /usr/local/etc/mrtg/lr_128.php: cannot open ?php: No such file or directory 2009-09-26 19:07:25: WARNING: Could not get any data from external command '/usr/local/etc/mrtg/lr_128.php' Maybe the external command did not even start. (No such file or directory) 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/lr_128.php': Expected a Number for 'in' but nothing' 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/lr_128.php': Expected a Number for 'out' but nothing' EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.06528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/lr_live.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/lr_live.php': ' Expected a Number for 'out' but got 'Content-type: text/html 2009-09-26 19:07:27: ERROR: Target[all][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[hr_192][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[hr_128][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_128][_IN_] ' $target->[3]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_128][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_live][_OUT_] ' $target->[4]{$mode} ' did not eval into defined data
EACCELERATOR: Open for write failed for "/tmp/eaccelerator/1/9/eaccelerator-021.39162621": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/all.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/all.php': ' Expected a Number for 'out' but got 'Content-type: text/html EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.17528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/hr_192.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/hr_192.php': ' Expected a Number for 'out' but got 'Content-type: text/html EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.07528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/hr_128.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/hr_128.php': ' Expected a Number for 'out' but got 'Content-type: text/html /usr/local/etc/mrtg/lr_128.php: cannot open ?php: No such file or directory 2009-09-26 19:07:25: WARNING: Could not get any data from external command '/usr/local/etc/mrtg/lr_128.php' Maybe the external command did not even start. (No such file or directory) EACCELERATOR: Open for write failed for "/tmp/eaccelerator/0/8/eaccelerator-021.06528421": No such file or directory EACCELERATOR cached: "/usr/local/etc/mrtg/lr_live.php" 2009-09-26 19:07:25: WARNING: Problem with External get '/usr/local/etc/mrtg/lr_live.php': ' Expected a Number for 'out' but got 'Content-type: text/html
2009-09-26 19:07:27: ERROR: Target[all][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[hr_192][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[hr_128][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_128][_IN_] ' $target->[3]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_128][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data 2009-09-26 19:07:27: ERROR: Target[lr_live][_OUT_] ' $target->[4]{$mode} ' did not eval into defined data
$he=floor(($ti-$day*24)/3600);
$he=floor(($ti-$day*86500)/3600);