Syslog: Sending log from remote servers to syslog daemon

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: 304107 | 8 Comments »

Top Ten Processes Watcher

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: 162870 | 7 Comments »

Obtain some system statistics from vmstat

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, […]

Posted in Admin, date, tail, vmstat | Hits: 121643 | 12 Comments »

head and tail

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, […]

Posted in head, tail, Text Manipulation | Hits: 167024 | 11 Comments »

I am watching you

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 […]

Posted in Network, tail, watch | Hits: 53071 | 3 Comments »

log personal message to /var/log/messages

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 […]

Posted in Admin, backquote, logger, tail | Hits: 162817 | 29 Comments »