首页 > 其他分享 >nagios

nagios

时间:2022-11-21 17:57:44浏览次数:64  
标签:enabled nagios etc usr local check

[masamaso@cscc ~]$ ip a
    inet 192.168.254.181/20 brd 192.168.255.255 scope global eth0    inet 10.2.0.181/29 brd 10.2.0.183 scope global eth0:0    inet 172.16.1.181/20 brd 172.16.15.255 scope global eth1
    inet 10.16.0.181/20 brd 10.16.15.255 scope global eth2

-----------------添加客户端------------

0 0 62sudo su - root
/usr/local/sbin/add_nagios.sh

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



ssh 192.168.253.242
 /etc/init.d/nagios restart
检测配置文件是否有问题
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios checkconfig如果需要其他端口  参考以下目录的配置文件,修改到要监控主机的末尾
cd /usr/local/nagios/etc/objects/service
vim 192.168.244.49.cfg 
define service{
use                 generic-service,srv-pnp
host_name           192.168.244.49    # 这个修改成要监控的主机的ip
service_description check-nginx       # 监控项描述
check_command       check_tcp!80      # 要检测的端口
  contact_groups  jincin-db
        notification_period     24x7
        initial_state   o
        check_interval  5
        retry_interval  1
        max_check_attempts 5
        active_checks_enabled   1
        passive_checks_enabled  1
        obsess_over_service        1
        event_handler_enabled   1
        low_flap_threshold      0
        high_flap_threshold     0
        flap_detection_enabled  1
        flap_detection_options  o,w,c,u
        freshness_threshold     0
        check_freshness 0
        notification_options    w,u,c,r
        notifications_enabled   1
        notification_interval   30
        first_notification_delay        0
        stalking_options        n
        process_perf_data       1
        failure_prediction_enabled      1
        retain_status_information       1
        retain_nonstatus_information    1
}

nagios服务端重启

 /etc/init.d/nagios restart
-=-

nagios客户端重启  记的加入rc.local

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
 ps -ef |grep nrpe

修改管理员密码 默认用户名nagiosadmin

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
nagios添加后的主机在vim /usr/local/nagios/etc/objects/host.cfg 


来自为知笔记(Wiz)

标签:enabled,nagios,etc,usr,local,check
From: https://www.cnblogs.com/kaixin940/p/16912144.html

相关文章

  • 重启Nagios时报错“Failed to restart nagios.service: Unit not found”
     问题:执行完命令/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg后重启Nagios报错[[email protected]]#systemctlrestartnagi......
  • Nagios配置
    其实上篇Nogios安装只是安装了Nagios基本组件,虽然能够打开主页,但是如果不配置相关配置文件文件,那么左边菜单很多页面都打不开,相当于只是一个空壳子。接下来,我们来学习研究一......
  • Nagios配置文件nagios.cfg详解
    这里开始要讲一些Nagios的配置。首先要看看目前Nagios的主配置路径下有哪些文件。[root@nagiosetc]#ll总用量152-rwxrwxr-x.1nagiosnagios18259月2414:40cgi.cf......
  • 实战配置Nagios主机及服务实战
    目录1在客户服务器上配置...11.1配置nrpe.11)加入可以监控该服务器的nagiosserver端的IP。...12)注释掉或者干脆删除199-203行即下面几行...12配置nagios监控服......
  • nagios添加被监控的机器
    此工作大约用时:30min准备工作,在被监控机上yuminstall-ygccglibcglibc-commongdgd-develxinetdopenssl-devel0客户端上增加用户/usr/sbin/useradd-m-s1,安装Na......