You are not logged in.

#1 2006-12-13 19:53:14

osigen
Member
From: cynic tub
Registered: 2005-06-18
Posts: 36
Website

System log viewer

Hi folks,

I have change/transform an old shell script for archlinux :-)
I consider anyone newbie find it useful...

Here is a screen shot
logview.png
and the Download link

#! /bin/sh
# Archlinux and other minor changes Dec 13, 2006 
# by Constantinos Laitsas
# dl: http://laitsas.com/download/logview.txt
# logview by Luke Th. Bullock 1997
# Minor changes Wed Feb 11 02:33:29 GMT+1 1998
# added f_logview function Tue Apr  4 15:47:06 MEST 2000
# Removed some sections, added others due to system changes.
#
f_logview() {
dialog --backtitle "User: `whoami` | Kernel: `uname -mnspr`" 
--title "System Log Viewer" 
--menu "Make your selection:" 19 45 12 
"WWW" "Web traffic log" 
"Error" "Web Error Log" 
"Mail" "Mail log" 
"Last" "Last 50 connections" 
"Messages" "System Message log" 
"Syslog" "System Log" 
"Pacman" "Pacman log" 
"Kernel" "Kernel Log" 
"PostgreSQL" "PostgreSQL log file" 
"MySQL" "MySQL log file" 
"Xorg" "Xorg log file" 
"Exit" "Exit Viewer" 
2> ~/.syslogs
if [ $? = 1 -o $? = 255 ]; then
echo "Exit" > ~/.syslogs
fi 
LOG="`cat ~/.syslogs`"
TMP="/tmp/.tmpfile"
if [ "$LOG" = "Exit" ]; then
 reset
 exit
fi 
if [ "$LOG" = "WWW" ]; then
 VIEW="/var/log/httpd/access_log"
fi
if [ "$LOG" = "Error" ]; then
 VIEW="/var/log/httpd/error_log"
fi 
if [ "$LOG" = "Mail" ]; then
 VIEW="/var/log/mail.log"
fi
if [ "$LOG" = "Last" ]; then
 last -50 > $TMP
 VIEW="$TMP"
fi
if [ "$LOG" = "Messages" ]; then
 VIEW="/var/log/messages.log"
fi
if [ "$LOG" = "Syslog" ]; then
 VIEW="/var/log/syslog.log"
fi
if [ "$LOG" = "Pacman" ]; then
 VIEW="/var/log/pacman.log"
fi 
if [ "$LOG" = "Kernel" ]; then
 VIEW="/var/log/kernel.log"
fi
if [ "$LOG" = "PostgreSQL" ]; then
  VIEW="/var/log/postgresql.log"
fi  
if [ "$LOG" = "MySQL" ]; then
  VIEW="/var/log/mysqld.log"
fi 
if [ "$LOG" = "Xorg" ]; then
  VIEW="/var/log/Xorg.0.log"
fi 
dialog --title "Viewing file: $VIEW" 
--textbox $VIEW 25 80
if [ -f $TMP ]; then
 rm $TMP
fi 
f_logview
}
f_logview
# End

"What we cannot speak about we must pass over in silence" L. Wittgenstein

Offline

#2 2006-12-15 04:19:41

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: System log viewer

looks pretty nice, but I still prefer

vi /var/log/Xorg.0.log

But thats just me. wink


"Oh, they have the internet on computers now."

Offline

Board footer

Powered by FluxBB