Install Nagios in Ubuntu source code to monitor local hosts

Source: Internet
Author: User
1. This Guide attempts to allow you to monitor local hosts by installing Nagios source programs on Ubuntu within 20 minutes using simple commands. More advanced settings are not discussed-only some basic operations, but this is enough for 95% of users to start Nagios. These commands are written in Ubuntu6.10 (desktop edition)-based systems. WhatYou 'llendupwith if you follow this Guide, the final result will be: Nagios and plug-in will be installed to/usr/lo

1. This Guide attempts to allow you to monitor local hosts by installing Nagios source programs on Ubuntu within 20 minutes using simple commands. More advanced settings are not discussed-only some basic operations, but this is enough for 95% of users to start Nagios.

These commands are written in Ubuntu 6.10 (desktop edition)-based systems.

What You'll End Up

If you follow the instructions in this tutorial, the result is as follows:

Nagios and plug-ins will be installed in/usr/local/nagios
Nagios will be configured to monitor several main services of the local system (CPU load, disk utilization, etc)
The Nagios Web interface is http: // localhost/nagios/
2. Required software packages
Make sure that the following software package has been installed on your installed system.

Apache2
GCC compiler and Development Library
GD library and Development Library
You can use the apt-get command to install these software packages. type the command:

Sudo apt-get install apache2
Sudo apt-get install build-essential
Sudo apt-get install libgd2-dev
3. Operation Process
1) create an account

Switch to root user

Sudo-s
Create an account named nagios and give a logon Password

/Usr/sbin/useradd nagios
Passwd nagios
In Ubuntu server version (6.01 or later), create a user group named nagios (not created by default ). Skip this step on Ubuntu Desktop.

/Usr/sbin/groupadd nagios
/Usr/sbin/usermod-G nagios
Create a user group named nagcmd to execute External commands from the Web interface. Add both nagios users and apache users to this group.

/Usr/sbin/groupadd nagcmd
/Usr/sbin/usermod-G nagcmd nagios
/Usr/sbin/usermod-G nagcmd www-data
2) download Nagios and plug-in packages

Create a directory to store downloaded files

Mkdir ~ /Downloads
Cd ~ /Downloads
Download the software packages for Nagios and Nagios plug-ins (visit http://www.nagios.org/download/ ). When writing this document, the latest Nagios software version is 3.0rc1 and the Nagios plug-in version is 1.4.11.

Wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc1.tar.gz
Wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
3) Compile and install Nagios

Expand Nagios source package

Cd ~ /Downloads
Tar xzf nagios-3.0rc1.tar.gz
Cd nagios-3.0rc1
Run the Nagios configuration script and use the previously opened users and user groups:

./Configure -- with-command-group = nagcmd
Compile the Nagios package source code

Make all
Install binary programs, initialization scripts, configuration file samples, and set running Directory Permissions

Make install
Make install-init
Make install-config
Make install-commandmode
You cannot start Nagios now.-You have to do more...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.