zoukankan      html  css  js  c++  java
  • linux之nagios安装教程

    我的系统环境是centos7,其它系统应该也差不多,只是有几条命令可能需要换种写法
    下面是我用到的命令
    363 yum install -y gcc gcc-c++ httpd php php-gd glibc glibc-common gd gd-devel perl perl-devel traceroute bind-utils ntpdate mtr wget nc mailx
    364 wget https://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.1.0/nagios-4.1.0.tar.gz
    365 tar zxf nagios-4.1.0.tar.gz
    366 cd nagios-4.1.0/
    367 useradd -m nagios
    368 passwd nagios
    369 groupadd nagcmd
    370 usermod -a -G nagcmd nagios
    371 usermod -a -G nagcmd apache
    372 ./configure –with-command-group=nagcmd
    373 make all
    374 make install
    375 make install-init
    376 make install-config
    377 make install-commandmode
    378 make install-webconf
    379 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin //增加用户,回车后需要输入密码,登录nagios时需要这个帐号和密码
    380 systemctl start httpd //开启服务
    381 getenforce //需要把防火墙和selinux关闭,selinux关闭命令 setenforce 0,防火墙关闭命令systemctl stop firewalld,如何你都没有关闭就执行这两条命令
    382 chkconfig –add nagios //添加到系统服务列表
    383 service nagios start //开启服务,这里我使用的是systemctl start nagios,提示找不到,可能是因为我没有输入上一条命令吧,反正用这条语句可以,

    [root@bogon nagios-4.1.0]# systemctl start nagios
    Failed to start nagios.service: Unit not found.
    [root@bogon nagios-4.1.0]# service nagios start
    Unit nagios.service could not be found.
    Reloading systemd:                                         [  OK  ]
    Starting nagios (via systemctl):                           [  OK  ]
    [root@bogon nagios-4.1.0]# 
    

    完成上面步骤后,效果如下
    这里写图片描述
    这个监控软件我安了好多次,终于安装好了,以后有时间再上使用教程

  • 相关阅读:
    mint17上建立lamp环境
    iptables开始ftp
    查看mysql集群状态是否正常
    限制SSH访问源,禁止4A之外的地址跳转访问
    查看cpu、内存和硬盘
    降kipmi0的CPU
    更改密钥对
    eNSP
    划分分区GPT11
    修改虚机IP
  • 原文地址:https://www.cnblogs.com/biaopei/p/7730569.html
Copyright © 2011-2022 走看看