How would you rate this article?
Rating:
0 user(s) have rated this article
Posted by:
retro
Date:
23/11/2008
Category:
Linux and Open Source
Views:
this article has been read 1362 times
Recent Articles

(26/06/2010)
Nochex merchant accounts provide you with everything you need to accept payments on your web site. With no monthly fees and support for a number of ecommerce solutions, including nopCommerce, it has never been easier to start selling online!
|
(25/05/2010)
Check out our latest project for community interest company S.C.A.
|
(25/05/2010)
We are pleased to announce support for version 4.0 of the .NET Framework on all of our hosting plans.
|
(11/02/2010)
We have just completed development of a new web site for UK based Aerial Spares.
|
(11/02/2010)
Today sees the release of the official nopCommerce user guide. It explains every part of the application in detail and includes a getting started guide so you can get up and running quickly.
|
read more
A common task for network administrators is the monitoring of different network devices and services both internally and on the internet. This article discusses the installation of Nagios (host and service monitor) on openSUSE from scratch. It is specifically targeted at Windows server administrators who may not have much experience in working with Linux.
From the Nagios home page (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."
Requirements
The server that we will build requires very little resources so the use of older (reliable) hardware e.g. PII Processor / 256mb RAM would suffice.
This article will use a Virtual Machine (using VMware) as a host as it allows for much easier deployment (copy / paste).
To begin with, create a new virtual machine:
- In VMware Server Console go to File > New Virtual Machine (this will open the "New Virtual Machine Wizard")
- Click Next, select Typical Configuration and click Next again
- Choose the Guest Operating System Linux, and select SUSE Linux from the drop down list. Click Next
- Give your Virtual Machine a name i.e. LinuxServer1 and specify the location. Click Next.
- Choose your networking type. Typically you would choose bridged so that the server appears as a physical server on your LAN and can therefore be contacted by IP (for accessing web interface/ssh etc.). Click Next.
- Leave the default Disk Size (8GB) and choose to "Allocate all disk space now". If you are planning to test this installation and then move the VM to another machine, you may wish to leave this option unticked to keep the size of the VM as small as possible. Finally, click Finish.
Once the VM's disk has been created we are ready to install openSUSE:
- Go to http://software.opensuse.org/ and download an ISO of the openSUSE installation or alternatively for a fully supported package, go to http://en.opensuse.org/Buy_openSUSE (I am presuming you are using the ISO)
- With your VM created, select "Edit Virtual Machine Settings" in VMware Server Console.
- Select CD-ROM and choose to "Use ISO image". Browse to the location of the downloaded ISO file.
- Click OK to save your settings and start your virtual machine.
*NOTE I have left the default memory to 256mb but you could probably reduce this to 128mb as we will not be installing any desktop environment.
Now we are ready to Install:
- Start your virtual machine (the installation menu should load)
- Choose "Installation"
- At the Welcome screen choose your Language, Keyboard Layout and accept the License Terms (after reading them of course). Click Next.
- After scanning your hardware the Installation Mode screen will open. Choose "New Installation" and click Next.
- At the Time Zone screen, choose your Clock and Time Zone settings. Click Next.
- The next screen "Desktop Selection" allows you to choose a desktop selection. Since we will be accessing nagios via a web browser, there is no need for a desktop environment. Choose, "Other" and select "Minimal Server Selection (Text Mode)". Click Next.

- At the "Suggested Partitioning" screen, keep the default settings and click Next.
- The next screen allows you to create a user for your server. Enter your name, a username and a strong password. Click Next.

- At the installation settings screen click Install (you will be prompted to confirm installation)
- Wait for installation to complete (should take 5-10 minutes depending on hardware).
Once installed, we are ready to log in to our server and install Nagios.
To log in:
- Enter the username you configured during setup. Press Enter
- Enter the password you configured during setup. Press Enter

By default you will probably want to change the hostname (default is to be configured by DHCP) and change to a STATIC IP Address.
To do this:
- Type "su" at the console and hit enter to switch to the user "root". Press enter
- Enter the same password as you configured during setup. Press enter
- Type yast2 and press enter.
- This will open the YaST2 menu. Select Network Devices > Network Settings by using your keyboard. Press enter.
- Your network device should automatically be selected, choose the "Hostname/DNS" option (Alt + S)
- Change your Hostname and optionally add a domain name. Uncheck "Change Hostname via DHCP". Choose Finish (Alt + F)
- Next go back into Network Devices > Network Settings and select Edit for your network device (Alt + I)
- Give yourself a static IP Address and then Finish (Alt + F)

Now it is a good idea to perform and necessary system updates (providing you are connected to the internet). Whilst still in Yast go to Software > Online Update. Accept (Alt + A) available updates (you may have to do a few times).
At this point we have a fully patched openSUSE installation and we are ready to install Nagios.
However, the easiest way (that ensures you have installed all dependencies) is through the Yast Software Management menu.
- If you do not already have Yast open, open it (type Yast2 at console)
- Go to Software > Software Management
- Press Alt + F on your keyboard and change the Filter to "Search"
- Enter the Search Phrase "Nagios" and Search (Alt + S)
- Select the packages below by selecting them and pressing the SPACE BAR

- Accept (Alt + A) and OK (Alt + O) to the other Automatic Changes (includes all necessary dependencies)
With all necessary software packages installed, close Yast and return to the console.
Reboot (enter command "reboot")
Activating Nagios
To get Nagios up and running we need to enter a few commands.
Log in and switch to root (su)
Start (and activate) nagios via Console using:
rcnagios start && insserv nagios
To start the nagios webfrontend, we need to start the apache webserver using:
rcapache2 start
and add a user and password to access the nagios webfrontend:
htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin
This will ask you for a password for the user nagiosadmin - you can add other users here without any problems. These users mustn't exist on your system as they are only needed to access the webinterface.

At this point we have installed and started nagios.
As we don't have a browser on our server (no desktop environment) we need to open up the http ports to allow access from other devices on the network:
- Open Yast
- Go to Security and Users > Firewall
- Select Allowed Services
- Press Alt + D or choose Advanced
- Enter http in TCP ports. Select OK

- Select Next, then Finish.
- Close Yast
you will be prompted for authentication (use the credentials you set for the nagios webfrontend e.g. nagiosadmin) and should successfully log in:

In
part 2 we discuss setting up the most common method of monitoring, using PING to check the activity of a remote server.
Comments
Comment this article