ZABBIX Forums  
  #1  
Old 12-08-2009, 08:52
dalle dalle is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Mar 2009
Location: Ticino, Switzerland
Posts: 382
Default Another way to monitor Oracle

Hi to everyone, i've wrote within a workmate a plugin for zabbix to monitor oracle instances.
This script work on serverside and don't use zabbix send, but simply the zabbix server run some script and collect data from oracle instances.
This plugin is server-centric because for me is more simple manage and upgrade a single application.
The work that is done with zabora is simply great,and i've really apreciate! this is just another way to do more or less the same work.
requirements:
  • a working sqlplus on zabbix server with configured tnsnames, and tnsping utility too. I've installed a complete client and not simply the instantclient, because tnsping is not included inside instant-client.
  • an user on every oracle instances

installation steps
create an user with this oracle script:
CREATE USER ZABBIX
IDENTIFIED BY <REPLACE WITH PASSWORD>
DEFAULT TABLESPACE SYSTEM
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
-- 2 Roles for ZABBIX
GRANT CONNECT TO ZABBIX;
GRANT RESOURCE TO ZABBIX;
ALTER USER ZABBIX DEFAULT ROLE ALL;
-- 5 System Privileges for ZABBIX
GRANT SELECT ANY TABLE TO ZABBIX;
GRANT CREATE SESSION TO ZABBIX;
GRANT SELECT ANY DICTIONARY TO ZABBIX;

untar in /etc/zabbix/externalscripts check_ora.tar.gz
write your credentials /username/password and instance etc..) inside
/etc/zabbix/externalscripts/check_ora/credentials
create items like on attachment check_ora_items.txt or import my template.
then the last thing to do is add an host with the same name of SID.
an you'll have a lot of graphs about performaces etc..
in the picture you'll see some graphs

See ya =)
Dalle
Attached Images
  
Attached Files
File Type: gz check_ora.tar.gz (6.6 KB, 1191 views)
File Type: txt check_ora_item.txt (6.0 KB, 1442 views)
File Type: xml zabbix_export.xml (73.4 KB, 1110 views)

Last edited by dalle; 12-08-2009 at 16:06.
Reply With Quote
  #2  
Old 12-08-2009, 08:55
dalle dalle is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Mar 2009
Location: Ticino, Switzerland
Posts: 382
Default

just another screenshot =)
Attached Images
 
Reply With Quote
  #3  
Old 19-08-2009, 09:39
bottie bottie is offline
Junior Member
 
Join Date: Aug 2009
Posts: 1
Default graph question

Hi Dalle,

thanks for the script.
could you please explain how to get the hit ratio graph in kb/s - Mb/s just like in your example?
-----
don't matter just read the doc and think it solved... thanks

Last edited by bottie; 19-08-2009 at 10:25.
Reply With Quote
  #4  
Old 03-09-2009, 10:22
dagun dagun is offline
Member
 
Join Date: Sep 2009
Location: China
Posts: 71
Send a message via MSN to dagun
Default

Hi dalle!
I don't understand the "write your credentials /username/password and instance etc..) inside
/etc/zabbix/externalscripts/check_ora/credentials"
Can you explaint it for me ?Thanks.
Reply With Quote
  #5  
Old 03-09-2009, 14:49
dalle dalle is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Mar 2009
Location: Ticino, Switzerland
Posts: 382
Default

Quote:
Originally Posted by dagun View Post
Hi dalle!
I don't understand the "write your credentials /username/password and instance etc..) inside
/etc/zabbix/externalscripts/check_ora/credentials"
Can you explaint it for me ?Thanks.
sure
to connect to a database you need spacify username, password and instance name.
e.g.
sqlplus username/password@databaseA.example.com

databaseA.example.com is defined inside your tnsnames.ora e.g.
tnsnames.ora:
databaseA.example.com=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=192.168.0.1)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=databaseA)
)
)

obviously on HOST you need spcify your ip address and on SERVICE_NAME your instance name.

and so the credentials file is going to contain:
databaseA;zabbix/password_zabbix@databaseA.example.com

databaseA is the name of your monitored host and the name of database.
I use the name of instance as zabbix host so you can have moultiple instance of oracle on the same server.
for any trouble ask to me.
see ya
Dalle

