|
-
December 20th, 2003, 10:39 PM
#1
Member
Remote Admin Via command line
Howdy
I am working for a company where i do a lot of Remote Administration via command line. I have to sift through logs and logs and logs. We currently telnet 'ing into the remote servers and workstations using telnet clients. I am using CRT and PUTTY but i was wondering if someone could recommend something else where i could set up rules so that when i CAT or TAIL txt files the output would be displayed in different colors. Example just say i cat a txt file and i want the output of all the LINES with "ERROR" in them to be displayed in just say the color the RED and the rest in white. Any ideas of a program with maybe some capablities like this. Thanks Guys. Im usually running XP Pro and Winnt and 2000.
Thanks Again.
-
December 20th, 2003, 10:44 PM
#2
I don't know if what you are trying to do is possible but you could script some stuff to extract only the stuff you want using LineStrip. It's a great little tool and the author was great about adding command line switches when I asked him to.
Don\'t SYN us.... We\'ll SYN you.....
\"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides
-
December 20th, 2003, 11:13 PM
#3
A *nix utility like "grep" would do the same thing, and if you are at all familiar with regular expressions it would easy to get used to. For a windows port check out: http://www.interlog.com/~tcharron/grep.html
-
December 20th, 2003, 11:36 PM
#4
Member
Yah i have the Resoucre Kit installed so i have GREP and most of the Unix commands.
But i guess i was trying to make a life a bit more easier, to color code the lines, so the output would be a bit more clear.
Grep is excellent there is much you can do with it. Currently if im using grep i run this command to lets say find the work error in the file eventlog.log
grep -i error -A 5 -B 5 eventlog.log
-
December 21st, 2003, 12:22 AM
#5
I'm not trying to argue anything, but if you can grep out the error lines then why do you need to colour them? Or do you want to color the errors red, the warnings yellow, ...? What I'm asking is, is there some special reason you would like to colour the lines in the original file?
\"When you say best friends, it means friends forever\" Brand New
\"Best friends means I pulled the trigger
Best friends means you get what you deserve\" Taking Back Sunday
Visit alastairgrant.ca
-
December 21st, 2003, 07:22 PM
#6
Junior Member
A very good tool under Windows is TERATERM. It has many usefull components, easy to customize.
Try it for remote administrating.
-
December 22nd, 2003, 12:23 PM
#7
Re: Remote Admin Via command line
Yah i have the Resoucre Kit installed so i have GREP and most of the Unix commands.
But i guess i was trying to make a life a bit more easier, to color code the lines, so the output would be a bit more clear.
Grep is excellent there is much you can do with it. Currently if im using grep i run this command to lets say find the work error in the file eventlog.log
grep -i error -A 5 -B 5 eventlog.log
First of all, avoid telnet if possible and use ssh instead. Using the right tool, anybody can sniff your telnet connection and see sensitive data across the network.
Back to the question. Now that you have most of Unix commands, I'll assume you have bash, cat, awk and printf. If you don't, download and install cygwin. I think awk is more suitable for this job than grep. And you need a (telnet/ssh) client that can interpret ANSI color codes.
Download cygwin:
http://www.cygwin.com/
ANSI color codes table:
http://pueblo.sourceforge.net/doc/ma...lor_codes.html
Create a script similar to this one on the remote server/workstation (don't forget the single quote at the bottom, it closes the awk script):
Code:
# a shell script to color code the lines in a log file
cat $1 | awk '
/INFO/ { printf "\x1B[37m%s\x1B[37m\n", $0 }
/WARNING/ { printf "\x1B[33m%s\x1B[37m\n", $0 }
/ERROR/ { printf "\x1B[31m%s\x1B[37m\n", $0 }
'
Let's say you name this script colorize.sh . To use it just type:
colorize.sh something.log
The lines in something.log will be displayed in
white if it contains the string INFO
yellow if it contains the string WARNING
red if it contains the string ERROR
Such a big effort for a simple task, do you think? Yeah me too... 
Why don't you import the log files into Excel and make a color coding rule in the sheet?
Peace always,
<jdenny>
Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds
-
December 22nd, 2003, 01:19 PM
#8
well my advice would probably be more hastle than the other's but I have used this efficient firewall called Firewall One aka Firewall 1. it preety much does what u want and more. u can set it up on a gateway and it will preety much log in diff colors and even icons.
-
December 22nd, 2003, 01:48 PM
#9
s0nic: I think setting up a Checkpoint FW/1 is a bit overkill for what Condoor wants (not to mention really expensive).
Oliver's Law:
Experience is something you don't get until just after you need it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|