In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly talks about "the installation and configuration of Nagios in CentOS environment". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the installation and configuration of Nagios in CentOS environment".
1. Installation environment: CentOS5.4 + Apache2 + PHP5.2. Please make sure that PHP+Apache is installed. Please see the installation tutorial on Apache and PHP in this blog.
2. Create Nagios users and user groups with the following commands:
# useradd-m nagios
-- create a nagcmd group to run commands transmitted through the web interface, while adding nagios and apache
# groupadd nagcmd # usermod-a-G nagcmd nagios # usermod-a-G nagcmd apache
3. Download and install the Nagios and Nagios plug-ins as follows:
-- download Nagios
# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.1.tar.gz
-- download the Nagios plugin
# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
-- decompress Nagios
# tar-zvxf nagios-3.2.1.tar.gz
# cd nagios-3.2.1
-- compilation
#. / configure-- with-command-group=nagcmd # make all
Install Nagios, initialize script and configuration file, Nagios will be installed to / usr/local/nagios # make install # make install-init # make install-config # make install-commandmode
-- install the WEB interface, which will be installed to / usr/local/nagios/share (the http configuration file is added to / etc/httpd/conf.d/nagios.conf by default, if not, execute: # cp sample-config/httpd.conf / etc/apache2/conf.d/nagios.conf)
# make install-webconf
-- create a HTTP authenticated user to login to Nagios with a user name of nagiosadmin and a password of 123456
# htpasswd-c / usr/local/nagios/etc/htpasswd.users nagiosadmin
-- restart apache
# service httpd restart
-install the Nagios plug-in
# tar-zvxf nagios-plugins-1.4.14.tar.gz
# cd nagios-plugins-1.4.14
#. / configure-- with-nagios-user=nagios-- with-nagios-group=nagios # make & & make install
-- configure the mailbox where the Nagios administrator accepts the alarm information and write it to the administrator mailbox # vim / usr/local/nagios/etc/objects/contacts.cfg email admin@admin.com;-- verify the Nagios configuration file to verify whether the configuration is incorrect # / usr/local/nagios/bin/nagios-v
-- start Nagios and configure to run Nagios when the system starts
# chkconfig-- add nagios # chkconfig nagios on # chkconfig httpd on
-- run Nagios
# service nagios start
Log in to the Web interface and enter the user name and password: nagiosadmin 123456, http://localhost/nagios/
5. Error handling
1. The Notifications of the local monitoring HTTP SSH displays a warning error. The solution:
# vim / usr/local/nagios/etc/objects/localhost.cfg
Define service {
Use local-service; Name of service template to use
Host_name localhost
Service_description SSH
Check_command check_ssh
Notifications_enabled 1 # can be changed to 1.
}
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
Define service {
Use local-service; Name of service template to use
Host_name localhost
Service_description HTTP
Check_command check_http
Notifications_enabled 1 # can be changed to 1.
}
2. Nagios displays a similar error: HTTP WARNING: HTTP/1.1 403 Forbidden-5240 bytes in 0.002 second response time.
This error indicates that there is no index.html file in the apache web root directory. Solution: create the index.html file in the web root directory (such as / var/www/html/ directory) and restart apache and nagios.
At this point, I believe you have a deeper understanding of "the installation and configuration of Nagios under the CentOS environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.