Last edited by dalle; 03-09-2009 at 14:52.
Reply With Quote
  #6  
Old 15-09-2009, 03:16
dagun dagun is offline
Member
 
Join Date: Sep 2009
Location: China
Posts: 71
Send a message via MSN to dagun
Default Help me!

When I use the oracle client to connect the oracle server , I get the error.
My oracle server is on the window.the oracle service_nameracle
My oracle client is on the linux.When I excute"sqlplus hrsoft/hrsoft@szg"
the fllow problem is:
ORA-12504:TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
the"szg" is window's host name.ip:192.168.2.124

My tnsnames.ora configuration is:
szg=(DESCRIPTION)=
(PROTOCOL=tcp)
(HOST=192.168.2.124)
(PORT=1521)
(CONNECT_DATA=
(SID=oracle)
(GLOBAL_NAME=oracle)
)
I will ask GLOBAL_NAME equal SERVICE_NAME?
Thanks.
Reply With Quote
  #7  
Old 15-09-2009, 07:15
dagun dagun is offline
Member
 
Join Date: Sep 2009
Location: China
Posts: 71
Send a message via MSN to dagun
Smile Ok

Hi dalle.
I have resolve this problem.
You do a good job.Thank you.
Reply With Quote
  #8  
Old 12-10-2009, 10:51
dalle dalle is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Mar 2009
Location: Ticino, Switzerland
Posts: 382
Default New release

Hi to everyone,
i wanna pubblish a new release of check_ora, this version is slightly different from the previous because now zabbix server don't execute more the "chechk_ora.sh" but now check_ora.sh send trap to zabbix server so everything is asincronous and the server don't have more trouble with queue if you have a lot of database.
In this release you'll need to schedule on crontab
*/5 * * * * /etc/zabbix/externalscripts/check_ora_cron.sh
Then import the new template where every item is converted to "ZABBIX trapper"
and extract the two files "check_ora_sendtrap.sh" ancd "check_ora_cron.sh" and place them on "/etc/zabbix/externalscripts"
Everything is contained on the zip file in attach.
See yaaa
Dalle
Attached Files
File Type: zip check_ora.zip (23.8 KB, 686 views)
Reply With Quote
  #9  
Old 09-11-2009, 19:28
vjunior1981 vjunior1981 is offline
Junior Member
 
Join Date: Nov 2009
Posts: 9
Default CFGFILE="/etc/zabbix/externalscripts/globalcfg"

First of all, sorry for my pour english...

What I need in file CFGFILE="/etc/zabbix/externalscripts/globalcfg"?
This is a file or a directory?
When i execute the script ./check_ora_sendtrap.sh I have this:

./check_ora_sendtrap.sh: line 46: source: /etc/zabbix/externalscripts/globalcfg: is a directory
./check_ora_sendtrap.sh: line 184: /home/zabbix/.bash_profile: No such file or directory

Thansk for any help...
Reply With Quote
  #10  
Old 10-11-2009, 08:26
dalle dalle is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Mar 2009
Location: Ticino, Switzerland
Posts: 382
Talking

Quote:
Originally Posted by vjunior1981 View Post
First of all, sorry for my pour english...

What I need in file CFGFILE="/etc/zabbix/externalscripts/globalcfg"?
This is a file or a directory?
When i execute the script ./check_ora_sendtrap.sh I have this:

./check_ora_sendtrap.sh: line 46: source: /etc/zabbix/externalscripts/globalcfg: is a directory
./check_ora_sendtrap.sh: line 184: /home/zabbix/.bash_profile: No such file or directory

Thansk for any help...
Don't worry about your english is not worse than mine
globalcfg is a configuration file imported by the script and contains

cat /etc/zabbix/externalscripts/globalcfg

ZBX_SENDER="/usr/local/sbin/zabbix_sender"
ZBX_SERVER="10.10.64.93"
ZBX_PORT="10051"


so you can write your file if is not present and put inside:
ZBX_SENDER="<LOCATION OF ZABBIX SEND>/zabbix_sender"
ZBX_SERVER="<IP_ZABBIX_SERVER>"
ZBX_PORT="<ZABBIX_PORT>"
See ya
Reply With Quote
Reply

Tags
monitor, oracle, performance

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:10.