- 1. 概要
- 2. 状況
- 3. 対処
- 4. 参考サイト
1. 概要
「mailgraph」をインストールしておったですが。
なんか、気づいたら、なくなっておる。
記憶がないけど、アンインストールしたんだろうな・・・。
それはいいとして。
2. 状況
再インストールしたですよ。
インストール手順については、本章のひとつ上のカテゴリをご参照ください。
で、インストール後に、その画面を久々に見てみましたらば・・・。
なんじゃこりゃ?
調べると。
tail -f /var/log/www/error.log
[Wed Aug 05 16:39:28.401460 2026] [cgid:error] [pid 50535:tid 34368958480] [client 125.56.15.239:63547] End of script output before headers: mailgraph.cgi, referer: https://www.sing.ne.jp/mailgraph/
ERROR: Unused Arguments "39:28 2026]\r" in command : COMMENT:[Wed Aug 5 16:39:28 2026]\r
[Wed Aug 05 16:39:28.419819 2026] [cgid:error] [pid 50535:tid 34368917520] [client 125.56.15.239:62616] End of script output before headers: mailgraph.cgi, referer: https://www.sing.ne.jp/mailgraph/
なんか、エラーになっちょるです。
3. 対処
なんか、「perl」の文法エラーですね。
「root」ユーザ権限で。
vi /usr/local/www/mailgraph/mailgraph.cgi
#!/usr/local/bin/perl -w
# mailgraph -- postfix mail traffic statistics
# copyright (c) 2000-2007 ETH Zurich
# copyright (c) 2000-2007 David Schweikert <david@schweikert.ch>
# released under the GNU General Public License
use RRDs;
use POSIX qw(uname);
my $VERSION = "1.14";
my $host = (POSIX::uname())[1];
my $scriptname = 'mailgraph.cgi';
my $xpoints = 540;
my $points_per_sample = 3;
my $ypoints = 160;
my $ypoints_err = 96;
my $rrd = '/var/db/mailgraph/mailgraph.rrd'; # path to where the RRD database is
my $rrd_virus = '/var/db/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
21行の後ろに下記を追加します。
my $now_str = scalar(localtime());
$now_str =~ s/:/\\:/g;
次に。
'COMMENT:['.$date.']\r',
を下記へ変更します。
"COMMENT:[$now_str]\\c",
「ReadOnly」になっているので、コマンドモードで、「w!」で書き込みます。
すると、うまく表示されるようになります。
しかし、これだけじゃ、「daily security run output」で警告されますので、本来なんかもうひと工夫必要ですね。
4. 参考サイト
本ページは、「Gemini」伍長を参考にさせていただきました。
|
|