mcdev
asked on
View radius logfile in browser...
Hello.
I work for an ISP, and we want to give our tech support staff the ability to view failed logins thru NavisRadius over the web.
The logfile is at: /opt/Lucent/NavisRadius/ru n/navisrad ius.log
What I have done is made a page that displays the log in an inline frame. To display the log (thelog), I have made a script that runs via cron and parses the log and redirects the output to another file, which is then shown in the inline frame. Here's the script:
-------------------------- --------
tail -100r /opt/Lucent/NavisRadius/ru n/navisrad ius.log > /usr/local/apache/htdocs/t helog
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru n/navisrad ius.log > /usr/local/apache/htdocs/t helog
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru n/navisrad ius.log > /usr/local/apache/htdocs/t helog
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru n/navisrad ius.log > /usr/local/apache/htdocs/t helog
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru n/navisrad ius.log > /usr/local/apache/htdocs/t helog
sleep 10
-------------------------- --------
This is SUPPOSED to put the most recent 100 lines of the log file, containing the word 'failed' into my error page.
It does everything EXCEPT, it doesn't:
*refresh the logfile properly...the data is generally about an hour behind, then catches up a few times a day, then gets behind again.
*shows WAY more than the 100 last lines I would like it to show...not really sure how to make it recreate the file 'thelog'.
Thanks for any assistance you may offer.
I work for an ISP, and we want to give our tech support staff the ability to view failed logins thru NavisRadius over the web.
The logfile is at: /opt/Lucent/NavisRadius/ru
What I have done is made a page that displays the log in an inline frame. To display the log (thelog), I have made a script that runs via cron and parses the log and redirects the output to another file, which is then shown in the inline frame. Here's the script:
--------------------------
tail -100r /opt/Lucent/NavisRadius/ru
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru
sleep 10
tail -100r /opt/Lucent/NavisRadius/ru
sleep 10
--------------------------
This is SUPPOSED to put the most recent 100 lines of the log file, containing the word 'failed' into my error page.
It does everything EXCEPT, it doesn't:
*refresh the logfile properly...the data is generally about an hour behind, then catches up a few times a day, then gets behind again.
*shows WAY more than the 100 last lines I would like it to show...not really sure how to make it recreate the file 'thelog'.
Thanks for any assistance you may offer.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ No refund
Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
liddler
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ No refund
Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
liddler
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another, more complex, approach would be to write a Perl or C program that implements a named pipe that can be the target of the Radius log function. The code would keep a FIFO of the last 100 failed logins and write that to your "web page' each time the FIFO changes content. It would also write all log messages to the real log file. Since the log is important, you'd have to be very careful to get that application "right" and if written in Perl you should probably stop and restart the code at least once a day to guard against memory leaks or other problems.