基于FreeBSD+nagios下的系统告警系统
2010-04-23 14:40
344 查看
-----------------------------------主要软件应用-------------------------FreeBSD apache22 php5 php5-extension Ngios Nagios-plugin Nrpe NSCclient++-----------------------------------------系统安装-------------------------1.FreeBSD采用最小化安装2.更新ports# portsnap fetch#portsnap extract---------------------------------------------软件安装------------------------1. Nagios# cd /usr/ports//net-mgmt/nagios/# make instal clean//此过程会询问建立用户和组nagios2. Nagios-plugin# cd /usr//net-mgmt/nagios-plugin/# make install3. NRpe 下载地址为: http://www.nagios.org/download/addons //如果所要监控的服务器中有linux,不要直接使用ports 安装,因为ports安装过后,其格式为check_nrpe2, 但是linux 采用源码安装的为check_nrpe. 从而导致两者之间不能通信# cd /usr/local# tar zxvf nrpe-2.12.tar.gz# cd nrpe-2.12# ./configure# make # make install网页服务器的安装请参考前人的文章------------------------------------------------配置文件-------------------------1.查看/var/spool/nagios/下有没如下文件或文件夹,没则建立drwxrwxr-x 2 nagios nagios 3072 Apr 23 00:00 archivesdrwxrwxr-x 2 nagios nagios 512 Apr 23 13:53 checkresults-rw-r--r-- 1 nagios nagios 1416 Feb 2 15:15 dead.letter-rw-r--r-- 1 nagios nagios 0 Jan 27 11:30 nagios.debug-rw-r--r-- 1 nagios nagios 4 Apr 21 16:45 nagios.lock-rw-r--r-- 1 nagios nagios 19371 Apr 23 13:45 nagios.log-rw-r--r-- 1 nagios nagios 0 Jan 26 14:31 object.cache-rw-r--r-- 1 nagios nagios 0 Jan 26 14:31 object.precache-rw-r--r-- 1 nagios nagios 125106 Apr 21 16:45 objects.cache-rw------- 1 nagios nagios 203289 Apr 23 13:45 retention.datdrwxrwxr-x 2 nagios nagios 512 Apr 21 16:45 rw-rw-rw-r-- 1 nagios nagios 202933 Apr 23 13:53 status.dat-rw-r--r-- 1 nagios nagios 0 Apr 21 16:45 status.sav2. # ee /usr/local/etc/nagios/nagios.cfg //添加如下两行 cfg_file=/usr/local/etc/nagios/objects/linux.cfgcfg_file=/usr/local/etc/nagios/objects/windows.cfg3.# cd /usr/local/etc/nagios/object/# ee linux.cfg ``````````````````````````````````````````````````````````````````````````````````````````` define hostgroup{ hostgroup_name linux-servers ; The name of the hostgroup alias linux Servers ; Long name of the group members vici01,vici02,vici04 }###################### Server CPU Check ######################define service{ use generic-service host_name vici01,vici02,vici04 service_description CPU Load check_command check_nrpe!check_load }###################### / Driver Space ######################## define service{ use generic-service ; Name of service template to use host_name vici01,vici02,vici04 service_description / Drive Space check_command check_nrpe!check_/ }###################### Ping Check #######################define service{ use generic-service host_name vici01,vici02,vici04 service_description PING check_command check_ping!100.0,20%!500.0,60% }###################### mysql Check #######################define service{ use generic-service host_name vici01 service_description Mysql check_command check_mysql }#################### Host define config################# define host{ use linux-server host_name vici01 alias vicidial01 Server address 192.168.2.xx }define host{ use linux-server host_name vici02 alias vicidial02 Server address 192.168.2.xx }define host{ use linux-server host_name vici04 alias vicidial04 Server address 192.168.1.xx }`````````````````````````````````````````````````````````````````````````````````````````````````4. # ee windows.cfg```````````````````````````````````````````````````````````````````````````````````````````````define hostgroup{ hostgroup_name windows-servers ; The name of the hostgroup alias windows Servers ; Long name of the group members axisoft-symatec,axiadsvr01 }###################### Server Uptime Check ######################define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description Uptime check_command check_nt!UPTIME }##################### Server CPU Check #########################define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description CPU Load check_command check_nt!CPULOAD!-l 5,80,90 }##################### Server Memory Check ###################### define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description Memory Usage check_command check_nt!MEMUSE!-w 80 -c 90 }###################### C Driver Space ######################## define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description C:\ Drive Space check_command check_nt!USEDDISKSPACE!-l c -w 98 -c 99 }################## D Driver Check #########################define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description D:\ Drive Space check_command check_nt!USEDDISKSPACE!-l d -w 98 -c 99 }################ E Driver Check ###########################define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description E:\ Drive Space check_command check_nt!USEDDISKSPACE!-l e -w 98 -c 99 }###################### F Driver Check ########################define service{ use generic-service ; Name of service template to use host_name axiadsvr01 service_description F:\ Drive Space check_command check_nt!USEDDISKSPACE!-l f -w 98 -c 99 }###################### Ping Check #######################define service{ use generic-service ; Name of service template to use host_name axisoft-symatec,axiadsvr01 service_description PING check_command check_ping!100.0,20%!500.0,60% }######################## Host define config#################define host{ use windows-server host_name axisoft-symatec alias endpoint address 192.168.2.xx }define host{ use windows-server host_name axiadsvr01 alias AD Server address 192.168.2.xx } ``````````````````````````````````````````````````````````````````````````````````````````````````4.# ee /usr/local/nagios/nrpe.cfglog_facility=daemonpid_file=/var/spool/nagios/nrpe.pidserver_port=5666nrpe_user=nagiosnrpe_group=nagiosallowed_hosts=127.0.0.1 192.168.xx.xxdont_blame_nrpe=0debug=0command_timeout=60connection_timeout=300command[check_users]=/usr/local/libexec/nagios/check_users -w 5 -c 10command[check_load]=/usr/local/libexec/nagios/check_load -w 15,10,5 -c 30,25,20command[check_/]=/usr/local/libexec/nagios/check_disk -w 10% -c 5% -p /command[check_var]=/usr/local/libexec/nagios/check_disk -w 10% -c 5% -p /varcommand[check_tmp]=/usr/local/libexec/nagios/check_disk -w 10% -c 5% -p /tmpcommand[check_usr]=/usr/local/libexec/nagios/check_disk -w 10% -c 5% -p /usrcommand[check_home]=/usr/local/libexec/nagios/check_disk -w 10% -c 5% -p /homecommand[check_zombie_procs]=/usr/local/libexec/nagios/check_procs -w 5 -c 10 -s Zcommand[check_total_procs]=/usr/local/libexec/nagios/check_procs -w 150 -c 200 `````````````````````````````````````````````````````````````````````````````````````````````````5.# ee /usr/local/etc/apache22/Include/nagios.cfg````````````````````````````````````````````````````````````````````````````````````````ScriptAlias /nagios/cgi-bin "/usr/local/www/nagios/cgi-bin"<Directory "/usr/local/www/nagios/cgi-bin">AuthType BasicOptions ExecCGIAllowOverride NoneOrder allow,denyAllow from allAuthName "Nagios Access"AuthUserFile /usr/local/etc/nagios/htpasswd.usersRequire valid-user</Directory>Alias /nagios "/usr/local/www/nagios"<Directory "/usr/local/www/nagios">AuthType BasicOptions NoneAllowOverride NoneOrder allow,denyAllow from allAuthName "nagios Access"AuthUserFile /usr/local/etc/nagios/htpasswd.usersRequire valid-user</Directory>至此,服务器端已完成,客户端待续```````````
linux 下的客户端安装,请参照如下附件:
本文出自 “展望过去” 博客,请务必保留此出处http://gnnjw.blog.51cto.com/361372/303429
linux 下的客户端安装,请参照如下附件:
本文出自 “展望过去” 博客,请务必保留此出处http://gnnjw.blog.51cto.com/361372/303429
相关文章推荐
- 基于FreeBSD+nagios下的系统告警系统 (window客户端安装)
- 基于FreeBSD与Fetion.py,nagios的飞信告警系统
- 基于 Linux 系统的Nagios网络管理模块的实现
- 基于linux系统nagios安装介绍(一)
- 搭建基于Nagios的监控系统——之监控远程Linux服务器
- 基于Nginx平台部署Nagios监控系统
- linux rhel unix centos FreeBSD 查看CPU核数使用率 系统 位 内存大小 硬盘 HBA光纤卡号 常用命令
- 搭建基于nginx环境的nagios监控系统
- FreeBSD 6.0架设管理与应用-第十九章 数据库系统
- 搭建基于Nagios的监控系统——之监控远程Windows服务器
- FreeBSD8.2系统安装Salt
- 华北工控首推基于Freescalei.MX53平台的嵌入式精准系统
- FreeBSD系统SSH连接不上?
- FreeBSD系统编程[简体中文版]
- freebsd升级系统 (8.0~8.2)
- 多系统安装实践(Window /FreeBSD/Linux)
- 搭建基于Nagios的监控系统——之安装Nagios Core
- FREEBSD操作系统更改系统时间
- 做为一个菜鸟,打算从今天开始系统的学习freebsd
- 搭建基于Nagios的监控系统——之监控远程Windows服务器