In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install nagios on FreeBSD 7.0. it has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
The specific process for installing nagios on FreeBSD 7.0 is as follows:
OS:FreeBSD 7.0
Download the required software packages from http://www.nagios.org/download/
1.nagios-3.1.2.tar.gz
2.nagios-plugins-1.4.13.tar.gz
System requirements:
1. Apache
2. GCC compiler
3. GD library and development library
After the above software is installed, begin to install nagios.
1. Decompress
# tar zxvf nagios-2.5.tar.gz
two。 Establish the user running nagios:
# pw adduser nagios
# passwd nagios
3. Create a user group named nagcmd to execute external commands from the Web interface. Add both nagios and apache users to this group. You must determine which user the web server is running under, usually: apache. My server configuration is www.
# grep "^ User" / usr/local/apache2/conf/httpd.conf
# pw groupadd nagcmd
# pw usermod www-G nagcmd
# pw usermod nagios-G nagcmd
Run the Nagios configuration script and use previously opened users and user groups
#. / configure-prefix=/usr/local/nagios-with-gd-lib=/usr/local/lib-with-gd-inc=/usr/local/include-with-command-group=nagcmd
* Configuration summary for nagios 3.1.2 06-23-2009 * *:
General Options:
--
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagios
Embedded Perl: no
Event Broker: yes
Install ${prefix}: / usr/local/nagios
Lock file: ${prefix} / var/nagios.lock
Check result directory: ${prefix} / var/spool/checkresults
Init directory: / usr/local/etc/rc.d
Apache conf.d directory: / etc/httpd/conf.d
Mail program: / usr/bin/mail
Host OS: freebsd7.0
Web Interface Options:
-
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): / usr/sbin/traceroute
Review the options above for accuracy. If they look okay
Type 'make all' to compile the main program and CGIs.
Compile the Nagios package source code
# make all
Install the binary runtime program, initialize scripts, configure sample files, and set run directory permissions
# make install
Check the directory permissions of / usr/loca/etc/rc.d before running make install-init. My server is root:wheel. And Makefile pilot test root:root.
Modify Makefile
INIT_DIR=/usr/local/etc/rc.d
INIT_OPTS=-o root-g root
Change to:
INIT_DIR=/usr/local/etc/rc.d
INIT_OPTS=-o root-g wheel
Then run make install-init.
# make install-init
# make install-commandmode
# make install-config
Configure WEB Interfac
Install the WEB configuration file for Nagios to the conf directory of Apache. The path to http in the Makefile file is / etc/httpd/conf.d. Change it to the conf path of your own apache.
# make install-webconf
To this nagios core program installation is complete!
Customized configuration
The sample configuration files are installed in this directory / usr/local/nagios/etc by default. These sample files can be configured for Nagios to work properly with a simple modification.
Use the editor software you are good at to edit this / usr/local/nagios/etc/objects/contacts.cfg configuration file and change the EMail information in the contact definition information of the email address nagiosadmin to your EMail message to receive the alarm content.
# vi / usr/local/nagios/etc/objects/contacts.cfg
Configure WEB Interfac
Configure BASIC authentication for apache and create a nagiosadmin user to log in to the WEB interface for Nagios. Write down the login password you have set, and you will use it later.
# htpasswd-c / usr/local/nagios/etc/htpasswd.users nagiosadmin
Then modify the configuration file of apache
# vi / usr/local/apache/conf/httpd.conf
Add the following:
ScriptAlias / nagios/cgi-bin / usr/local/nagios/sbin
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile / usr/local/nagios/etc/htpasswd.users
Require valid-user
Alias / nagios/ usr/local/nagios/share
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile / usr/local/nagios/etc/htpasswd.users
Require valid-user
After the modification, save the file and restart apache:
# / usr/local/apahce/bin/apachectl restart
Restart the Apache service for the settings to take effect.
Compile and install the Nagios plug-in
Expand the source package for the Nagios plug-in
# tar xzf nagios-plugins-1.4.13.tar.gz
# cd nagios-plugins-1.4.11
#. / configure-with-nagios-user=nagios-with-nagios-group=nagios-prefix=/usr/local/nagios-plugins
# make
# make install
After the installation is complete, a libexec directory will be generated in / usr/local/nagios-plugins-plugins, and you can move it all to the / usr/local/nagios directory.
# mv / usr/local/nagios-plugins-plugins/libexec/ / usr/local/nagios/
Start Nagios
Verify the sample configuration file for Nagios
# / usr/local/nagios/bin/nagios-v / usr/local/nagios/etc/nagios.cfg
Appear:
Total Warnings: 0
Total Errors: 0
Things look okay-No serious problems were detected during the pre-flight check
There is nothing wrong with the configuration file.
Start nagios
# / usr/lcoal/etc/rc.d/nagios start
Log in to the WEB interface
You can now access the WEB interface of Nagios from WEB. You need to enter your user name (nagiosadmin) and password at the prompt, which you just set. Here use the browser installed by default on the system. Use the hyperlink below.
The http://localhost/nagios/ is shown in the figure:
Thank you for reading this article carefully. I hope the article "how to install nagios on FreeBSD 7.0" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you 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.