设为首页 收藏本站
查看: 605|回复: 0

[经验分享] check_oracle_health

[复制链接]

尚未签到

发表于 2018-9-15 07:51:35 | 显示全部楼层 |阅读模式
  1、下载check_oracle_health,从http://labs.consol.de/wp-content/uploads/2009/09/check_oracle_health-1.6.3.tar.gz下载源文件。
  #tar -zxvf check_oracle_health-1.6.3.tar.gz
  #cd check_oracle_health-1.6.3
  #./configure --prefix=/opt/amstar/nagios --with-nagios-user=amstar --with-nagios-group=amstar --with-mymodules-dir=/opt/amstar/nagios/libexec --with-mymodules-dyn-dir=/opt/amstar/nagios/libexec
  #make all
  #make install
  #cd /opt/amstar/nagios/libexec/
  #./check_oracle_health -h
  查看一下使用语法
  Copyright (c) 2008 Gerhard Lausser
  Check various parameters of Oracle databases
  Usage:
  check_oracle_health [-v] [-t ] --connect=
  --username= --password= --mode=
  --tablespace=
  check_oracle_health [-h | --help]
  check_oracle_health [-V | --version]
  Options:
  --connect
  the connect string
  --username
  the oracle user
  --password
  the oracle user's password
  --warning
  the warning range
  --critical
  the critical range
  --mode
  the mode of the plugin. select one of the following keywords:
  tnsping                          (Check the reachability of the server)
  connection-time                  (Time to connect to the server)
  connected-users                  (Number of currently connected users)
  sga-data-buffer-hit-ratio        (Data Buffer Cache Hit Ratio)
  sga-library-cache-hit-ratio      (Library Cache Hit Ratio)
  sga-dictionary-cache-hit-ratio   (Dictionary Cache Hit Ratio)
  sga-latches-hit-ratio            (Latches Hit Ratio)
  sga-shared-pool-reload-ratio     (Shared Pool Reloads vs. Pins)
  sga-shared-pool-free             (Shared Pool Free Memory)
  pga-in-memory-sort-ratio         (PGA in-memory sort ratio)
  invalid-objects                  (Number of invalid objects in database)
  stale-statistics                 (Find objects with stale optimizer statistics)
  tablespace-usage                 (Used space in tablespaces)
  tablespace-free                  (Free space in tablespaces)
  tablespace-remaining-time        (Remaining time until a tablespace is full)
  tablespace-fragmentation         (Free space fragmentation index)
  tablespace-io-balance            (balanced io of all datafiles)
  tablespace-can-allocate-next     (Segments (of a tablespace) can allocate next extent)
  datafile-io-traffic              (io operations/per sec of a datafile)
  soft-parse-ratio                 (Percentage of soft parses)
  switch-interval                  (Time between redo log file switches)
  retry-ratio                      (Redo buffer allocation retries)
  redo-io-traffic                  (Redo log io bytes per second)
  roll-header-contention           (Rollback segment header contention)
  roll-block-contention            (Rollback segment block contention)
  roll-hit-ratio                   (Rollback segment hit ratio (gets/waits))
  roll-wraps                       (Rollback segment wraps (per sec))
  roll-extends                     (Rollback segment extends (per sec))
  roll-avgactivesize               (Rollback segment average active size)
  seg-top10-logical-reads          (user objects among top 10 logical reads)
  seg-top10-physical-reads         (user objects among top 10 physical reads)
  seg-top10-buffer-busy-waits      (user objects among top 10 buffer busy waits)
  seg-top10-row-lock-waits         (user objects among top 10 row lock waits)
  event-waits                      (processes wait events)
  event-waiting                    (time spent by processes waiting for an event)
  enqueue-contention               (percentage of enqueue requests which must wait)
  enqueue-waiting                  (percentage of time spent waiting for the enqueue)
  latch-contention                 (percentage of latch get requests which must wait)
  latch-waiting                    (percentage of time a latch spends sleeping)
  sysstat                          (change of sysstat values over time)
  sql                              (any sql command returning a single number)
  list-tablespaces                 (convenience function which lists all tablespaces)
  list-datafiles                   (convenience function which lists all datafiles)
  list-enqueues                    (convenience function which lists all enqueues)
  list-latches                     (convenience function which lists all latches)
  list-events                      (convenience function which lists all events)
  list-background-events           (convenience function which lists all background events)
  list-sysstats                    (convenience function which lists all statistics from v$sysstat)
  --name
  the name of the tablespace, datafile, wait event,
  latch, enqueue, or sql statement depending on the mode.
  --name2
  if name is a sql statement, this statement would appear in
  the output and the performance data. This can be ugly, so
  name2 can be used to appear instead.
  --regexp
  if this parameter is used, name will be interpreted as a
  regular expression.
  --units
  one of %, KB, MB, GB. This is used for a better output of mode=sql
  and for specifying thresholds for mode=tablespace-free
  Tablespace-related modes check all tablespaces in one run by default.
  If only a single tablespace should be checked, use the --name parameter.
  The same applies to datafile-related modes.
  tablespace-remaining-time will take historical data into account. The number
  of days in the past can be given with the --lookback parameter. (Default: 30)
  In mode sql you can url-encode the statement so you will not have to mess
  around with special characters in your Nagios service definitions.
  Instead of
  --name="select count(*) from v$session where status = 'ACTIVE'"
  you can say
  --name=select%20count%28%2A%29%20from%20v%24session%20where%20status%20%3D%20%27ACTIVE%27
  For your convenience you can call check_oracle_health with the --encode
  option and it will encode the standard input.
  Send email to gerhard.lausser@consol.de if you have questions
  regarding use of this software.
  Please include version information with all correspondence (when possible,
  use output from the --version option of the plugin itself).
  特别注意使用该插件需要先安装perl访问oracle的cpan,DBD::Oracle。安装方法:见上一篇文章
  几个示范命令行:
  查询表空间使用情况
  全部表空间
  #./check_oracle_health --connect=ismp --user=usr_ismp --password=111111--mode=tablespace-usage
  指定表空间
  #./check_oracle_health --connect=ismp --user=usr_ismp --password=111111--mode=tablespace-usage --tablespace=TSP_ISMP
  tsnping:
  #./check_oracle_health --connect=ismp --user=usr_ismp --password=111111--mode=tnsping
  貌似这个插件很好很强大,可以替换掉自带check_oracle插件了。
  btw:
  如果执行命令提示:
  Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
  就是缺少了HiRes.pm,下载安装就好了。
  #wget http://www.perl.com/CPAN/modules/by-module/Time/Time-HiRes-01.02.tar.gz
  #cd Time-HiRes-01.02
  #perl Makefile.PL
  #make all
  #make install


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-583126-1-1.html 上篇帖子: Oracle技术之RAC Voting disk和OCR的管理 下篇帖子: linux下oracle开机启动
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表