Sunday, 8 August 2010

Lightweight Monitoring Tool for Servers and Embedded System - Monitorix

Monitorix is a free, open source, lightweight system monitoring tool designed to monitorize as many services as possible. At this time it monitors from the CPU load and temperatures to the users using the system. Network devices activity, network services demand and even the devices' interrupt activity are also monitored, and more.

The current status of any corporate server with Monitorix installed can be accessed via a web browser.
Monitorix has been designed to be used under production UNIX/Linux servers, but due its simplicity and small size you may also use it to monitor embedded devices.

Installation:
Monitorix is under GPLv2 licensing and available for download on the project homepage as source code and in numerous packages. Rpm based system (RedHat / Fedora / Centos / Opensuse) can install Monitorix using command:
rpm -ivh monitorix-1.4.2-1.noarch.rpm
Configuration of Monitorix:
Before starting the monitorix daemon, be sure to adjust the /etc/monitorix.conf to your liking. For a complete list of options and features, see the man page for monitor.conf.

our $TITLE = "Linux Poison";                                 # your company name
our $HOSTNAME = "poison.hell.com"; # hostname of this server
our $OSTYPE = "Linux-SuSE";                 # choose your OS type (see below)
our $SAMBAVER = "3";                         # Samba version (2 or 3)
our $MULTIHOST = "N";                 # Enable multihost feature
our $MULTIHOST_FOOTER = "Y";         # (multihost) display URL in image
our $MULTIHOST_IMGPERLINE = "2";         # (multihost) # of images per line
our $REPORT_LANG = "en";                         # Report language
our $THEME_COLOR = "black";                 # Default is "black", none is "white"
our $REFRESH_RATE = "150";                 # Web stats' refresh rate in seconds
our $ENABLE_CROND_MAIL = "Y";         # Error messages are sent by crond

Common settings to tweak here include company name, hostname, and theme color.
Finally you'll be able to start Monitorix with: # service monitorix start

To view your system stats, make sure your webserver is running and browse to [http://localhost/monitorix] to see the data.

Thursday, 5 August 2010

Sending Mail through command line on Linux

Read mail or send mail to other users. The mail utility allows you to compose, send, receive, forward, and reply to mail. mail has two main modes: compose mode, in which you create a message, and command mode, in which you manage your mail.

While mail is a powerful utility, it can be tricky for a novice user. It is most commonly seen nowadays in scripts. Most Linux distributions include several utilities that are richer in features and much easier to use: mailers built into browsers such as Mozilla and Firefox, graphical mail programs distributed with GNOME (Evolution) and KDE (Kmail), and the terminal-based, full-screen utilities pine and elm. The GNU Emacs editor can also send and receive mail.

Below is the mail command through with you can send mail to any given user ...

mail -s "System Log" nikesh@domain.com

This command sends a message to the user nikesh, with a subject line of "System Log" and the text of the message read from the system logfile /var/log/messages.

Below are few other command line option that you can use with the mail command ...

-s    Specify subject on command line.
-c    Send carbon copies to list of users.
-b    Send blind carbon copies to list. List should be a comma-separated list of names.
-f    Read in the contents of your mbox for processing; when you quit, mail writes undeleted messages back to this file.
-i    Ignore tty interrupt signals. This is particularly useful when using mail on noisy phone lines.

Wednesday, 4 August 2010

Linux Filesystem Benchmark using Blogbench

Blogbench is a portable filesystem benchmark that tries to reproduce the load of a real-world busy file server. It stresses the filesystem with multiple threads performing random reads, writes, and rewrites in order to get a realistic idea of the scalability and the concurrency a system can handle.

It stresses the filesystem with multiple threads performing random reads, writes and rewrites in order to get a realistic idea of the scalability and the concurrency a system can handle.

Installation:
Download blogbench from here and type the following command to compile and install blogbench

# tar xvzf blogbench-1.1.tar.gz
# cd blogbench-1.1
# ./configure
# make
# make install

Using Blogbench:
The minimal way to run the test is to just give the path to an *empty* and writable directory:
# blogbench -d /path/to/the/directory
Blogbench will start the required threads and the test will run during 5 minutes. A final "score" will then be given as an indication of read and write performance.

Tuesday, 3 August 2010

Top like utility to monitor Network - sntop

Simple network top (sntop) is a curses-based console utility in the spirit of top that polls network hosts at a regular interval to determine their connectivity and displays the results in a pretty format. Advanced features are supported, such as automatic HTML generation of results, secure terminal mode, execution of an external file on connectivity changes, a daemon mode, and user/system configure files.

sntop uses fping (ping is supported, too) to determine connectivity of hosts, specified in a config file, on a regular interval. the results are displayed in a top-like format.

Installation and Configuration:
Download sntop from here and type the following command to install sntop

# tar xvzf sntop-x.y.z.tar.gz
# cd sntop-x.y.z
# ./configure
# make
# make install

you should now edit the system conf file (or remove it), which is by default in /etc:
$ vi /etc/sntoprc

Each user can use their own config file, look at the man pages to figure out how to add servers to the configuration file.
$ cp /etc/sntoprc ~/.sntoprc
$ vi ~/.sntoprc

sntop is placed in /usr/local/bin by default

 
//PART 2