Home Database Mysql Tutorial Nagios监控Oracle(check_oracle_health)

Nagios监控Oracle(check_oracle_health)

Jun 07, 2016 pm 04:59 PM
nagios

Nagios自带的oracle监控check_oracle功能较少,可以采用perl写的check_oracle_health脚本1、安装check_oracle_health

Nagios自带的Oracle监控check_oracle功能较少,,可以采用perl写的check_oracle_health脚本

1、安装check_oracle_health

wget

wget 

版本任意选(此处使用1.6.3)

tar zxvf check_oracle_health-1.6.3.tar.gz

cd check_oracle_health-1.6.3
./configure --prefix=/usr/local/nagios/ --with-nagios-user=nagios --with-nagios-gourp=nagios --with-mymodules-dir=/usr/local/nagios/libexec/ --with-mymodules-dyn-dir=/usr/local/nagios/libexec/

#指定用户、用户组以及目标路径等
make all

make install

2、设定系统环境变量

root下,编辑.bash_profile,插入oracle用户的环境变量,要和oracle用户的.bash_profile文件中设置的一样

export PATH
unset USERNAME
PS1="\[\e[0m\][\u@\[\e[32;1m\]`/sbin/ifconfig eth0 | grep "inet addr" | sed -e "s/^.*inet addr:\(.*\) Bcast.*$/\1/"`\[\e[0m\]\W]# "
export PS1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.1/db
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=qiyue
                          

3、安装perl的oracle插件

① wget 

    tar zxvf DBI-1.609.tar.gz

    cd DBI-1.609

    perl Makefile.PL
    make all 

    make install
② wget  

    tar -zxvf DBD-Oracle-1.24a.tar.gz 
    cd DBD-Oracle-1.24
    perl Makefile.PL             #此处如果之前不设定root的oracle环境变量会报错

    make all

    make install

③ 如果在运行脚本时报错

    Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
    wget
    tar zxvf Time-HiRes-01.02.tar.gz

    cd Time-HiRes-01.02
    perl Makefile.PL
    make all
    make install

4、测试

cd /usr/local/nagios/libexec

 ./check_oracle_health --connect=nagios --username system --password ora123 --mode connected-users
OK - 11 connected users | connected_users=11;50;100

./check_oracle_health --connect=nagios --username system --password ora123 --mode=tnsping
OK - connection established to nagios.

5、其余配置和nagios配置相同

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

See all articles