ImageVerifierCode 换一换
格式:DOCX , 页数:10 ,大小:162.82KB ,
资源ID:16913560      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/16913560.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(nagios图形监控显示和报警管理.docx)为本站会员(b****2)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

nagios图形监控显示和报警管理.docx

1、nagios图形监控显示和报警管理nagios图形监控显示和报警管理服务端1、 yum安装pnp软件需要基础包图形依赖库yuminstallcairopangozlibzlib-develfreetypefreetype-develgdgd-devel-y2、 rrdtools依赖安装 软件都在oldboy_training_nagios_soft.zipcd /toolstarxflibart_lgpl-2.3.17.tar.gzcdlibart_lgpl-2.3.17./configuremakemakeinstall/bin/cp-r/usr/local/include/libart-2

2、.0/usr/includecd./ 3、安装rrdtool软件 轮循数据库,专门画图tarxfrrdtool-1.2.14.tar.gzcdrrdtool-1.2.14./configure-prefix=/usr/local/rrdtool-disable-python-disable-tcl#WARNING:TheRRDsPerlModulesarenotfoundonyourSystem#UsingRRDswillspeedupthingsinlargerInstalltions.#configure后出现上面的提示可以不用理会。makemakeinstallcd./ls-l/usr/

3、local/rrdtool/bin 4、安装pnp pnp收集数据给rrdtool画图 rrdtool画完再给pnp展示tarzxfpnp-0.4.14.tar.gzcdpnp-0.4.14./configure-with-rrdtool=/usr/local/rrdtool/bin/rrdtool#=真正的出图的命令-with-perfdata-dir=/usr/local/nagios/share/perfdata/#=出图所用的数据路径#WARNING:TheRRDsPerlModulesarenotfoundonyourSystem#UsingRRDswillspeedupthings

4、inlargerInstalltions.#makeallmakeinstallmakeinstall-configmakeinstall-initll/usr/local/nagios/libexec/|grepprocess 排错的:tarzxfpnp-0.4.14.tar.gzcdpnp-0.4.14./configure-with-rrdtool=/usr/local/rrdtool/bin/rrdtool-with-perfdata-dir=/usr/local/nagios/share/perfdata/#WARNING:TheRRDsPerlModulesarenotfoundo

5、nyourSystem#UsingRRDswillspeedupthingsinlargerInstalltions.#makeallmakeinstallmakeinstall-configmakeinstall-initll/usr/local/nagios/libexec/|grepprocess问题:configure报错checkingforlinkerflagsforloadablemodules.-sharedcheckingforPerlModuleTime:HiRes.noconfigure:error:PerlModuleTime:HiResnotavailable解决:y

6、uminstallperl-Time-HiResy(一般不会发生)5、cd /usr/local/nagios/etc/cp nagios.cfg nagios.cfg.orivi nagios.cfg +835833process_performance_data=1834835836837#HOSTANDSERVICEPERFORMANCEDATAPROCESSINGCOMMANDS838#Thesecommandsarerunaftereveryhostandservicecheckis839#performed.Thesecommandsareexecutedonlyifthe840#

7、enable_performance_dataoption(above)issetto1.Thecommand841#argumentistheshortnameofacommanddefinitionthatyou842#defineinyourhostconfigurationfile.ReadtheHTMLdocsfor843#moreinformationonperformancedata.844845host_perfdata_command=process-host-perfdata #取消注释846service_perfdata_command=process-service-

8、perfdata 删除之前的内容删除两个命令定义:process-host-perfdata、process-service-perfdata添加如下 #process-host-perfdatacommanddefinitiondefinecommandcommand_nameprocess-host-perfdatacommand_line/usr/local/nagios/libexec/process_perfdata.pl#process-service-perfdatacommanddefinitiondefinecommandcommand_nameprocess-service

9、-perfdatacommand_line/usr/local/nagios/libexec/process_perfdata.pl 检查语法,重启服务/etc/init.d/nagios checkconfig/etc/init.d/nagios reload/etc/init.d/httpd start访问:http:/10.0.0.11/nagios/pnp/index.php 主机出图在vi hosts.cfg define host use linux-server host_name 204-zhuangjiajun alias 204-zhuangjiajun address 1

