in reply to Syslog conversion to HTML
And create a link on your webpage to point to the following location: http://your.website.com/cgi-bin/view_cisco_log.cgi. So that when a user clicks on the link, he/she will invoke the CGI script and see the cisco log.#!/usr/bin/perl -w use strict; use CGI; use IO::File; my $f = new IO::File "/opt/cisco/cisco.log", "r" or die; my $cgi = new CGI; print $cgi->header, "<HTML><TITLE>CISCO LOG</TITLE><BODY><PRE>"; while (defined (my $line = <$f>)) { $line =~ s/&/&/g; $line =~ s/</</g; $line =~ s/>/>/g; print $line } print "</PRE></BODY></HTML>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Syslog conversion to HTML
by parkprimus (Sexton) on Jan 23, 2004 at 14:46 UTC |