Nagios Basic installation

Source: Internet
Author: User

1. nagios Basic installation
Install the GCC compiler, GD library, development library, and web Service on the server and create a nagios Account # useradd nagios
# Passwd nagios
# Usermod-G nagios apache # Add apache users to the nagios Group
[Root @ nagios ~] # Wget http://www.nagios.com/# Get the latest nagios-3.2.1.tar.gz
Extract
[Root @ nagios ~] # Tar xzvf nagios-3.2.1.tar.gz
[Root @ nagios ~] # Cd nagios-3.2.1
Compile
[Root @ nagios nagios-3.2.1] #./configure -- prefix =/usr/local/nagios/
[Root @ nagios nagios-3.2.1] # make all # according to the prompt as shown in make all
[Root @ nagios nagios-3.2.1] # make install # install the nagios main program, cgi and html files
[Root @ nagios nagios-3.2.1] # make install-init # install the startup script of nagios
[Root @ nagios nagios-3.2.1] # make install-commandmode # install the directory used by external commands and Configure permissions
[Root @ nagios nagios-3.2.1] # make install-config # install template configuration file
[Root @ nagios nagios-3.2.1] # make install-config # install apache configuration file
After nagios is installed, you can see the following sub-directories in the/usr/local/nagios directory:
Bin nagios execution program directory. The nagios file is the main program.
Etc nagios configuration file directory
The directory where the sbin nagios cgi file is located, that is, the directory where the file needed to execute External commands is located
Share the directory of the nagios webpage File
Directory where var nagios log files, spids, and other files are located
Var/archive empty directory used to store archived logs
Var/rw is an empty directory reserved by external commands
2. Install the nagios plug-in (plugins)
[Root @ nagios] # wget http://www.nagios.com/ingress get installation package nagios-plugins-1.4.14.tar.gz
[Root @ nagios] # tar xzvf nagios-plugins-1.4.14.tar.gz
[Root @ nagios] # cd nagios-plugins-1.4.14
[Root @ nagios nagios-plugins-1.4.14] #./configure -- prefix =/usr/local/nagios # compile and specify the installation path
[Root @ nagios nagios-plugins-1.4.14] # make & make install
Check the/usr/local/nagios/libexec/directory. The installed plug-ins are displayed. All the plug-ins are in this directory.
[Root @ nagios nagios-plugins-1.4.14] # ls/usr/local/nagios/libexec/
Check_apt check_ide_smart check_nt check_ssh
Check_breeze check_ifoperstatus check_ntp check_ssmtp
Check_by_ssh check_ifstatus check_ntp_peer check_swap
Check_clamd check_imap check_ntp_time check_tcp
Check_cluster check_ircd check_nwstat check_time
Check_dhcp check_jabber check_oracle check_udp
Check_dig check_ldap check_overcr check_ups
Check_disk check_ldaps check_ping check_users
Check_disk_smb check_load check_pop check_wave
Check_dns check_log check_procs library_linux32
Check_dummy check_mailq check_real negate
Check_file_age check_mrtg check_rpc urlize
Check_flexlm check_mrtgtraf check_sensors utils. pm
Check_ftp check_nagios check_simap utils. sh
Check_http check_nntp check_smtp
Check_icmp check_nntps check_spop
3. log on to the service interface and verify that the above installation is correct.
Configure WEB interfaces
Make install-webconf # completed during nagios Installation
Create a nagiosadmin user for logging on to Nagios WEB Interface
[Root @ nagios] # htpasswd-c/usr/local/nagios/etc/htpasswd. users nagiosadmin
The htpasswd. users file does not exist by default. The-c parameter is automatically generated during creation (the first creation)
Restart the Apache service to make the settings take effect.
[Root @ nagios] # service httpd restart
[Root @ nagios] # service nagios restart
Http: // ip/nagios # access the nagios server to verify whether the installation is successful
The system prompts that you do not have the permission to access the nagios server. You can use the chmod command to change the permission of the apache service directory because the nagios user has the permission to access
If you can log on to the home page, but the function on the left side cannot display a prompt indicating that the internal server is abnormal, you can change the selinux configuration.
If you do not disable SELinux or change SELinux permanently, you can enable the CGI Module to specify the forced target mode under SELinux:
[Root @ nagios] # chcon-r‐t httpd_sys_content_t/usr/local/nagios/sbin/
[Root @ nagios] # chcon-r‐t httpd_sys_content_t/usr/local/nagios/share/

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.