温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Nagios 监控平台快速安装

发布时间:2020-05-18 08:39:30 阅读:870 作者:吴光科 栏目:移动开发
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>
Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。
 
一、首先安装apache:
安装apache,采用yum方式安装,安装的命令是yum install –y httpd  安装完apache后,启动apache命令/etc/init.d/httpd restart 即可! 
 
二、安装php:
Nagios是基于php语音编写的程序,所以需要安装php,也采用yum方式安装  Yum install php php-devel -y即可 
  
三、下载nagios:
现在nagios版本和客户端插件地址如下:  wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.2.1/nagios-3.2.1.tar.gz/download  wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download   wget  http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz      创建用户维护Nagios的用户和组  useradd nagios  passwd nagios 
四、在服务器端,安装Nagios和nrpe、nagios插件:
安装Nagios  tar zxvf nagios-3.2.1.tar.gz  cd nagios-3.2.1  ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios  make all  make install                   //来安装主程序,CGI和HTML文件  make install-init              //在/etc/rc.d/init.d安装启动脚本  make install-config            //来安装示例配置文件,安装的路径是/usr/local/nagios/etc  make install-commandmode//来配置目录权限   make install-webconf     写入配置文件     安装Nagios-plugins  tar zxvf nagios-plugins-1.4.15.tar.gz  cd nagios-plugins-1.4.15  ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios  make && make install  安装nrpe   tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config  chown  -R nagios:nagios /usr/local/nagios/    /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d  启动nrpe服务 
 
五、创建web 访问用户:
增加访问控制验证用户:(第一次创建时要加参数c)  htpasswd -/usr/local/nagios/etc/htpasswd.users  nagiosadmin   nagios安装完毕,然后重启apache,重启nagios,/etc/init.d/nagios restart  访问:http://localhost/nagios/ 即可! 即可访问到nagios最初安装界面 
 
六、在客户端安装nrpe、nagios-plugin:
首先下载nagios-plugins-1.4.15.tar.gz和nrpe-2.13.tar.gz,     执行如下脚本即可:  #!/bin/sh  ###auto make install nagios_plugin and nrpe  useradd nagios  tar -xzf nagios-plugins-1.4.15.tar.gz &&cd nagios-plugins-1.4.15 &&./configure --prefix=/usr/local/nagios &&make &&make install     sleep 2     echo "This is make install nrpe ,please waiting .................."  cd ../ ; tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config     chown  -R nagios:nagios /usr/local/nagios/  cd .. ;cp nrpe.cfg /usr/local/nagios/etc/nrpe.cfg     /usr/local/nagios/bin/nrpe -/usr/local/nagios/etc/nrpe.cfg -d     ###Add auto start  grep "nrpe" /etc/rc.local     if [ $? -ne 0 ];then  echo "/usr/local/nagios/bin/nrpe -/usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local  else  echo "nrpe is exist"  fi  保存即可! 

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×