Ad Widget

Collapse

Oracle monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • den_crane
    Senior Member
    • Feb 2006
    • 272

    #1

    Oracle monitoring

    Unzip ZABORA.zip, change oracle environment in oraenv, change oracle connection params (user/pass) in cont.sql, change full path to oraenv and cont.sql in zabora.

    Code:
    $ ./zabora
    zabora version: 1.2
    usage:
        ./zabora checkactive [SID]     -- Check Intance is active and open.
        ./zabora usercount [SID]       -- Count of users connected to Oracle.
        ./zabora activeusercount [SID] -- Count of active users.
        ./zabora dbsize [SID]          -- Size of user data (without temp).
        ./zabora dbfilesize [SID]      -- Size of all datafiles.
        ./zabora version [SID]         -- Oracle version (Banner).
        ./zabora dsksortratio [SID]    -- Disk sorts ratio.
        ./zabora rcachehit [SID]       -- Read Cache hit ratio.
        ./zabora uptime [SID]          -- Instance Uptime (seconds).
        ./zabora commits [SID]         -- User Commits.
        ./zabora rollbacks [SID]       -- User Rollbacks.
        ./zabora deadlocks [SID]       -- Deadlocks.
        ./zabora redowrites [SID]      -- Redo Writes.
        ./zabora tblscans [SID]        -- Table scans (long tables).
        ./zabora tblrowsscans [SID]    -- Table scan rows gotten.
        ./zabora indexffs [SID]        -- Index fast full scans (full).
        ./zabora hparsratio [SID]      -- Hard parse ratio.
        ./zabora netsent [SID]         -- Bytes sent via SQL*Net to client.
        ./zabora netresv [SID]         -- Bytes received via SQL*Net from client.
        ./zabora netroundtrips [SID]   -- SQL*Net roundtrips to/from client.
        ./zabora logonscurrent [SID]   -- Logons current.
        ./zabora lastarclog [SID]      -- Last archived log sequence.
        ./zabora lastapplarclog [SID]  -- Last applied archive log (at standby).
        ./zabora freebufwaits [SID]    -- free buffer waits.
        ./zabora bufbusywaits [SID]    -- buffer busy waits.
        ./zabora logswcompletion [SID] -- log file switch completion.
        ./zabora logfilesync [SID]     -- log file sync.
        ./zabora logprllwrite [SID]    -- log file parallel write.
        ./zabora enqueue [SID]         -- enqueue waits.
        ./zabora dbseqread [SID]       -- db file sequential read waits.
        ./zabora dbscattread [SID]     -- db file scattered read.
        ./zabora dbsnglwrite [SID]     -- db file single write.
        ./zabora dbprllwrite [SID]     -- db file parallel write.
        ./zabora directread [SID]      -- direct path read.
        ./zabora directwrite [SID]     -- direct path write.
        ./zabora zaboraver             -- Version of this script.
    Test the script
    Code:
    $ ./zabora version
    Oracle8i Release 8.1.7.4.0 - Production
    Add UserParameter to zabbix_agentd.conf
    Code:
    $echo "UserParameter=oracle[*],/opt/zabbix/zabora \$1 \$2" >>zabbix_agentd.conf
    Test from zabbix agent
    Code:
    $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t oracle[version]
    oracle[/opt/zabbix/zabora version ]           [t|Oracle8i Release 8.1.7.4.0 - Production]
    Add Items in Zabbix
    Code:
    Description                               Type          Key                   Type of information Units      Update interval Store value  History    Trends      Applications
    Oracle/Deadlocks.                         ZABBIX agent  oracle[deadlocks]     Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Disk sorts ratio.                  ZABBIX agent  oracle[dsksortratio]  Numeric (float)     %          600             As Is        7          365         Oracle
    Oracle/Hard parse ratio.                  ZABBIX agent  oracle[hparsratio]    Numeric (float)     %          600             As Is        7          365         Oracle
    Oracle/Index fast full scans (full).      ZABBIX agent  oracle[indexffs]      Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Intance is active and open.        ZABBIX agent  oracle[checkactive]   Numeric (integer)              300             As Is        7          365         Oracle
    Oracle/Read Cache hit ratio.              ZABBIX agent  oracle[rcachehit]     Numeric (float)     %          600             As Is        7          365         Oracle
    Oracle/Redo Writes.                       ZABBIX agent  oracle[redowrites]    Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Size of all datafiles.             ZABBIX agent  oracle[dbfilesize]    Numeric (integer)   B          7200            As Is        7          365         Oracle
    Oracle/Size of user data (without temp).  ZABBIX agent  oracle[dbsize]        Numeric (integer)   B          7200            As Is        7          365         Oracle
    Oracle/Table scan rows gotten.            ZABBIX agent  oracle[tblrowsscans]  Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Table scans (long tables).         ZABBIX agent  oracle[tblscans]      Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Uptime.                            ZABBIX agent  oracle[uptime]        Numeric (integer)   s          600             As Is        7          365         Oracle
    Oracle/User Commits.                      ZABBIX agent  oracle[commits]       Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/User Rollbacks.                    ZABBIX agent  oracle[rollbacks]     Numeric (integer)              600             Delta        7          365         Oracle
    Oracle/Usercount                          ZABBIX agent  oracle[usercount]     Numeric (integer)              300             As Is        7          365         Oracle
    Oracle/Version                            ZABBIX agent  oracle[version]       Character                      7200            As Is        7          365         Oracle
    Oracle/ZaboraVer                          ZABBIX agent  oracle[zaboraver]     Character                      7200            As Is        3          365
    Attached Files
  • Paul Hanson
    Junior Member
    • Dec 2006
    • 5

    #2
    Thanks!

    Thanks for sharing this.

    Comment

    • jcanning
      Junior Member
      • Mar 2006
      • 6

      #3
      Many Thanks!

      Thanks so much for posting this. It's what I have been looking for.

      Cheers!

      Comment

      • den_crane
        Senior Member
        • Feb 2006
        • 272

        #4
        Good news wildcards in ZabbixW32.exe works.

        I created zabora.bat :

        Code:
        C:\ZABBIX>zabora.bat uptime
        10193506
        UserParameter=oracle[*],c:\zabbix\zabora.bat $1 $2
        Timeout=30
        Attached Files

        Comment

        • den_crane
          Senior Member
          • Feb 2006
          • 272

          #5
          On some windows system environment variable path invisible for services, and zabora.bat couldn't find sqlplus.

          set nls_lang=american_cis.cl8mswin1251
          set path=C:\ora92\bin

          if user LocalSystem (owner of zabbix service) not included in group ORA_DBA, cont.sql requare real password for "conn" command

          Comment

          • den_crane
            Senior Member
            • Feb 2006
            • 272

            #6
            Oracle user for zabora:
            Code:
            CREATE USER "ZABBIX" IDENTIFIED BY "password";
            GRANT "CONNECT" TO "ZABBIX";
            grant select on v_$instance to zabbix;
            grant select on v_$sysstat to zabbix;
            grant select on v_$session to zabbix;
            grant select on dba_free_space to zabbix;
            grant select on dba_data_files to zabbix;
            grant select on dba_tablespaces to zabbix;
            grant select on v_$log to zabbix;
            grant select on v_$archived_log to zabbix;
            grant select on v_$loghist to zabbix;
            grant select on v_$system_event to zabbix;
            grant select on v_$event_name to zabbix;
            Last edited by den_crane; 25-07-2008, 10:47.

            Comment

            • mfortier
              Junior Member
              • Apr 2007
              • 4

              #7
              thank you for sharing

              Comment

              • StanZoid
                Member
                • Oct 2005
                • 47

                #8
                Do you have mods to allow this to check multiple instances on a single server?

                StanZoid

                Comment

                • Treitor
                  Junior Member
                  • Feb 2006
                  • 14

                  #9
                  Thank´s for these scripts

                  Thank´s a lot for these scripts.

                  Comment

                  • den_crane
                    Senior Member
                    • Feb 2006
                    • 272

                    #10
                    Originally posted by StanZoid
                    Do you have mods to allow this to check multiple instances on a single server?

                    StanZoid
                    ./zabora checkactive [SID]

                    Comment

                    • den_crane
                      Senior Member
                      • Feb 2006
                      • 272

                      #11
                      zabora 1.5

                      New parameter monitoring [latchfree]
                      On error ZBX_NOTSUPPORTED returned
                      Help ./zabora -h or zabora.bat /?

                      Required [grant select on v_$event_name to zabbix;]
                      Attached Files

                      Comment

                      • testos
                        Member
                        • Apr 2007
                        • 85

                        #12
                        Greetings,

                        How can i obtain the percentage of free space in each one tablespaces existing?

                        thanks

                        Comment

                        • felipebare
                          Junior Member
                          • Jun 2007
                          • 12

                          #13
                          Hi all. I tried to use it but i had this problems:

                          [root@oraserver zabbix]# ./zabora version
                          ./zabora: line 10: : No such file or directory
                          ./zabora: line 238: : No such file or directory


                          Any suggestion ?

                          Thanks a lot.

                          Felipe

                          Comment

                          • den_crane
                            Senior Member
                            • Feb 2006
                            • 272

                            #14
                            Originally posted by felipebare
                            Hi all. I tried to use it but i had this problems:

                            [root@oraserver zabbix]# ./zabora version
                            ./zabora: line 10: : No such file or directory
                            ./zabora: line 238: : No such file or directory
                            Any suggestion ?
                            edit oraenv (for Unix) or env.bat (for Win) with your system settings
                            Code:
                            $ cat oraenv 
                            ORACLE_HOME=/orafs/app/oracle/product/9.2   # Path to oracle
                            ORACLE_SID=sgb1                             # Oracle DB Name (SID)
                            PATH=/usr/bin:/usr/sbin/:$ORACLE_HOME/bin   # Path to oracle binaries (sqlplus) 
                            NLS_LANG=american_cis.cl8mswin1251          # NLS (settings)
                            edit zabora for path to oraenv:
                            Code:
                            cat ./zabora 
                            #! /usr/bin/sh
                            #
                            . /opt/zabbix/oraenv # I use /opt/zabbix for zabbix binaries and scripts
                            Last edited by den_crane; 29-06-2007, 08:17.

                            Comment

                            • felipebare
                              Junior Member
                              • Jun 2007
                              • 12

                              #15
                              Thanks for that, but I've already done this:

                              [root@oraserver zabbix]# cat zabora
                              #! /usr/bin/sh
                              #
                              #
                              #
                              . /etc/zabbix/oraenv

                              [root@oraserver zabbix]# cat oraenv
                              ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
                              ORACLE_SID=ora10g
                              PATH=/usr/bin:/usr/sbin/:$ORACLE_HOME/bin
                              NLS_LANG=AMERICAN.WE8ISO8859P1
                              [root@oraserver zabbix]#

                              What's wrong ?

                              Thanks a lot.

                              Felipe

                              Comment

                              Working...