10、0.0.0.204 action_url /nagios/pnp/index.php?host=$HOSTNAME$ 也可以添加在模板vi templates.cfg搜索/linux-serverdefine host name linux-server ; The name of this host template check_period 24x7 ; By default, Linux hosts are checked round the clock check_interval 5 ; Actively check the host every 5 minutes retry_in

11、terval 1 ; Schedule host check retries at 1 minute intervals max_check_attempts 10 ; Check each Linux host 10 times (max) check_command check-host-alive ; Default command to check Linux hosts notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day ; Note th

12、at the notification_period variable is being overridden from ; the value that is inherited from the generic-host template! notification_interval 120 ; Resend notifications every 2 hours notification_options d,u,r ; Only send notifications for specific host states contact_groups admins ; Notification

13、s get sent to the admins by default register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!action_url /nagios/pnp/index.php?host=$HOSTNAME$ 效果:服务出图vi services.cfgdefine service use generic-service host_name 204-zhuangjiajun service_description memory check_command check_nr

14、pe!check_memory.pl action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$同样也可以配置到模板vi templates.cfg搜索/servicedefine service name generic-service ; The name of this service template active_checks_enabled 1 ; Active service checks are enabled passive_checks_enabled 1 ; Passive service chec

15、ks are enabled/accepted parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) obsess_over_service 1 ; We should obsess over this service (if necessary) check_freshness 0 ; Default is to NOT check service freshness notifications_ena

16、bled 1 ; Service notifications are enabled event_handler_enabled 1 ; Service event handler is enabled flap_detection_enabled 1 ; Flap detection is enabled failure_prediction_enabled 1 ; Failure prediction is enabled process_perf_data 1 ; Process performance data retain_status_information 1 ; Retain

17、status information across program restarts retain_nonstatus_information 1 ; Retain non-status information across program restarts is_volatile 0 ; The service is not volatile check_period 24x7 ; The service can be checked at any time of the day max_check_attempts 3 ; Re-check the service up to 3 time

18、s in order to determine its final (hard) state normal_check_interval 10 ; Check the service every 10 minutes under normal conditions retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined contact_groups admins ; Notifications get sent out to everyone in

19、the admins group notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events notification_interval 60 ; Re-notify about service problems every hour notification_period 24x7 ; Notifications can be sent out at any time register 0 ; DONT REGISTER THIS DEFINIT

20、ION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$ 实现效果:nagios报警邮件报警邮件转短信短信网关 =老男孩推荐如果有值班 页面显示,由人打电话微信绑定邮箱对于不紧急的选择邮件报警,重要紧急的报警选择邮件+短信老男孩思想:花一定的费用,把业务做到最好,如果报警报不出来,损失更大重要报警思想该报的报出来,不该报的一点不要报出来配置报警步骤1、 开发短信报警脚本(短信网关需要收费的)rootoldboy-Alibexe

21、c#pwd/usr/local/nagios/libexecrootoldboy-Alibexec#catsms_send#!/bin/shPROGNAME=basename$0PROGPATH=echo$0|sed-es,/*$,print_usage()echoUsage:echo/bin/sh$PROGNAMEtitlecontactexit1if$#-ne2;thenprint_usagefialert_date=$(date+%y-%m-%d%H:%M)TITLE=$1#FORMATHost$HOSTSTATE$alertfor$HOSTNAME$CONTACT=$2#curl方式c

22、url-dcdkey=3RTY-EMY-0980-MTUQ2-dpassword=189162-dphone=$CONTACT-dmessage=$TITLE$alert_dateoldboysa#wget-quiethttp:/s.ccme.cc/qxt/send.jsp?circle=159net_131&pwd=oldboy123&mobile=18911718229&service=f1fb0546-ebb6-0987-8f20-560524c1f88d&msgid=3956724&message=$TITLE$alert_dateoldboysan 2、 添加联系人联系组contacts.cfg3、 添加报警的命令commands.cfg4、 调整联系人模板,添加报警的命令(来自于commands.cfg命令)(逗号,后面再加命令)5、 host.cfg,services.cfg添加报警联系人及组,或者对应模板加contact_groups admin,sa本周作业:1、 监控RAID,CPU温度2、 自定义插件出图3、 完成cacti部署,出图

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1