Tuesday, September 29, 2009

Install Nagios with Centreon on Debian

Introduction
About Nagios (http://www.nagios.org)
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external "plugins" which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.
About Centreon (http://www.centreon.com)
Centreon is a network, system, applicative supervision and monitoring tool, it is based upon the most effective Open Source monitoring engine: Nagios. Centreon provides a new frontend and new functionalities to Nagios.
Prerequisites that not covered in this guide:
You will need some knowledge of basic Linux administration, in case you will need to do troubleshooting
You will need to be familiar with Nagios architecture, and know how to solve errors that come from nagios config validation
You will need an MTA daemon installed & configured, so nagios will able to send notifications, good examples are sendmail, postfix, exim.
Before we begin
All commands in this guide must be run as root user, in Ubuntu you can become a root user by using command "sudo -s".
This guide is indented for Debian/Ubuntu based distributions. It was tested on Debian 4.0r2, and Ubuntu 7.10 Server/Desktop.
Warning: Centreon installer will not work on Ubuntu 8.04 LTS, the installer failing to detect Apache User/Group names. It is because those settings are defined via environment variables in apache2.conf, those variables are located in /etc/apache2/envvars.
Still, you can use the installer after replacing 2 configuration options in apache2.conf
To do it, follow those commands:
# cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.default
# sed "s/\${APACHE_RUN_USER}/www-data/g" /etc/apache2/apache2.conf.default > /etc/apache2/apache2.tmp
# sed "s/\${APACHE_RUN_GROUP}/www-data/g" /etc/apache2/apache2.tmp > /etc/apache2/apache2.conf
# rm /etc/apache2/apache2.tmp
I recommend, to restore default apache configuration after Centreon Installation is finished:
# mv /etc/apache2/apache2.conf.default /etc/apache2/apache2.conf
Install required Ubuntu/Debian packages:
Sudo for Debian
# apt-get install sudo
dos2unix, Converts DOS <-> Unix text files, alias tofromdos
# apt-get install tofrodos
Apache 2 web server
# apt-get install apache2
Nagios 2
# apt-get install nagios2 nagios-plugins nagios-images nagios-nrpe-plugin
MySQL 5 database server
# apt-get install mysql-server-5.0
PHP5 + required modules
# apt-get install php5 php5-cli php-db php-date php5-gd php5-mysql php5-snmp \
php5-ldap php-mail php-mail-mime php-net-smtp php-net-socket php5-xmlrpc
RRDTool
# apt-get install rrdtool librrds-perl
Perl "ini" files support
# apt-get install libconfig-inifiles-perl
SNMP
# apt-get install snmp snmpd libnet-snmp-perl
Open file /etc/snmp/snmpd.conf for editing.
Find:
#com2sec readonly default public
Remove "#" sign
Save & restart SNMP deamon:
# invoke-rc.d snmpd restart
Test it:
# snmpget -v1 -c public localhost sysDescr.0
Successful output will be something like:
SNMPv2-MIB::sysDescr.0 = STRING: Linux monitor01 2.6.22-14-server #1 SMP Tue Feb 12 08:27:05 UTC 2008 i686
Additional pear modules
# pear channel-update pear.php.net
# pear upgrade pear
# pear install -f -a DB_DataObject DB_DataObject_FormBuilder MDB2 Numbers_Roman \
Numbers_Words HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect \
HTML_Table Auth_SASL HTTP Image_Canvas Image_Color Image_Graph \
Image_GraphViz Net_Traceroute Net_Ping Validate XML_RPC SOAP
Install optional packages, not required
PHPMyAdmin - web based Mysql console
# apt-get install phpmyadmin
JOE - Text editor
# apt-get install joe
Install Centreon
Download latest version of Centreon, http://www.centreon.com/Download/Download.html
By the time of writing the latest version is 1.4.2.6:
# wget http://download.centreon.com/centreon/centreon-1.4.2.6.tar.gz
Uncompress the archive
# tar xzvf centreon-1.4.2.6.tar.gz
Create symbolic link for nagios2, Centreon installation requires it
# ln -s /usr/sbin/nagios2 /usr/sbin/nagios
Run installation script
# cd centreon-1.4.2.6
# bash ./install.sh
Answer questions during install script
Are you sure to continue ?
[y/n], default to [n]: y
Were is installed Nagios ?
default to [/usr/local/nagios]: /usr/lib/cgi-bin/nagios2
Were is your nagios etc directory ?
default to [/usr/lib/cgi-bin/nagios2/etc]: /etc/nagios2
Were is your nagios var directory ?
default to [/usr/lib/cgi-bin/nagios2/var]: /var/lib/nagios2
Were is your nagios plugins (libexec) directory ?
default to [/usr/lib/cgi-bin/nagios2/libexec]: /usr/lib/nagios/plugins
Were is your nagios bin directory ?
default to [/usr/lib/cgi-bin/nagios2/bin]: /usr/sbin
Were is your nagios image directory ?
default to [/usr/lib/cgi-bin/nagios2/share/images]: /usr/share/nagios/htdocs/images/logos
Where do I install centreon ?
default to [/usr/local/centreon]: /usr/local/centreon
Do you want me to create this directory [/usr/local/centreon]?[Y/n] y
Where is sudo configuration file?
default to [/etc/sudoers]: /etc/sudoers
Where is installed RRD perl modules [RRDs.pm] ?
Just put directory, not full path.
default to [/usr/local/rrdtool/lib/perl]: /usr/lib/perl5
Where is rrdtool binary ?
default to [/usr/bin/rrdtool]: /usr/bin/rrdtool
Where is mail binary ?
default to [/usr/bin/mail]: /usr/bin/mail
Where is PEAR Path ?
default to [/usr/share/pear]: /usr/share/php
Do you want to install Centreon Plugins ?
[y/n], default to [y]: y
Do you want to install Centreon Traps Plugins ?
[y/n], default to [y]: y
Where is your SNMP configuration file?
default to [/etc/snmp/]: /etc/snmp
You already seem to have installed the plugins Centreon.
Do you want overwrite this file ? You must regenerate this one from Centreon interface.
[y/n], default to [n]: y
Specify user do you use for Centreon cron
Default to [nagios]
Apply writing permissions for plugins directory:
# chmod 775 /usr/lib/nagios/plugins
Restart Mysql server
# invoke-rc.d mysql restart
Restart Apache web server
# invoke-rc.d apache2 restart
Finalize the installation with the Centreon Web interface:
open in webrowser: http:///centreon/
replace with your server ip address or hostname.
Follow Centreon Setup instructions:
- Press Start
- Check "I Accept" and press Next
- Make sure that selected "Nagios Version" is "2.x", then press Next
- On next 2 screens, make sure that all components status is "OK", then press Next
- If everything is ok, then press Next again
- Fill required DB info, then press Next
· Root Password for MySQL: [Enter your DB root password]
· Centreon Database Name: centreon
· Centreon Data Storage Database Name: centreon_ods
· Database Password: centreon
· Confirm it: centreon
· MySQL Client version (Password Haching Changes): >=4.1 - PASSWORD()
- Press Next in the screen of DataBase Verification
- Fill required Admin user info, then press next.
- Check "No" in "LDAP Authentication" screen, then press Next
- Press Next again
- Press Next in "Creating Database" screen
- Press on "Click here to complete your install"
Fix paths to meet Nagios installation on Debian based distributions:
Login to Centreon Interface
Go to: Options -> Centreon -> General Options -> Nagios
Change settings to some options, as writed below:
Init Script: /etc/init.d/nagios2
Directory + Binary: /usr/sbin/nagios2
Press Save
Go to: Configuration -> Nagios -> CGI CFG, Press on Edit Icon
Change settings to some options, as writed below:
Physical HTML Path: /usr/share/nagios2/htdocs
URL HTML Path: /nagios2
Nagios Process Check Command: /usr/lib/nagios/plugins/check_nagios /var/cache/nagios2/status.dat 5 '/usr/sbin/nagios2'
Press Save
Go to: Configuration -> Nagios -> Nagios CFG, Press on Edit Icon
Change settings to some options, as writed below:
Log File: /var/log/nagios2/nagios.log
Temp File: /var/cache/nagios2/nagios.tmp
P1 File: /usr/lib/nagios2/p1.pl
Object Cache File: /var/cache/nagios2/objects.cache
Status File: /var/cache/nagios2/status.dat
Log Archive Path: /var/log/nagios2/archives/
Downtime File: /var/lib/nagios2/downtime.dat
Comment File: /var/lib/nagios2/comment.dat
Lock File: /var/run/nagios2/nagios2.pid
State Retention File: /var/lib/nagios2/retention.dat
Performance Data Processing Option: Yes
Service Performance Data Processing Command: process-service-perfdata
Press Save
Go back to terminal console, then...
Apply permissions, so Web interface can also send External Commands
# chmod g+rx /var/lib/nagios2/rw/
Also change ownership of nagios archive logs directory
# chown nagios:adm /var/log/nagios2/archives
Enable Centreon Data Storage (ods) deamon:
# update-rc.d ods defaults
Add htaccess user for nagios CGI:
# htpasswd -bc /etc/nagios2/htpasswd.users nagiosadmin P@ssw0rd
Reboot Server
# sync;sync;init 6
Start adding Hosts, Services, Contacts, Commands, Escalations...
Open Centreon web interface and Login
Start adding hosts, services, users
Restart Nagios to apply the changes, go to: Configuration -> Nagios
Select as writed below:
- Include Comments: Yes
- Run Nagios debug (-v): Yes
- Run Optimisation test (-s): Yes
- Move Export Files: Yes
- Restart Nagios: Yes, Restart
Press Export
This will restart Nagios & apply all changes you made in Web Interface.
You will do it every time you make changes like adding/modifying: hosts, commands, contacts, services...etc...etc...

Build a Six-headed, Six-user Linux System

Introduction

Six users on one computer

A Multi-Seat Linux Box: This tutorial shows how to build a multi-head, multi-user Linux box using a recent distribution of Linux and standard USB keyboards and mice. Xorg calls this arrangement a "multi-seat" system.

Advantages of a Multi-Seat System: The advantages of multi-seat systems in schools, Internet cafes, and libraries include more than just saving money. They include much lower noise pollution, much less power consumption, and lowered space requirements. For many applications, power and noise budgets are as important as initial cost.

Requirements: To build a multi-seat system you need a video adapter, keyboard, and mouse for each seat. For six seats, you'll also need a motherboard with an AGP slot and five available PCI slots. In our test system we used USB keyboards and mice exclusively, but you can use a PS/2 keyboard and mouse for one of the seats if you wish.

Xorg 6.9 or later is required, but this already ships with many of the major distributions. Our test system uses the free version of Mandriva 2006 and we did not rebuild the kernel or install any additional packages.

Overview

We divide the implementation of a multi-seat system into five main steps:
  1. Select and Install the Hardware
  2. Install Linux
  3. Record Hardware Configuration
  4. Modify xorg.conf
  5. Modify gdm.conf
After installing the hardware and installing Linux, we read the hardware configuration from the lspci command or from the /proc/bus/input/devices file. Most of the effort in setting up a multi-seat system is in transcribing the hardware information into the xorg.conf file.

Step 1: Select and Install the Hardware

Selecting the Hardware: There are few set rules dictating what hardware to use in your multi-seat system. Of necessity, some of the keyboards and mice need to use USB, but there is no minimum CPU or memory requirements. We suggest building and testing a multi-seat system using a computer that you already have, and using the test results to help scale your hardware requirements. You may be surprised how modest the CPU and memory requirements are for a multi-seat system that is used only for web browsing.

If possible, try to use accelerated video cards, but for increased reliability, avoid video cards with on-board fans. Use recent video cards; older video cards often have a problem sharing the PCI bus. We've had good luck with nVidia cards but you can try recent cards from other manufacturers too.

Hardware for our test system: For our system we chose to use video cards based on the nVidia MX4000 chipset. They are accelerated, have no fans, and it was nice having one driver for all six video cards. The downside of nVidia is that the driver is closed source and you need to download and install it. If you use an nVidia card, be sure to check their web site for the recommended BIOS settings for your cards.

A typical PC We used an ECS 755-A2 motherboard with an AMD64-3200 processor and 1 GB of RAM. Our power supply is a CoolMax 140mm Power Supply and the CPU heat sink is a Thermaltake "Sonic Tower". During our testing we added a low noise fan to cool the video cards. Airflow is in at the bottom, past the video cards, up past the CPU cooler and out through the power supply. This airflow seemed to work pretty well. At quiescence, the CPU temperature was 31C, rising to only 38C after fifteen minutes of kernel compile. The current from the mains at quiescence was 0.25 amps, and during a kernel compile it was 0.35 amps.

You will probably need some USB hubs to connect all of the keyboards and mice. One problem to think about before permanently installing the hardware is cable management. Seven power cords, six monitor cables, three USB hubs, six keyboard cables, and six mice cables: that is a lot of cabling!

Step 2: Install Linux

Multi-seat capability is provided by Xorg 6.9/7.0 which already ships with most of the major distributions. When you install Linux, you might want to install all of the window managers including fluxbox and twm. If you are going to use the nVidia drivers, be sure to install the kernel source too.

Do the installation with all of the hardware connected and powered up. Mandriva did a great job detecting and configuring all six of our video heads. Select a default run level of 3 so that X does not start automatically after boot. You can check the installation by logging in and running startx. If all has gone well you should be able to move your mouse across all six monitors.

Mandriva allows up to ten entries in the /dev/input directory. We needed twelve since we had six keyboards and mice. We increased the limit to sixteen by changing the line in /etc/udev/ruled.d/50-mdk.rules from:

KERNEL=="event[0-9]*", NAME="input/%k", MODE="0600"

to:
KERNEL=="event[0-9a-f]*", NAME="input/%k", MODE="0600"

Step 3: Record Hardware Configuration

All hardware in our computer has a name that distinguishes it from similar hardware in the computer. In this step we record the names for each of our video heads, keyboards, and mice. Let's start with the video cards.

Video cards are identified by their address on the PCI bus. We can list the hardware on the PCI buses using the lspci command. On our test system, the lspci command gives the following result:

lspci | grep VGA
00:09.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
00:0a.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
00:0b.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
00:0c.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
00:0d.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1)
The bus address is the first field in the lines above. The number before the colon identifies which PCI bus (computers often have more than one), and the second number gives the card address on the bus. You will need to know these addresses to build the xorg.conf configuration file.

The mice are easy to locate. Each mouse has an entry in the /dev/input directory. An ls can identify the mice.

ls /dev/input/mouse*
/dev/input/mouse0 /dev/input/mouse2 /dev/input/mouse4
/dev/input/mouse1 /dev/input/mouse3 /dev/input/mouse5
The keyboards are identified as a /dev/input/eventN file. Do a more of /proc/bus/input/devices. Each keyboard will have an entry that specifies the event file. The following two entries are for the first two keyboards in our system.
more /proc/bus/input/devices

I: Bus=0003 Vendor=046e Product=530a Version=0001
N: Name="BTC Multimedia USB Keyboard"
P: Phys=usb-0000:00:03.3-4.2.1/input0
H: Handlers=kbd event6
B: EV=120003
B: KEY=1000000000007 ff87207ac14057ff febeffdfffefffff fffffffffffffffe
B: LED=1f

I: Bus=0003 Vendor=046e Product=530a Version=0001
N: Name="BTC Multimedia USB Keyboard"
P: Phys=usb-0000:00:03.3-4.4.1/input0
H: Handlers=kbd event7
B: EV=120003
B: KEY=1000000000007 ff87207ac14057ff febeffdfffefffff fffffffffffffffe
B: LED=1f

A table is a nice way to view all of the above information.

Seat Video Card Keyboard
(/dev/input/)
Mouse
(/dev/input/)
0 00:09:0 event6 mouse0
1 00:10:0 event7 mouse1
2 00:11:0 event8 mouse2
3 00:12:0 event9 mouse3
4 00:13:0 event10 mouse4
5 01:00:0 event11 mouse5

Note the slight change in how the video cards are addressed. Also, you'll find the numbering of the keyboards and mice easier if you plug each mouse into the same hub as its corresponding keyboard. Don't worry too much about matching the video head to the keyboard. After setting everything up you can move the monitors or the keyboards around as needed.

Step 4: Build xorg.conf

The xorg.conf file has sections to describe keyboards, mice, video cards, monitors, screens, and seats. Most of the work in setting up a multi-seat system is correctly copying the information in the above table into the appropriate section of the xorg.conf file. Shown below is our configuration for seat 5. You should be able to use this configuration as a prototype for your additional seats. Note the places where the keyboard, mouse, and video card information is located. Since we were borrowing monitors for our test, we forced all of the monitors to be flat panel displays with a 1024 by 768 resolution.
# Seat 5
Section "InputDevice"
Identifier "Keyboard5"
Driver "evdev"
Option "Device" "/dev/input/event11"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "compose:rwin"
EndSection

Section "InputDevice"
Identifier "Mouse5"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/mouse5"
Option "ZAxisMapping" "6 7"
EndSection

Section "Device"
Identifier "device5"
Driver "nvidia"
VendorName "NVIDIA Corp."
BoardName "NVIDIA GeForce4 (generic)"
BusID "PCI:0:13:0"
EndSection

Section "Monitor"
Identifier "monitor5"
ModelName "Flat Panel 1024x768"
HorizSync 31.5 - 48.5
VertRefresh 40.0 - 70.0
ModeLine "768x576" 50.0 768 832 846 1000 576 590 595 630
ModeLine "768x576" 63.1 768 800 960 1024 576 578 590 616
EndSection

Section "Screen"
Identifier "screen5"
Device "device5"
Monitor "monitor5"
DefaultDepth 24
SubSection "Display"
Virtual 1024 768
Depth 24
EndSubSection
EndSection

Section "ServerLayout"
Identifier "seat5"
Screen 0 "Screen5" 0 0
InputDevice "Mouse5" "CorePointer"
InputDevice "Keyboard5" "CoreKeyboard"
EndSection

There is a simple trick to help verify that all the numbers in the xorg.conf file are right -- pass the file through sort and uniq.
   sort /etc/X11/xorg.conf | uniq

[ 'sort xorg.conf|uniq -d' would also be helpful - just in case you had mistakenly repeated any of the device strings. -- Ben ]

The output of the above command string will make obvious any errors in numbering the various keyboards and such.

Testing Your Xorg.conf File: It is a good idea to test your configuration and to sort out the keyboards and mice by bringing up the heads one at a time. Login remotely so that you are not using any of the video heads. Enter the following commands for each of the six heads (0 to 5). (The commands below are for head 5.)

X -novtswitch -sharevts -nolisten tcp -layout seat5 :5 &
xterm -display :5 &
If the above command fails, examine the error messages and check the xorg.conf file. If the command succeeds, use the xterm to help identify which keyboard and mouse go to which head. The keyboards, mice, and video cards are enumerated in the same order on every boot, so you will only have to move things around during the initial set up.

The above commands might be sufficient if you don't need user logins. For example, a six headed kiosk might need only X and a web browser on each head.

Step 5: Modify gdm.conf

If you want user logins you will need to modify the configuration for your preferred display manager. The directions given here are for gdm but the changes are very similar for kdm, or for the X display manager, xdm.

Modify the [servers] section near the bottom of the /etc/X11/gdm/gdm.conf file to tell gdm which X servers to start. The lines should be:

0=Standard0
1=Standard1
2=Standard2
3=Standard3
4=Standard4
5=Standard5
You need to tell gdm how to start the X server on each head. The lines to do this are:
[server-Standard5]
name=Standard server
command=/usr/X11R6/bin/X -nolisten tcp -novtswitch -sharevts -layout seat5
flexible=true
You'll need a section like the above for each head. The server name, "Standard5" in the above example, must match the name given in the [servers] section. Customize the X command line options to meet the requirements of your particular system.

Once everything is configured, you should be able to start graphical logins by switching to runlevel 5.

telinit 5
If everything works, make the default runlevel 5 by editing /etc/inittab or by setting it using drakconf.

Test Results, Costs, and Problems

Performance Results: Between resets, we found performance to be excellent for six users doing typical PC tasks, including web browsing, email, word processing, and games. The accelerated graphics cards seemed to do most of the work so that even arcade style games and web-based video did not put much of a load on the CPU. If "3200" is an accurate assessment of the performance of the AMD64-3200, then a CPU with a performance of "1600" would have been more than sufficient.

Cost: Not including the monitor, each seat in our system cost about $67. This includes $40 for the MX4000 based video card, $20 for a USB keyboard, $5 for a USB mouse, and $2 for half of a USB hub. Our test system used expensive keyboards that have a built-in USB hub which we intended for per-user flash drives or audio players.

The shared part of our system cost about $520. This includes $180 for the CPU, $50 for the motherboard, $90 for RAM, and $50 for the CPU heat sink. The case, power supply, and disk drive had a combined cost of about $150.

We give these prices just for comparison. You may find lower prices that these and we'd certainly recommend that you replace our $230 CPU and motherboard with an Athlon 2800+ set that costs about $80. We have not included the cost of the monitors since these prices are in free fall and your particular needs and tastes may dictate what you spend.

Problems: Did you catch the phrase "between resets" above? While the system worked very well, it was extremely unstable. In particular, we got a kernel oops fairly often when we logged out. A syslog trace of one such oops is available here. We've tried several things to fix this problem including:

  • turning APIC off and on
  • reducing the number of heads
  • trying the 'nv' and 'vesa' drivers
  • using NoInt10
  • upgrading to the official X11R6.9 release
  • upgrading to the 2.6.15 kernel
  • using xdm and fvwm instead of gdm and Gnome
The problem persists. Please let bsmith at linuxtoys dot org know if you have any ideas that might help fix this problem.

A much less severe problem is that some programs assume that there is a single user on the PC. Screen savers can take a lot of CPU power and both KDE and Gnome complain if they don't have audio output. Any shared resource, such as audio or a CD burner, can be a problem.

As a longer-term concern, we will need to address security issues surrounding multi-seat computers. Whether from students or cafe patrons, these systems are going to come under deliberate, malicious attack. Can we trust KDE and Gnome to withstand such attacks?

Summary

A multi-head, multi-user Linux system is now possible using commodity PC hardware and standard Linux distributions. Multi-seat Linux PCs seem inevitable given the potential savings in cost, noise, and power.

Further Reading

Chris Tyler's page: Chris Tyler provided support at almost every step of the way in this project. His web site has a HOWTO that also describes how to set up a multi-seat system. Chris is something of an expert in X and I'm looking forward to his next book which will contain some of the material presented here. Chris' web site is at:
http://blog.chris.tylers.info/

Xorg man pages: Xorg provides a full set of manual pages that describe the xorg.conf file and all of the commands used in getting X-Windows to run. The manual page for xorg.conf is at:
http://wiki.x.org/X11R6.9.0/doc/html/xorg.conf.5.html

The manual pages for the X commands are at:
http://wiki.x.org/X11R6.9.0/doc/html/manindex1.html

Monitoring Servers,Network Devices with Opmanager in Debian

OpManager is a network monitoring software that can automatically discover your network; group your devices into intuitive maps, monitor devices in real-time and alert instantaneously on failure. It serves as a complete network monitoring solution by providing complete fault and performance functionality across your WAN and LAN infrastructure.

System Requirements

Processor: 32-Bit x86 Compatible
998 MHz and above
Memory: 999 MB
Disk space: 200MB
Operating System: RedHat 7.x and above, Debian 3.0 and above

Preparing Your System

You need to install the following packages as root

# apt-get install libgdbmg1 libexpat1

Create the following user and group

# adduser nobody
# groupadd nobody

Install Opmanager in Debian Etch

First you need to download the trail version of opmanager for Linux from here . Now you should have ManageEngine_OpManager_7_linux.bin file. You need to run this file using the following command as root

# ./ ManageEngine_OpManager_7_linux.bin

This will start the installation and you should see the following welcome installation shield you need to click next here

Now you should see the following License Screen select” I accept the …..” option and click Next

Next one is you should choose between trail version and Free edition. Here you need to choose trail version and click next

Select you Language and click next

If you want to change the installation directory you can do so otherwise click next

Enter the web server port as 4430 because 443(https) might be using another application so I would suggest 4430 click next

Installation details screen click next

Opmanager Installation is in progress

Extracting Files are in progress

Installation Completed Screen click finish

The file libdb-3.2.so may not exist in your system. OpManager bundles this file under lib/backup under OpManager Installation directory. Copy this file to lib directory ie.(Execute this command under /opt/AdventNet/ME/OpManager – this is the default location where OpManager is installed under Linux distribution)

# cd /opt/AdventNet/ME/OpManager/

# cp lib/backup/libdb-3.2.so lib/

Now you need to start the opmanager using the follow command

# /opt/AdventNet/ME/OpManager/bin/StartOpmanagerServer.sh

Once it started you should see the following screen

Now you need to go to open https://serverip:4430 in your web browser you should see the following screen here you need to login using the following details

Username: – admin

Password: – admin

Opmanager Startup Script

If you want to start your opmanager automatically when you reboot your server you need to download this script

Download opmanager file into /etc/init.d directory and run the following command

#chmod 755 opmanager

Now you need to update the startup script link using the following command

#update-rc.d opmanager defaults 50

Thats it your opmanager is ready to use

Now you need to check this manual for how add devices and services.

Cacti The ULTIMATE Management Solution

Purpose

The purpose of this document is to explain how to install Red Hat’s Fedora Core 2 product and utilize a suite of applications for network based SNMP management. This document will take you thru step-by-step how-to install Linux on a new system and configure all the necessary tools that will get you a fully functional SNMP management station. SNMP management can be used to monitor just about anything on just about any IP enabled device.

Requirements

Before you get started make sure you have the following things:

. • Fedora Core 2 CD’s 1 thru 3

. • Active Connection to the Internet

. • Computer that can be formatted and have a new OS installed from scratch

. • About 3-4 hours of time

How it works

Cacti uses a suite of applications to do visual web front end graphing of results pulled via SNMP। These SNMP values can range from input/output rates on network / server interfaces to the number of mac-addresses associated to a given access-point. Using SNMP to manage a network can provide a non­technical central point of consolidation and health monitoring of your infrastructure. As stated earlier, SNMP is something that is already or can easily be enabled on many IP capable devices. Using SNMP to constantly pull statistical information and graphing that information can be useful in tracking things like disk utilization, network activity and much more. The CACTI application requires several utilities to be configured to work together in order to present the information in a GUI web front end. These utilities include a web server, a database, PHP and RDTOOL. All of which is freely available for the Linux operating system.

Show me the Files

You are now ready to begin downloading the files necessary to install and run Cacti. This can be done via the command line (CLI) using a command called wget. Before we start downloading the files we must first create a directory that we want to download the files to. For sake of this how-to that directory will be located under the root file system (/) in a directory called cacti-install. (Remember you should be logged in as root for the duration of this how-to. After all is setup you can login as a normal user and sudo for root privileged commands if you wish).

Run these commands as root

mkdir /cacti-install cd /cacti-install

wget http://apache.mirrors.versehost.com/httpd/httpd-2.0.52.tar.gz

wget http://us4.php.net/get/php-4.3.8.tar.gz/from/this/mirror

wget http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.21.tar.gz/from/http://www.signal42.com/mirrors/mysql/

wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.49.tar.gz

wget http://unc.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.1.2.tar.gz

wget http://www.cacti.net/downloads/cacti-0.8.6b.tar.gz

File Download Scrip


Once you have downloaded the files it is HIGHLY recommended to check the directory and make sure all the files are actually downloaded. As noted earlier version numbers change and the location of the files may change so the wget script will fail if that is the case. If they fail during download you must fine a new location

Install MySQL

Run these commands as root

cd /cacti-install

tar -zxvf mysql*

cd mysql*

./configure --prefix=/usr/local/mysql

make

make install

groupadd mysql

useradd -g mysql mysql

scripts/mysql_install_db

chown -R root /usr/local/mysql

chown -R mysql /usr/local/mysql/var

chgrp -R mysql /usr/local/mysql

rm -f /etc/my.cnf

cp support-files/my-medium.cnf /etc/my.cnf

echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf

echo /usr/local/lib >> /etc/ld.so.conf

ldconfig –v

cp support-files/mysql.server /etc/init.d/mysql /usr/local/mysql/bin/mysqld_safe --user=mysql & Echo

cd /etc/rc3.d/

ln -s ../init.d/mysql S85mysql

ln -s ../init.d/mysql K85mysql

cd /etc/rc5.d/

ln -s ../init.d/mysql S85mysql

ln -s ../init.d/mysql K85mysql

cd /etc/init.d/ chmod 755 mysql

MySQL Install Script



Install Apache

Run these commands as root


cd /cacti-install


tar -zxvf httpd*


cd httpd*


./configure --prefix=/www –enable-so


make


make install


cd /www/bin


cp apachectl /etc/init.d/httpd


y


cd /etc/rc3.d/


ln -s ../init.d/httpd S85httpd


ln -s ../init.d/httpd K85httpd


cd /etc/rc5.d/


ln -s ../init.d/httpd S85httpd


ln -s ../init.d/httpd K85httpd


/www/bin/apachectl start


Apache Install Script




Install PHP

Run these commands as root

cd /cacti-install

tar -zxvf php*

cd php*

./configure --prefix=/www/php --with-apxs2=/www/bin/apxs --with-config-file-path=/www/php --enable-sockets --with-mysql=/usr/local/mysql --with-zlib­dir=/usr/include –with-gd

make

make install

cp php.ini-dist /www/php/php.ini

cp /www/conf/httpd.conf /www/conf/httpd.conf.backup

echo ####################### >> /www/conf/httpd.conf

echo # Added via Lee Carter's Script >> /www/conf/httpd.conf

echo ####################### >> /www/conf/httpd.conf

echo AddType application/x-tar .tgz >> /www/conf/httpd.conf

echo AddType application/x-httpd-php .php >> /www/conf/httpd.conf

echo AddType image/x­icon .ico >> /www/conf/httpd.conf

echo DirectoryIndex index.php index.html index.html.var >> /www/conf/httpd.conf service httpd stop

service httpd start

PHP Install Script




Configure MySQL


Run these commands as root

cd /cacti-install

group-add cacti

useradd -g cacti cactiuser

/usr/local/mysql/bin/mysql

mysql> set password for root@localhost=password('rootpw');

mysql> create database cactidb;

mysql> grant all on cactidb.* to root;

mysql> grant all on cactidb.* to root@localhost;

mysql> grant all on cactidb.* to cactiuser;

mysql> grant all on cactidb.* to cactiuser@localhost;

mysql> set password for cactiuser@localhost=password('cactipw');

mysql> exit

MySQL Configure Script




Install RRDTOOL


Run these commands as root

cd /cacti-install

tar -zxvf rrdtool*

cd rrdtool* ./configure --prefix=/usr/local/rrdtool

make

make install

RRDTOOL Install Script




Install NET- SNMP


Run these commands as root

cd /cacti-install

tar -zxvf net-snmp*

cd net-snmp*

./configure

make

make install

NET-SNMP Install Script




Install Cacti



Run these commands as root

cd /cacti-install

cp cacti* /www/htdocs/

cd /www/htdocs/

tar -zxvf cacti*

mv cacti-0.8.6b cacti/

cd /cacti /usr/local/mysql/bin/mysql --user=root --password=rootpw cactidb <>

Cacti Install Script



Now edit your /www/htdocs/cacti/include/config.php

The finished product should look like so:

$database_defaut = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipw”;

Now add the following line in your /etc/ctrontab The finished product should look like so:

*/5 * * * * cactiuser /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1

NOTE*** DO NOT RUN THE ABOVE COMMAND. LET THE CRONTAB FILE RUN IT.

If you run the above command as root there will be several files created under ...../rra and ..../log that will now be owned by the user ROOT and your graphs will NOT populate correctly. So the moral is... JUST TYPE IN WHAT YOU SEE ABOVE AND SAVE THE FILES. DONT RUN THEM.


Finalize Setup

You are now ready to finalize the setup process for cacti. To do this you will need to point your browser to the IP address of the cacti system like so:

http://localhost/cacti

or

http://remoteIP/cacti

1. Click Next

2. Default (New Install) -> Click Next

3. Two errors locating php and rrdtool to Fix them replace what they have with:

RRDTOOL = /usr/local/rrdtool/bin/rrdtool

PHP = /www/php/bin/php

4. Click Finish

5. Login admin/admin

6. Change Password for user admin

7. Click Save


That'it! Your done. Congratulations on your new install. You can now start playing with the cacti utility it's self. I highly recommend going to the message boards to find add-ons and helpful hints when trying to do any advanced things in cacti. This is a highly versatile utility and is really only limited to your imagination.