Centos7 安装配置nagios4.4.1.docx_第1页
Centos7 安装配置nagios4.4.1.docx_第2页
Centos7 安装配置nagios4.4.1.docx_第3页
Centos7 安装配置nagios4.4.1.docx_第4页
Centos7 安装配置nagios4.4.1.docx_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Centos 7 安装配置nagios4.4.1If you follow these instructions, heres what youll end up with: Nagios and the plugins will be installed underneath /usr/local/nagios Nagios will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.) The Nagios web interface will be accessible at http:/localhost/nagios/PrerequisitesDuring portions of the installation youll need to haverootaccess to your machine.Make sure youve installed the following packages on your Fedora installation before continuing. Apache PHP GCC compiler GDdevelopment librariesYou can useyumto install these packages by running the following commands (as root):yum install httpd phpyum install gcc glibc glibc-commonyum install gd gd-develyum install unzip1) Create Account InformationBecome the root user. 将当前环境转为root环境su -l Create a newnagiosuser account and give it a password.创建nagios帐户和密码/usr/sbin/useradd -m nagiospasswd nagios 密码:nagiosCreate a newnagcmdgroup for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.新建组nagcmd,添加nagios、apache两个用户到nagcmd组/usr/sbin/groupadd nagcmd/usr/sbin/usermod -a -G nagcmd nagios/usr/sbin/usermod -a -G nagcmd apache2) Download Nagios and the Plugins 下载nagios源码包Create a directory for storing the downloads.mkdir /downloadscd /downloadsDownload the source code tarballs of both Nagios and the Nagios plugins (visit/download/for links to the latest versions). These directions were tested with Nagios 4.0.8 and Nagios Plugins 2.0.3.wget /sourceforge/nagios/nagios-4.1.1.tar.gzwget /download/nagios-plugins-2.1.1.tar.gz3) Compile and Install Nagios 编译和安装nagiosExtract the Nagios source code tarball. 解压cd /downloadstar xzf nagios-4.1.1.tar.gzcd nagios-4.1.1Run the Nagios configure script, passing the name of the group you created earlier like so:./configure -with-command-group=nagcmdCompile the Nagios source code.make allInstall binaries, init script, sample config files and set permissions on the external command directory.make installmake install-initmake install-configmake install-commandmodeDont start Nagios yet - theres still more that needs to be done.现在不要启动nagios服务,还需要更多的设置4) Customize Configuration 自定义配置Sampleconfiguration fileshave now been installed in the/usr/local/nagios/etcdirectory. These sample files should work fine for getting started with Nagios. Youll need to make just one change before you proceed.Edit the/usr/local/nagios/etc/objects/contacts.cfgconfig file with your favorite editor and change the email address associated with thenagiosadmincontact definition to the address youd like to use for receiving alerts.vi /usr/local/nagios/etc/objects/contacts.cfg编辑此文件修改报警邮箱地址5) Configure the Web InterfaceInstall the Nagios web config file in the Apache conf.d directory.make install-webconf 在nagios解压后的目录执行,在Apache conf.d安装Nagios web配置文件目录Create anagiosadminaccount for logging into the Nagios web interface. Remember the password you assign to this account - youll need it later.创建登陆nagios的帐户htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin密码:123456Restart Apache to make the new settings take effect.service httpd restart 重启apache服务或者:systemctl restart httpd.serviceNote: Consider implementing the ehanced CGI security measures describedhereto ensure that your web authentication credentials are not compromised.6) Compile and Install the Nagios Plugins 编辑安装nagios插件Extract the Nagios plugins source code tarball.cd /downloadstar xzf nagios-plugins-2.1.1.tar.gzcd nagios-plugins-2.1.1Compile and install the plugins./configure -with-nagios-user=nagios -with-nagios-group=nagiosmakemake install7) Start NagiosAdd Nagios to the list of system services and have it automatically start when the system boots.chkconfig -add nagioschkconfig nagios onVerify the sample Nagios configuration files./usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgIf there are no errors, start Nagios.service nagios start8) Modify SELinux Settings(关闭selinux)Fedora ships with SELinux (Security Enhanced Linux) installed and in Enforcing mode by default. This can result in Internal Server Error messages when you attempt to access the Nagios CGIs.See if SELinux is in Enforcing mode.getenforcePut SELinux into Permissive mode.setenforce 0To make this change permanent, youll have to modify the settings in/etc/selinux/configand reboot.Instead of disabling SELinux or setting it to permissive mode, you can use the following command to run the CGIs under SELinux enforcing/targeted mode:chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/chcon -R -t httpd_sys_content_t /usr/local/nagios/share/For information on running the Nagios CGIs under Enforcing mode with a targeted policy, visit theNagios Support PortalorNagios Community Wiki.9) Login to the Web InterfaceYou should now be able to access the Nagios web interface at the URL below. Youll be prompted for the username (nagiosadmin) and password you specified earlier.http:/localhost/nagios/Click on the Service Detail navbar link to see details of whats being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time.10) Other ModificationsMake sure your machines firewall rules are configured to allow access to the web server if you want to access the Nagios interface remotely.Configuring email notifications is out of the scope of this documentation. While Nagios is currently configured to send you email notifications, your system may not yet have a mail program properly installed or configured. Refer to your

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论