Halaman

Tampilkan postingan dengan label Monitoring. Tampilkan semua postingan
Tampilkan postingan dengan label Monitoring. Tampilkan semua postingan

Jumat, 11 Juli 2014

Installing Nagios Core monitoring system (client and server)


The monitoring server
1. Install Nagios Core and dependancies
apt-get install nagios3 nagios-nrpe-plugin

2. Create the admin user
htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin

3. Create a host to monitor (pico /etc/nagios3/conf.d/server1.cfg)
define host {
use generic-host
host_name server1
alias server1
address 192.168.1.3
}
define service {
use generic-service
host_name server1
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service {
use generic-service
host_name server1
service_description Current Users
check_command check_users!20!50
}
define service {
use generic-service
host_name server1
service_description Total Processes
check_command check_procs!250!400
}
define service {
use generic-service
host_name server1
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}

Replace server1 with the actual hostname of the server being monitored and the IP address to correct one.
This configuration will allow you to monitor the disk usage, active users, number of processes and the cpu load of a single server. Configuring host groups and other services are outside the scope of this article.
4. Restart Nagios
/etc/init.d/nagios3 restart

4. Enter the webadmin by opening this location in a web browser: http://yourserver/nagios3
Clients monitored by the monitoring server
1. Install the Nagios NRPE (Nagios Remote Plugin Executor)
apt-get install nagios-nrpe-server

2. Allow the monitoring server to connect to this NRPE (pico /etc/nagios/nrpe.cfg)
allowed_hosts=192.168.1.2

Replace 192.168.1.2 with the IP address of the monitoring server.
NRPE listens for connections on TCP port 5666 so make sure your firewall allows connections to that port from the monitoring server.
3. Restart NRPE
/etc/init.d/nagios-nrpe-server restart

Source : http://www.debiantutorials.com/installing-nagios-core-monitoring-system-client-and-server/

Jumat, 21 Maret 2014

How to set up Munin Server Monitoring

Munin is an excellent tool for monitoring the status of your server. Munin highlighted it's usefulness to us when trying to diagnose a recent problem with one of our servers.

There are two components to Munin, Munin Server and Munin Node. The Munin Server stores all of the data and presents it for viewing as a web page as well as keeping a track of which nodes are being monitored. The Munin Node runs as a service on the server that is being monitored, collects all of the required data and sends it back to the server.

In this article I am going to assume that we are running 2 servers, both Ubuntu 12.04.

Munin Server - munin-server.example.com
Munin Node - munin-node.example.com
Setting up Munin Server (munin-server.example.com)

First of all you will need to be running Apache so that the results pages can be viewed. All commands in the article should be run as the root user.

apt-get install apache2

Now we can install the munin server:

apt-get install munin

Now we need to configure apache to serve up the reports. You can add these directives to your global apache config file found at /etc/apache2/apache2.conf or if you only want munin to be accessible on a single virtual host you can add these directives to that single virtual host config. We will also configure the reports to be protected from public reading using basic HTTP Authentication.

Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
       Order allow,deny
       Allow from all
       Options None
       AllowOverride None

       AuthUserFile /etc/munin/munin-htpasswd
       AuthName "Munin"
       AuthType Basic
       require valid-user

       <ifmodule mod_expires.c="">
               ExpiresActive On
               ExpiresDefault M310
      </ifmodule>
</Directory>

The Expires rules are set to make sure that your browser doesn't cache any of the images that are generated so that you are always viewing up to date data.

Finally we need to create a user (munin) to view the Munin reports pages with:

htpasswd -c /etc/munin/munin-htpasswd munin

After you are prompted to enter your password then restart apache and the server is configured.

service apache2 restart

You can access the stats by going to http://munin-server.example.com/munin but first we need to set up a node so that we actually have some statistics to view.

Setting up Munin Node

First we need to make the Munin Server aware of the node so add the following to /etc/munin/munin.conf on the Munin Server

[munin-node.example.com]
    address munin-node.example.com
    use_node_name yes

You can add as many of these entries as you like for each server you wish to monitor.

No we need to install Munin Node on the server we wish to monitor. The following configuration is all done on the Munin Node server.

apt-get install munin-node

Then we must allow the server to connect and get results so add the following line to /etc/munin/munin-node.conf

allow ^123\.123\.123\.123$

Where the IP address of the Munin Server is 123.123.123.123. You will also need to make sure that your firewall is also permitting connections from the server on port 4949.

Now restart the node and after a few minutes you should start to see your stats appearing on the server report pages.

service munin-node restart

Reference : http://superrb.com/blog/2013/08/01/how-to-set-up-munin-server-monitoring-on-ubuntu

Rabu, 19 Februari 2014

Install Observium

Installation

Compatability

This guide works with Ubuntu 12.04, 13.04 and Debian 7.

Ubuntu 13.10

The new release of Saucy Salamander from Ubuntu has changed enough things that following the installation guide below will not leave you with a working installation. We currently recommend installing using 13.04.
Install the packages we need to run Observium:
apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt php5-json \
subversion mysql-server mysql-client rrdtool fping imagemagick whois mtr-tiny nmap ipmitool python-mysqldb
If you want to be able to monitor libvirt virtual machines, install libvirt-bin (beware: this pulls in a whole bunch of dependencies you otherwise probably wouldn't need on your server):
apt-get install libvirt-bin
Create a directory for Observium to live in:
mkdir -p /opt/observium && cd /opt

Downloading

Observium Editions

Observium comes in two editions, an Community/Open Source edition, and a Subscription edition with additional features, rapid feature/fix release cycle and easy to use SVN-based release mechanism.

Observium Open Source Edition

If you would like to try out Observium using the Community/Open Source Edition, please install using the most recent .tar.gz release.
Download the latest .tar.gz of Observium and unpack:
 wget http://www.observium.org/observium-community-latest.tar.gz
 tar zxvf observium-community-latest.tar.gz

Observium Subscription

If you have a valid Observium [subscription], please use one of the automated SVN release repositories.
For the CURRENT revision:
svn co http://svn.observium.org/svn/observium/trunk observium
For the STABLE revision:
svn co http://svn.observium.org/svn/observium/branches/stable observium

Configuration

Change into the new install directory:
cd observium

Important!

Please read all the documentation before continuing. This includes the FAQ page.
If you're not satisfied with what you find, do not continue installation. "Clever tricks" that "fix" what is "broken" are not supported.
Copy the default configuration file and edit it for your system:
cp config.php.default config.php

MySQL Authentication

You must change the MySQL username and password. Most other settings can be left as default.
Create the MySQL database:
mysql -u root -p
<mysql root password>
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost'
    -> IDENTIFIED BY '<observium db password>';
Edit config.php. Change the options to reflect your installation.
Setup the MySQL database and insert the default schema:
php includes/update/update.php
It is OK to have some errors in the SQL revisions up to 006.
Create the directory to store RRDs in:
mkdir rrd
chown www-data:www-data rrd
If the server will be running *only* Observium, change /etc/apache2/sites-available/default to :
<VirtualHost *:80>
       ServerAdmin webmaster@localhost
       DocumentRoot /opt/observium/html
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       </Directory>
       <Directory /opt/observium/html/>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       </Directory>
       ErrorLog  ${APACHE_LOG_DIR}/error.log
       LogLevel warn
       CustomLog  ${APACHE_LOG_DIR}/access.log combined
       ServerSignature On
</VirtualHost>
Alternatively you can create a vhost just for Observium (see the bottom of the page)
Enable mod_rewrite for Observium's cleaner URLs:
a2enmod rewrite
apache2ctl restart
Add a first user, use level of 10 for admin:
cd /opt/observium
./adduser.php <username> <password> <level>
Add a first device to monitor:
./add_device.php <hostname> <community> v2c
Do an initial discovery and polling run to populate the data for the new device:
./discovery.php -h all
./poller.php -h all
Add cron jobs, create a new file /etc/cron.d/observium with the following contents:

Important!

Please note that the below example includes a username, so will only work in /etc/crontab or /etc/cron.d/observium. It will NOT work in a user crontab edited with crontab -e.
33  */6   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 *     * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1
*/5 *     * * *   root    /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
service cron reload
Please note running only a single poller instance is good for initial testing, but do check the Performance tuning page for further performance enhancing options once you get going.
You should now be able to see <server ip>

Source : http://www.observium.org/wiki/Debian_Ubuntu_Installation