设为首页 收藏本站
查看: 1152|回复: 0

nagios编译安装、搭建

[复制链接]

尚未签到

发表于 2019-1-14 10:20:28 | 显示全部楼层 |阅读模式
基本准备
yum -y install httpd php mysql-devel php-mysql            安装需要的包
groupadd nagcmd                                    创建nagios的管理组
useradd –g nagcmd nagios                            nagios添加到组nagioscmd
usermod -a -G nagcmd apache                        apache加入到组nagcmd
yum –y install gcc                                     编译安装的需要
安装httpdapache环境】
[root@zhangpub]# tar zxvf nagios-3.0.6.tar.gz
[root@localhosthttpd-2.2.6]# cd /var/ftp/upload/httpd-2.2.6
[root@localhosthttpd-2.2.6]# ./configure --prefix=/usr/local/apache
[root@localhosthttpd-2.2.6]# make
[root@localhosthttpd-2.2.6]# make install


[root@localhost httpd-2.2.6]#service httpd start
Starting httpd: httpd: Could notreliably determine the server's fully qualified domain name, usinglocalhost.localdomain for ServerName
(98)Address already in use:make_sock: could not bind to address [::]:80
(98)Address already in use:make_sock: could not bind to address 0.0.0.0:80
no listening sockets available,shutting down
Unable to open logs
                                                          [FAILED]
[root@localhost httpd-2.2.6]#(98)Address already in use: make_sock: could not bind to address [::]:80
-bash: syntax error nearunexpected token `Address'
[root@localhost httpd-2.2.6]#(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
-bash: syntax error nearunexpected token `Address'


启动报错:


[root@localhosthttpd-2.2.6]# netstat -lnp|grep 80
tcp        0     0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      3536/nginx
tcp        0     0 127.0.0.1:631              0.0.0.0:*                   LISTEN      1802/cupsd
tcp        0     0 ::1:631                    :::*                        LISTEN      1802/cupsd
udp        0     0 0.0.0.0:631                0.0.0.0:*                              1802/cupsd
unix  2     [ ACC ]     STREAM     LISTENING     15688 2517/gnome-power-ma /tmp/orbit-root/linc-9d5-0-e7ccb8c8800b
unix  2     [ ACC ]     STREAM     LISTENING     10437 1802/cupsd         /var/run/cups/cups.sock


kill 掉进程。


Kill -93536


再次启动httpd服务
[root@localhosthttpd-2.2.6]#service httpd start


安装nagios
#useraddnagios –s /sbin/nologin
#tar zxvfnagios-3.0.6.tar.gz
#cdnagios-3.0.6


./configure--sysconfdir=/etc/nagios --with-commend-group=nagcmd --enable-event-broker


#make all 查看安装步骤
有如下内容
*** Compile finished ***

If the main program and CGIscompiled without any errors, you
can continue with installingNagios as follows (type 'make'
without any arguments for a listof all possible options):

make install
     - This installs the main program, CGIs,and HTML files

make install-init
     - This installs the init script in/etc/rc.d/init.d

makeinstall-commandmode
     - This installs and configures permissionson the
       directory for holding the externalcommand file

makeinstall-config
     - This installs *SAMPLE* config files in/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios/etc
       You'll have to modify these sample filesbefore you can
       use Nagios.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as theydetermine what/how
       things get monitored!

makeinstall-webconf
     - This installs the Apache config file forthe Nagios
       web interface


*** Support Notes*******************************************


编译安装
make all                                            安装主程序、CGIHTML文件
make install                                        /etc/rc.d/init.d 安装启动脚本
make install-init    nagios做成一个运行脚本,使nagios随系统开机启动,这是一个很方便的措施。
make install-commendmode                来配置目录权限
make install-config    把配置文件的例子复制到nagios的安装目录
make install-webconf        创建一个nagiosadmin的用户用于nagiosweb接口登录




htpasswd-c /etc/nagios/htpasswd.users nagiosadmin
Newpassword:
Re-typenew password:
Addingpassword for user nagiosadmin
配置密码。


service httpd restart                                启动apache服务
chkconfig --add nagios   nagios加入到服务中
chkconfig nagios on  开机启动
servicenagios start


Nagios-plugins 安装
[root@localhost upload]# tar zxvf nagios-plugins-1.4.13        解压
[root@localhost upload]# cd nagios-plugins-1.4.13        进入文件夹
[root@localhost nagios-plugins-1.4.13]#./configure--with-nagios-user=nagios --with-nagios-group=nagios                                        执行配置




[root@localhost nagios-plugins-1.4.13]# make            进行编译安装
[root@localhostnagios-plugins-1.4.13]# make install
[root@localhostnagios-plugins-1.4.13]# service nagios restart


关闭selinux
setenforce0


访问nagios
IP/nagios

输入账号密码。


默认已在监控localhost
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-663080-1-1.html 上篇帖子: nagios、nrpe 在centsos 和ubuntu 环境下的编译安装 下篇帖子: Nagios拒绝访问
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表