温馨提示×

温馨提示×

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

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

Nagios备忘之安装

发布时间:2020-04-08 16:38:00 来源:网络 阅读:413 作者:opskumu 栏目:移动开发

#################################Server端####################################

----------------

Nagios

----------------

源码包地址:http://sourceforge.net/projects/nagios/?source=directory

建立nagios账号:
# useradd nagios && passwd nagios
# groupadd nagcmd //nagcmd用于从web接口执行外部命令
# usermod -G nagcmd nagios
# usermod -G nagcmd daemon

安装nagios:
# tar xf nagios.xx.xx
# ./configure --with-command-group=nagcmd --with-nagios-user=nagios --with-nagios-group=nagios
# make all
# make install
# make install-init --> 生成init启动脚本
# make install-commandmode --> 设置相应的目录权限
# make install-config --> 生成模板配置文件
# make install-webconf --> 生成apache配置文件

# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin


# yum install httpd
# cp /etc/httpd/conf/nagios.conf /usr/local/apache2/conf/extra/nagios.conf
# vim /usr/local/apache2/conf/httpd.conf
include conf/extra/nagios.conf

# chkconfig --add nagios
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# /etc/init.d/nagios start

测试:http://IP/nagios/
###############################################Server端###############################################

 

#################################Server端和Client端安装################################

安装nagios插件
-----------------------
nagios-plugin.xx.xx

-----------------------

源码地址:http://sourceforge.net/projects/nagiosplug/

# tar xf nagios-plugin.xx.xx
# cd nagios-plugin.xx.xx
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
# make && make install

# pwd
/usr/local/nagios/libexec
// 插件安装后的文件

-----------------------

nrpe
监控linux本地主机时,我们可以直接更改配置文件进行监控,如果需要监控的主机与nagios不在同一机器上,即监控远程linux主机时,需要借助NRPE插件实现。

-----------------------

源码地址:http://sourceforge.net/projects/nrpe/?source=directory

# ./configure
# make
# make all
# make install-plugin
# make install-daemon
# make install-daemon-config
# vim /usr/local/nagios/etc/nrpe.cfg

allowed_hosts=127.0.0.1,192.168.1.20 #逗号隔开,授权Server获取check_nrpe

# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg ‐d //启动
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 //输出表示nrpe配置成功
NRPE v2.12

###############################Server端和Client端安装##################################

向AI问一下细节

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

AI