Live Chat!

Syslog: Sending log from remote servers to syslog daemon

2 votos Vota!!

July 23rd, 2008 mysurface

syslog is a standard for logging service in Linux, it usually run as daemon like syslogd or rsyslogd. Syslog daemon will be forward and store logs in /var/log directory, you may configure it to store at separate location if you want. (we will look into it later). And there is a major file that store [...]

Posted in Admin, logger, nc, rsyslogd, syslogd, tail | Hits: 99376 | No Comments »

Top Ten Processes Watcher

1 votos Vota!!

July 13th, 2008 mysurface

top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top [...]

Posted in head, tail, top, watch | Hits: 82170 | 1 Comment »

Obtain some system statistics from vmstat

1 votos Vota!!

December 8th, 2007 mysurface

vmstat know as virtual memory statistics reporter, but it gives more information the just only virtual memory.
Besides memory, it covers overall CPU usage, IO, Swap, Proc, System interupts and context switching. vmstat is pretty easy to use, ignores all other options, the normal usage will be looks like this:
vmstat [delay] [counts]
Let say, you want to [...]

Posted in Admin, date, tail, vmstat | Hits: 55234 | 4 Comments »

head and tail

1 votos Vota!!

November 1st, 2006 toydi

Given a list of text lines in a file, to display the first 10 lines:
head foo.txt
To display the last 10 lines:
tail foo.txt
Try -n option to specify the number of lines to display:
tail -n3 foo.txt # the last 3 lines
head -n4 foo.txt # the first 4 lines
And don’t forget, the ‘+’ in tail [...]

Posted in Text Manipulation, head, tail | Hits: 23990 | 4 Comments »

I am watching you

2 votos Vota!!

August 15th, 2006 mysurface

To repeatly watching a certain file, such as log files, you can do that:
watch tail /var/log/messages
By default, this will be refresh every 2 seconds, and tail with list last 10 entries by default too. If you want to have specific refresh rate, you can do so:
watch -n 5 tail /var/log/messages
This will change the refresh rate [...]

Posted in Network, tail, watch | Hits: 17433 | 2 Comments »

log personal message to /var/log/messages

1 votos Vota!!

August 14th, 2006 mysurface

To log personal messages to /var/log/messages when you write script, you can use logger
simple example:
logger i am testing
And check the result with tail, it display last 10 line of messages by default
tail /var/log/messages
To put more info to log file, you can specified the timestamp with scriptname by this
logger -t `basename $0` i am still testing
basename [...]

Posted in Admin, backquote, logger, tail | Hits: 26298 | 3 Comments »