Giter Site home page Giter Site logo

zabora's Introduction

zabora

Oracle Monitoring

This script is part of a monitoring solution that allows to monitor several services and applications.

For more information about this monitoring solution please check out this post on my site.

Star History

Star History Chart

Dependencies

Packages

  • ksh

Debian/Ubuntu

~# sudo apt install ksh
~#

Red Hat

#~ sudo yum install ksh
~#

User account

We will need an account to perform all the checks. Below are the sentences to do it.

CREATE USER monitor IDENTIFIED BY 'xxxxxxx' DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK;
GRANT CONNECT TO monitor;
GRANT RESOURCE TO monitor;
ALTER USER monitor DEFAULT ROLE ALL;
GRANT SELECT ANY TABLE TO monitor;
GRANT CREATE SESSION TO monitor;
GRANT SELECT ANY DICTIONARY TO monitor;
GRANT UNLIMITED TABLESPACE TO monitor;
GRANT SELECT ANY DICTIONARY TO monitor;
GRANT SELECT ON V_$SESSION TO monitor;
GRANT SELECT ON V_$SYSTEM_EVENT TO monitor;
GRANT SELECT ON V_$EVENT_NAME TO monitor;
GRANT SELECT ON V_$RECOVERY_FILE_DEST TO monitor;

Deploy

The username and the password can't be empty. Default variables:

NAME VALUE
ORACLE_USER monitor
ORACLE_PASS xxxxxxx
ORACLE_OSID oracle

Note: these variables have to be saved in the config file (zabora.conf) in the same directory than the script.

Zabbix

~# git clone https://github.com/sergiotocalini/zabora.git
~# ./zabora/deploy_zabbix.sh -H
Usage:  [Options]

Options:
  -F            Force configuration overwrite.
  -H            Displays this help message.
  -P            Installation prefix (SCRIPT_DIR).
  -Z            Zabbix agent include files directory (ZABBIX_INC).
  -u            Configuration key ORACLE_USER.
  -p            Configuration key ORACLE_PASS.
  -o            Configuration key ORACLE_OSID.

