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

nagios 监控笔记(一)

[复制链接]

尚未签到

发表于 2019-1-17 09:12:54 | 显示全部楼层 |阅读模式
Nagios监控主机笔记(一)
参考资料
http://sery.blog.运维网.com
http://blog.myspace.cn/yangbo0015/category/500769.aspx
nagios 监控目的
             即时了解服务器运行状况,服务运行情况,通过mail、手机短信、声音报警通知管理员,以便处理问题

一、nagios 监控分为二个部份:
        1)、nagios服务器端(以下简称server端)
server端所需软件包:   Apache、nagios-3.0.6、nrpe-2.8.1、nagios-plugins-1.4.13、sendmail、nagios-mysql-plugins、nagios-mysql-plugins-0.3.tar.gz、perl等


        2)、监控服务器端(以下简称client端)
client端所需软件包:
nrpe-2.8.1、nagios-plugins-1.4.13等
nagios、nagios-plugins、nrpe下载地址http://www.nagios.org/download/
nagios是一款开源的监控软件,能够对网络内的主机和硬件设备进行状态监控。
功能:
     1. 状态监控
     2. 预警报告
     3. 集中,规模化管理
     4. web可视化显示方式
     5. 自定义shell脚本或插件实现更多的功能
     官方网站 http://www.nagios.org
NRPEnagios的一个扩展,它被用于被监控的服务器上,向nagios监控平台提供该服务器的一些本地的情况。例如,cpu负载、内存使用、硬盘使用等等。
nagios-plugins是nagios监控服务器的插件
nagios-mysql-plugins、nagios-mysql-plugins 是监控mysql服务器的插件
二、nagios服务器的安装
   1)、nagios安装
root@nagios#useradd nagios -s /sbin/nologin
mkdir /usr/local/nagios
tar zxvf nagios-3.0.6
cd nagios
./configure –prefix=/usr/local/nagios ----with-nagios-user=nag ios --with-nagios-group=nagios   
make all
make install     
make install-commandmode
make install-config




2)、Apache安装与配置
       tar zxvf httpd-2.2.8.tar.gz
cd httpd-2.2.8
./configure    --prefix=/usr/local/apache   
make
make install



            配置nagios如下
在apache的配置httpd.conf中加入
include conf/nagios.conf
nagios.conf内容如下
NameVirtualHost *:80

     ServerName localhost
     DirectoryIndex index.html index.php
     Alias /nagios/cgi-bin /usr/local/nagios/sbin
     
       AuthType Basic
       Options ExecCGI
       AddHandler cgi-script cgi pl
       AllowOverride None
       Order allow,deny
       Allow from all
#       AuthName "Nagios Access"
#      AuthUserFile /usr/local/nagios/etc/htpasswd
#       Require valid-user
     

    Alias /nagios /usr/local/nagios/share
     
      AuthType Basic
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
#      AuthName "nagios Access"
#     AuthUserFile /usr/local/nagios/etc/htpasswd
#      Require valid-user
   



创建http验证用户htpasswd文件,用户名为test,密码可以随便设置
root@nagios#htpasswd -c /usr/local/nagios/etc/htpasswd test
New password:
Re-type new password:
Adding password for user test


          3)、nagios-plugins安装
tar zxvf nagios-plugins-1.4.13
cd nagios-plugins
./configure --prefix=/usr/local/nagios
#安装目录选择/usr/local/nagios,因为该目录下的libexec目录下的插件是nagios监控所需要的
make && make install


4)、检查远程服务器nrpe 连接,可显示版本号。如果能正确显示版本号,说明nrpe 服务能正常连接.
/usr/local/nrpe/libexec/check_nrpe -H 192.168.1.22
NRPE v2.12


三、client服务端的安装与配置
        1)、nagios-plugins安装
root@client#mkdir /usr/local/nagios
tar zxvf nagios-plugins-1.4.13   
cd nagios-plugins   
./configure --prefix=/usr/local/nagios
make && make install



      2)、nrpe安装
root@client#mkdir /usr/local/nrpe
tar zxvf nrpe-2.8.1
cd nagios
./configure --prefix=/usr/local/nrpe
make && make install

    3)、windows客户端的安装nsclient
下载nsclient包 下载地址:http://sourceforge.net/projects/nscplus
nsclient_201.zip
解压包到c:\nsclient
打开cmd命令行提示符输入:
c:
cd c:\nsclient
pNSClient.exe /install
net start nsclient
安装完成





附件:http://down.运维网.com/data/2352400


运维网声明 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-664231-1-1.html 上篇帖子: nagios 参数介绍 下篇帖子: nagios 监控笔记(二)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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