Archive

Archive for the ‘Monitoring’ Category

Monitor your Blog / Web

December 11th, 2009 Dhaval Thakar No comments

We all have utilities like Nagios & Nconf when it comes to monitor data center. But what about your own site / blog.
Many professional blogger do monitor their blogs to improve performance. Parttime blogger like me hardly bother.
I use my office nagios to monitor by My Blog to keep eye on downtime. But I needed some indepth details for the page load time, dns respose etc.
While searching on this I found http://basicstate.com/
I started monitoring this blog on http://basicstate.com/.

Followings are the web statistics

Here you get info on daily uptime.

basicstate1

This is what I was looking for, this gives you all the technical details.

basicstate1

basicstate1

http://basicstate.com/ is the free service & it can provide you email alerts with checking interval of 15 minutes. So what http://basicstate.com/ gets from free service? They have http://exactstate.com/

On 3rd December 2009 I decided to move my blog to another hosting service, as the older was not anymore suitable with increasing load.

With my new hosting service I do not face any downtime / performance related issue (please comment if you face any performance issue).

Google Buzz

Squid Realtime Logs -Sqstat

August 21st, 2009 Dhaval Thakar No comments

I am using Linux as Internet Gateway.

Using Squid I have controlled Internet access for all my users. I prefer to use Sarg for for daily bases reporting. For Realtime monitoring tail is preferable but if you want to delegate proxy monitoring to Windows Admin Sqstat is best.

SqStat is a script which allows to look through active squid users connections. It use cachemgr protocol to get information from squid proxy server.

Sample

Refer for installation & configuration details.

Google Buzz

Install & Configure Cacti

July 4th, 2009 Dhaval Thakar 2 comments

cacti

cacti-sample

Installation

Download Cacti from http://www.cacti.net/

Extract cacti source package

tar zxvf cacti-0.8.7e.tar.gz

Move Cacti to html folder

mv cacti-0.8.7e /var/www/html/cacti

cd /var/www/html/cacti

create database

mysqladmin –user=root create cacti
mysql cacti < cacti.sql

mysql –user=root mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactipasswd’;

Enter following line in crontab to gather data

*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1

Update your db user & passwd in /var/www/html/include/config.php

Now you can follow web based cacti installation using following link

http://serverip/cacti/install/

on third page make sure PATH for all required packages are correct.

Using http://serverip/cacti/ you can start cacti
Default username & passwd is admin

Configuration

To monitor new host.
Click on New Graphs (from left panel)
Click on Create New Hosts
Enter Description, Hostname / IP address
Choose appropreate template.
Select ping type & snmp version

To create graph, click on Create Graphs for this Host

To change default SNMP Community
Click on Settings, modify SNMP Version & SNMP Community

To modify host templates
Click on Host Templates. Select desired template, modify & save. Now onwards during creation of New Device, you need not required to change template settings.

Graph Trees
Once you add all devices & start monitoring, you might need organized structure to view graphs.
At the left panel, there is option for Graph Trees, here you can create group of devices e.g Cisco, Linux, Windows, DB..

Create new Graph Tree & add device.
Click on Graph Trees–> Add –> Enter name & select sorting type –>Save.
To add device, Select appropriate Graph Tree –> Add –> Select host in Tree Item Type.

Google Buzz

Learning Nagios 3.0 -Review

April 28th, 2009 Dhaval Thakar No comments

This is Book Review for Learning Nagios 3.0

book-nagios3

This book is nice guide to setup Nagios in efficient manner,
this book covers followings
Nagios Installation
Configuring Hosts
Configuring Services
Configuring Commands
Configuring Time Periods
Configuring Contacts

Read More

Google Buzz

Nagios Installation

April 19th, 2009 Dhaval Thakar No comments

This post will cover step by step Nagios installation.
In current world everything is available online, every organization is trying to reduce their downtime. Almost all Data Centers are running hundreds of services. It is not possible for human being to monitor all services, this is where Nagios is useful. Administrator can use Nagios to monitor all hosts, services, network devices.

Nagios can be configured to check critical services on different time intervals. And can be used to send Email alerts to system admins.

Here I will cover installation, host & service configuration, service details,

Installation:
Download Nagios & Nagios-plugins from http://www.nagios.org/download/
assuming you have stored source packages in /downloads/

(I prefer to use /tmp/ for package installation)

cd /tmp
tar zxvf /downloads/nagios-3.0.6.tar.gz

cd nagios-3.0.6/
./configure
make all

useradd nagios

# need to add nagios user

make install

# – This installs the main program, CGIs, and HTML files

make install-init

# – This installs the init script in /etc/rc.d/init.d

make install-commandmode

#- This installs and configures permissions on the
# directory for holding the external command file

make install-config

# – This installs *SAMPLE* config files in /usr/local/nagios/etc
# You’ll have to modify these sample files before you can
# use Nagios. Read the HTML documentation for more info
# on doing this. Pay particular attention to the docs on
# object configuration files, as they determine what/how
# things get monitored!

make install-webconf

#- This installs the Apache config file for the Nagios
# web interface

service nagios restart
service httpd restart

# for Nagios web authentication.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

This was all required to start Nagios server.
Now will install nagios-plugins

cd /tmp
tar zxvf /downloads/nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13/
./configure –libexecdir=/usr/local/nagios/libexec/
make all
make install

This was all required to start Nagios server with limited available plugins.
By default during installation localhost is configured with few services.

You can access Nagios using http://nagios_server_ip/nagios (it will prompt you for authentication, use nagiosadmin as user & password you entered while creating htpasswd.users).
Nagios panel will display only localhost, if you can see status of localhost you can continue adding hosts & services.

To add more hosts.
I recommend to create separate host files in /usr/local/nagios/etc/objects/ e.g linux.cfg, windows.cfg, router.cfg etc. If you are planning to put all your services to monitor, you can segregate configuration files as per requirement. It helps to easily search & modify configuration whenever required.

You need to mention created .cfg files in /usr/local/nagios/etc/nagios.conf e.g cfg_file=/usr/local/nagios/etc/objects/linux.cfg This will guide Nagios to load manually created configuration files.

cd /usr/local/nagios/etc/objects
Followings is the contains of sample linux.cfg file.

#Linux
define host{
use generic-host ; Name of host template to use
host_name Linux
alias Linux
address 192.168.1.12
check_command check-host-alive
max_check_attempts 10
check_period 24×7
notification_interval 120
notification_period 24×7
notification_options d,r
contact_groups admins
}

#ping
define service{
use generic-service ; Name of service template to use
host_name Linux
service_description PING
is_volatile 0
check_period 24×7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24×7
check_command check_ping!100.0,20%!500.0,60%
}

#http
define service{
use generic-service ; Name of service template to use
host_name Linux
service_description HTTP
is_volatile 0
check_period 24×7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24×7
check_command check_http
}
#smtp
define service{
use generic-service ; Name of service template to use
host_name Linux
service_description SMTP
is_volatile 0
check_period 24×7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24×7
check_command check_smtp
}

/usr/local/nagios/bin/nagios -v ../nagios.cfg (to check nagios configuration)
service nagios reload

Click for service related details. Refer to section Service Definition
I have added Linux host in hostgroup available in localhost.cfg
Recommended way is to create separate groups.cfg.

Now you should be able to see Linux (host) on nagios panel.

To add more timeperiods & contacts you can refer to default config of timeperiods.cfg &

contacts.cfg respectively.

Google Buzz