(RADIATOR) View radius log tail in browser

MJ php at cyberia.net.sa
Tue Sep 21 05:37:16 CDT 2004


Hi,

I want to share following cgi with all list members. I found this on internet and customized as per my requirements. Use this to view your radiator logs in the browser, it will help in troubleshooting, specially for helpdesk staff. You need to have a webserver on the local machine. Try, it is very useful.

Thanks,
Mohammad Junaid
Cyberia, Saudi Arabia

========== radlog.cgi=======================
#!/usr/local/bin/perl
# radlog.cgi:  Uses html's meta tag to view changes to
# /radius/log/logfile
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime();
$mon++;
$yy = `date '+20%y'`;
$latestrun = "$hour:$min:$sec  $mon/$mday/$yy";

$logfile =`date '+/radius/log/logfile-20%y-%m-%d'`;

$errors= `tail -25 $logfile`;

print <<EOT;
Content-type: text/html

<html><head>
<meta http-equiv="refresh" Content="10,url=radlog.cgi">
<title> Radius Log Tail</title></head>
<body >
<center><h2>Radius Log Tail</h2>
<h3>Updated at: <font color="#880000">$latestrun</font></h3>
</center>

<xmp>

$errors
</xmp>
</body></html>
EOT
========================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20040921/e67bed6e/attachment.html>


More information about the radiator mailing list