已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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.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/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#UsingRRDswillspeedupthingsinlargerInstalltions.#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:TheRRDsPerlModulesarenotfoundonyourSystem#UsingRRDswillspeedupthingsinlargerInstalltions.#makeallmakeinstallmakeinstall-configmakeinstall-initll/usr/local/nagios/libexec/|grepprocess问题:configure报错checkingforlinkerflagsforloadablemodules.-sharedcheckingforPerlModuleTime:HiRes.noconfigure:error:PerlModuleTime:HiResnotavailable解决:yuminstallperl-Time-HiResy(一般不会发生)5、cd /usr/local/nagios/etc/cp nagios.cfg nagios.cfg.orivi nagios.cfg +835833process_performance_data=1834835836837#HOSTANDSERVICEPERFORMANCEDATAPROCESSINGCOMMANDS838#Thesecommandsarerunaftereveryhostandservicecheckis839#performed.Thesecommandsareexecutedonlyifthe840#enable_performance_dataoption(above)issetto1.Thecommand841#argumentistheshortnameofacommanddefinitionthatyou842#defineinyourhostconfigurationfile.ReadtheHTMLdocsfor843#moreinformationonperformancedata.844845host_perfdata_command=process-host-perfdata #取消注释846service_perfdata_command=process-service-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-perfdatacommand_line/usr/local/nagios/libexec/process_perfdata.pl 检查语法,重启服务/etc/init.d/nagios checkconfig/etc/init.d/nagios reload/etc/init.d/httpd start访问:1/nagios/pnp/index.php 主机出图在vi hosts.cfg define host use linux-server host_name 204-zhuangjiajun alias 204-zhuangjiajun address 04 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_interval 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 that 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 ; Notifications 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_nrpe!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 checks 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_enabled 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 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 times 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 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 DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$ 实现效果:nagios报警邮件报警邮件转短信短信网关=老男孩推荐如果有值班 页面显示,由人打电话微信绑定邮箱对于不紧急的选择邮件报警,重要紧急的报警选择邮件+短信老男孩思想:花一定的费用,把业务做到最好,如果报警报不出来,损失更大重要报警思想该报的报出来,不该报的一点不要报出来配置报警步骤0、 开发短信报警脚本(短信网关需要收费的)rootoldboy-Alibexec#pwd/usr/local/nagios/libexecrootoldboy-Alibexec#catsms_send#!/bin/shPROGNAME=basename$0PROGPATH=echo$0|sed-es,/*$,print_usage()echoUsage:echo/bin/sh$PR
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 内部员工比赛规则制度
- 内部审计调查制度
- 内部形成沟通制度
- 内部政治安全防范制度
- 内部治安保卫生制度
- 内部生产稽核制度
- 内部联络单制度
- 内部转运制度
- 学校内部人员制度
- 游戏策划与开发工程师的面试经验
- 燃气具安装维修培训课件
- DB22∕T 3259-2021 健康儿童及青少年心肌酶参考区间规范
- 2024年珠海辅警协警招聘考试真题附答案详解(完整版)
- 知到《微观经济学(重庆财经学院)》智慧树网课完整版章节测试答案
- 《自我管理》课件-2. 第一单元第二课 认清自身角色
- 交通运输执法培训知识课件
- 2025年9月17日事业单位联考《综合应用能力(A类)》试题及答案
- 5年(2021-2025)高考1年模拟化学真题分类汇编专题14 化学实验探究综合题(北京专用)(原卷版)(北京专用)
- 新疆可爱的中国课件
- 城市社会学-课件 第九章 城市社会发展
- 2024年吉林省高职高专单独招生考试数学试卷真题(精校打印)
评论
0/150
提交评论