温馨提示×

温馨提示×

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

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

nagios 日常维护

发布时间:2020-03-20 11:56:19 来源:网络 阅读:656 作者:hzhgz2006 栏目:移动开发

1.nagios 启动(root身份)

/etc/init.d/nagios restart

(/etc/init.d/xinetd restart 重启nsca,用于接收客户端的数据,端口为5667,接收数据出现问题时,需要重启)

2.nagios 配置文件编辑

(su - nagios编辑)

1/usr/local/nagios/etc/objects/hostgroups.cfg中定义hostgroup,有时禁用host,需要在这里把相应主机注释掉

 

define hostgroup{

        hostgroup_name  NETWORK-DEVICE Group

        alias NETWOKR_DEVICE

        members  FW01

        }

 

 

2)/usr/local/nagios/etc/nagios.cfg (禁用主机注释掉相应主机配置文件)

cfg_file=/usr/local/nagios/etc/objects/DB1.cfg


 


3.检查配置,

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 用来检查配置是否有问题,

出现这样的说明没问题

.........

Total Warnings: 0

Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

再用root重启/etc/init.d/nagios restart 



常用脚本


客户端

useradd -u 2001 -s /sbin/nologin nagios

cd /usr/local

tar -xzvf nagios.tar.gz

sed -i "s/WEB2/DB3/g"  /usr/local/nagios/exe_scripts.sh  

echo "*/2 * * * * sh /usr/local/nagios/exe_scripts.sh >/dev/null 2>&1" >>/var/spool/cron/nagios

 

服务端

sed -i "s/ DB1/DB3/g"  /usr/local/nagios/etc/objects/DB3.cfg

sed -i "s/address 10.99.2.40/address 10.99.2.42/g"  /usr/local/nagios/etc/objects/DB3.cfg


向AI问一下细节

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

AI