Please send any bug reports to [email protected] (https://github.com/sergiotocalini)
~# ORACLE_USER="monitor"
~# ORACLE_PASS="xxxxxxx"
~# ORACLE_OSID="oracle"
~# sudo ./zabora/deploy_zabbix.sh -u "${ORACLE_USER}" -p "${ORACLE_PASS}" -o "${ORACLE_OSID}"
~# sudo systemctl restart zabbix-agent

Note: the installation has to be executed on the zabbix agent host and you have to import the template on the zabbix web. The default installation directory is /etc/zabbix/scripts/agentd/zabora

zabora's People

Contributors

sergiotocalini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabora's Issues

Monitore Oracle Server 11g with Zabora scripts

Hello Sergio and all.
The Sergio Zabora Project and scripts are ok and work well.
I tried to find my support case here, but I dind´t find.

For the Zabora scripts work in Redhat 7, you need to change this oracle files permissions:

cd /oracle/product/11.2.0.4/dbhome_1/bin/

chown 6751 oracle oracleO oradism

Only after the changes oracle files that Zabbix started to monitor correctly.

Hope this help. Thanks.
Igor Costa

Problem to use Zabora Plugin - ZBX_NOTSUPPORTED

Hello Sergio, I installed Zabora plugin but I have problem.
Version: Zabbix 4.0.4
Linux Version: CentOS Linux release 7.6.

Deploy:
./deploy_zabbix.sh -u "${xxxxxx}" -p "${xxxxxxx}" -o "${xxxxx}"
ls -l /etc/zabbix/scripts/agentd/zabora/
sql
zabora.conf
zabora.oraenv
zabora.sh

sql:
db_active.sql db_fra.sql db_metric.sql db_uptime.sql template
db_block.sql db_invalid.sql db_redo.sql db_version.sql
db_connection.sql db_jobs.sql db_rman.sql tb_list.sql
db_filesize.sql db_lock.sql db_size.sql tb_size.sql

zabora.conf :
ORACLE_USER="xxxxxx"
ORACLE_PASS="xxxxxxx"
ORACLE_SID="xxxxxx"

zabora.oraenv :
ORACLE_SID=xxxxx
ORACLE_VER=xxxxx
ORACLE_HOME=/xxx/xxx/xxxx/xxxx/xxxx/client_1
ORACLE_BASE=/xxxxx/xxx/xxxx/xxxxx
ORACLE_TERM=xterm
PATH=/usr/bin:/usr/sbin/:$ORACLE_HOME/bin
#NLS_LANG=AMERICAN_AMERICA.UTF8
export ORACLE_SID ORACLE_HOME ORACLE_BASE ORACLE_TERM PATH

/etc/zabbix/zabbix_agentd.d/
userparameter_mysql.conf
zabora.conf

zabora.conf:
UserParameter=zabora[],/etc/zabbix/scripts/agentd/zabora/zabora.sh -o $1 -s $2 -a $3
UserParameter=zabora.discovery[
],/etc/zabbix/scripts/agentd/zabora/zabora.sh -o $1 -s $2 -a $3 -j $4
UserParameter=zabora.version,/etc/zabbix/scripts/agentd/zabora/zabora.sh -v short

sh /etc/zabbix/scripts/agentd/zabora/zabora.sh -o $1 -s $2 -a $3
ZBX_NOTSUPPORTED

sh /etc/zabbix/scripts/agentd/zabora/zabora.sh -o $1 -s $2 -a $3 -j $4
ZBX_NOTSUPPORTED

sh /etc/zabbix/scripts/agentd/zabora/zabora.sh -v short
zabora 1.5.4

zabbix_agentd -t oracle[version]
oracle[version] [m|ZBX_NOTSUPPORTED] [Unsupported item key.]

zabbix_get -s 192.168.10.100 -p 10050 -k zabora
ZBX_NOTSUPPORTED

Can you help me or have any idea to solve this problem?
Igor

RMAN recovery after issue/problems

Trigger after "Oracle: RMAN has problems" keeps triggerd and is not resolved.

for example: There was an issue last weekend, issue resolved and already 2 new RMAN cycled finished completed without errors.

If I manually run the SQL : "db_rman.sql" everything is OK now, output : 0 like expected.
But in zabbix the problem is still there, also latest data shows only the timestamp of the last error happening.

Is this normal behavior and/or how do you handle this?

tb_size.sql script

I implemented the zabora agent on my oracle DB and found out that the tb_size.sql in the package was not giving the right value.
I wrote another script that shows the right value now

SET pagesize 0
SET heading OFF
SET feedback OFF
SET verify OFF
select round((1-sum(nvl(fre.bytes,0))/tot.bytes)*100,2) "pct_used"
from dba_free_space fre,
(select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name) tot, dba_tablespaces tbs
where tot.tablespace_name = tbs.tablespace_name
and fre.tablespace_name(+) = tbs.tablespace_name
and fre.tablespace_name = UPPER('&1')
group by tot.bytes/1024, tot.bytes;
QUIT;

Zabora with Container Databases (CDB) and Pluggable Databases (PDB)

Hello Sergio, we've installed Zabora plugin but we have some problem.
Version: Zabbix 4.0.3
Linux Version: Oracle Linux Server release 7.4
Zabora 1.5.4

We are using Oracle Container Database (CDB) with Pluggable Databases.
If we point to the Container Database, zabora.sh works pretty fine, but we need to monitor the pluggable database. And if we try to point to that the script hangs whitout any result.

Example:

export ORACLE_SID=CONTAINERDB
ksh /etc/zabbix/scripts/agentd/zabora/zabora.sh -o "${ORACLE_SID}" -s db_version -a 1
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
export ORACLE_SID=PLUGGABLEDB
ksh /etc/zabbix/scripts/agentd/zabora/zabora.sh -o "${ORACLE_SID}" -s db_version -a 1
hangs with no result

Do you have any idea?

Inside /etc/oratab we have something like:
CONTAINERDB:/oracle12c/app/oracle/product/12c:Y

And if we try to change there CONTAINERDB with PLUGGABLEDB, the script doesn't works.

Thanks in advance for any suggestion.

Use problem

Configured on the host. Imported a template to Zabbix.
Of all the data elements, only the database version works, all the others marked "Not supported", when you hover we get an error:
Value "SQLPlus: Release 12.2.0.1.0 Production Copyright (c) 1982, 2016, Oracle. All rights reserved. Use SQLPlus to execute SQL, PL/SQL and SQLPlus statements. Usage 1: sqlplus -H | -V -H Displays the SQLPlus version and the usage help. -V Displays the SQLPlus version. Usage 2: sqlplus [ [] [{logon | /nolog}] [] ] is: [-AC] [-C ] [-L] [-M ""] [-NOLOGINTIME] [-R ] [-S] -AC Enable Application Continuity. -C Sets the compatibility of affected commands to the version specified by . The version has the form "x.y[.z]". For example, -C 10.2.0 -L Attempts to log on just once, instead of reprompting on error. -M "" Sets automatic HTML or CSV markup of output. The options have the form: {HTML html_options|CSV csv_options} See SQLPlus User's Guide for detailed HTML and CSV options. -NOLOGINTIME Don't display Last Successful Login Time. -R Sets restricted mode to disable SQLPlus commands that interact with the file system. The level can be 1, 2 or 3. The most restrictive is -R 3 which disables all user commands interacting with the file system. -S Sets silent mode which suppresses the display of the SQLPlus banner, prompts, and echoing of commands. is: {[/][@<connect_identifier>] | / } [AS {SYSDBA | SYSOPER | SYSASM | SYSBACKUP | SYSDG | SYSKM | SYSRAC}] [EDITION=value] Specifies the database account username, password and connect identifier for the database connection. Without a connect identifier, SQL*Plus connects to the default database. The AS SYSDBA, AS SYSOPER, AS SYSASM, AS SYSBACKUP, AS SYSDG, AS SYSKM and AS SYSRAC options are database administration privileges. <connect_identifier> can be in the form of Net Service Name or Easy Connect. @[<net_service_name> | [//]Host[:Port]/<service_name>] <net_service_name> is a simple name for a service that resolves to a connect descriptor. Example: Connect to database using Net Service Name and the database net service name is ORCL. sqlplus myusername/mypas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.