Ad Widget

Collapse

Monitoring Database Oracle 12c in Zabbix 3.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miguelangel.martin
    Junior Member
    • Apr 2016
    • 7

    #1

    Monitoring Database Oracle 12c in Zabbix 3.0

    How I can monitore an Oracle Database 12c in Zabbix 3.0?

    Thank you.
  • al.netrusov
    Junior Member
    • Jun 2015
    • 14

    #2
    Hello,

    You can look at my plugin called ZabbixDBA: https://github.com/anetrusov/ZabbixDBA

    It's pretty flexible and supports multiple rdbms.
    You can contact me if you have troubles with it or want some features to be added.


    Thanks.

    Comment

    • miguelangel.martin
      Junior Member
      • Apr 2016
      • 7

      #3
      Thank you for your reply.

      I'm trying to install but it gives me some errors:

      [root@zabbix3 zdba]# cpanm --installdeps
      Usage: cpanm [options] Module [...]

      [root@zabbix3 zdba]# /sbin/service zdba start
      Starting ZabbixDBA service: ZabbixDBA failed to start

      Can you explain to me how to install with more details?

      I hope your reply. Thank you so much.

      Comment

      • al.netrusov
        Junior Member
        • Jun 2015
        • 14

        #4
        You must specify cpan deps file location. If you're in plugin directory, then it's gonna be dot.
        Alternatively you can do so: cpanm --installdeps /opt/zdba

        Comment

        • miguelangel.martin
          Junior Member
          • Apr 2016
          • 7

          #5
          I have already installed the deps successfully.

          But I can´t start the service. This is the error.

          /sbin/service zdba start
          Starting ZabbixDBA service: su: user zdba does not exist
          ZabbixDBA failed to start

          After that, I create an user and a group called zdba and put the permissions in all the path. but it gives me the same error but without saying that the user misses.

          [root@zabbix3 log]# /sbin/service zdba start
          Starting ZabbixDBA service: ZabbixDBA failed to start


          Also I have tried changing the RUNAS=root but nothing

          My path is this:

          [root@zabbix3 ~]# cd /opt/zdba
          [root@zabbix3 zdba]# ls
          conf Dockerfile init.d log templates
          cpanfile docs lib README.md ZabbixDBA.pl


          I hope your solution, so thanks.

          Comment

          • al.netrusov
            Junior Member
            • Jun 2015
            • 14

            #6
            Maybe there's an error while it trying to start. Try to run it manually, eg: perl /opt/zdba/ZabbixDBA.pl /opt/zdba/config.pl

            You configured /opt/zdba/config.pl, right? My init script is pretty simple and I knew that there will be troubles.

            Thanks,
            Alex.

            Comment

            • miguelangel.martin
              Junior Member
              • Apr 2016
              • 7

              #7
              Hi Alex!

              First of all, sorry for delaying but I have been so busy this couple of weeks.

              Yes, I have configured config.pl althougth the path is /opt/zdba/conf/config.pl, as you describe in the script.

              This is my config.pl:

              [root@zabbix3 ~]# cat /opt/zdba/conf/config.pl
              {
              zabbix => {

              server => '192.168.1.220',
              port => 10051,
              timeout => 30,
              },
              daemon => {
              sleep => 120,
              },
              db => {
              default => {
              user => 'zabbix',
              password => 'zabbix',
              query_list => 'query.props.pl',
              sleep => 30,
              retry_count => 1,
              },
              list => [ 'XXXPRD', 'XXXDEV' ],
              XXXPRD => {
              dsn => 'DBI:Oracle:host=xxxdb11;port=1521;sid=XXXPRD',
              extra_query_list => 'extra.query.props.pl',
              sleep => 15,
              },
              XXXDEV => {
              dsn => 'DBI:Oracle:host=xxxdb01;port=1521;sid=XXXDEV',
              user => 'c##zabbix',
              },
              XXXTST => {
              dsn => 'DBI:Pg:database=xxxtst;host=xxxdb02;port=5432',
              retry_count => 2,
              }
              }
              }

              I have only changed the Zabbix Server's IP address because mu username and password from db is the same that yours.


              If I put the following command ( perl /opt/zdba/ZabbixDBA.pl /opt/zdba/conf/config.pl ), this is the result

              [root@zabbix3 ~]# perl /opt/zdba/ZabbixDBA.pl /opt/zdba/conf/config.pl
              Can't locate forks.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/zdba/ZabbixDBA.pl line 7.
              BEGIN failed--compilation aborted at /opt/zdba/ZabbixDBA.pl line 7.

              I hope that we get the solution.
              Thank you so much,
              Miguel Ángel

              Comment

              • al.netrusov
                Junior Member
                • Jun 2015
                • 14

                #8
                Thanks for feedback!

                Well, this error indicates that you didn't install "forks" module. I've suggested you to run 'cpan --installdeps /opt/zdba', it will install all the requirements.
                Next, you need to install Oracle client on Zabbix server (download instantclient from oracle.com) and DBD module (DBD::Oracle for Oracle databases)

                rpm install instantclient-* # Oracle instant client supplied both in zip and rpm formats, choose one that suitable for you
                cpanm DBD::Oracle

                And you have to configure next lines

                list => [ <dbname>, <your_database_list> ],
                <dbname> => {
                dsn => 'DBI:Oracle:host=<host>;port=<port>;sid=<oracle_si d>',
                },

                dbname must match Zabbix's host



                Thanks,
                Alex.

                Comment

                • miguelangel.martin
                  Junior Member
                  • Apr 2016
                  • 7

                  #9
                  Hello Alex,

                  I have just read the message, I'm sorry but I am so busy this days.

                  Where I download DBD:Oracle?
                  What is the value in oracle_sid?


                  Thank you for your reply!!

                  Comment

                  • al.netrusov
                    Junior Member
                    • Jun 2015
                    • 14

                    #10
                    DBD::Oracle is Perl package. You should install it with: cpanm DBD::Oracle

                    Value of oracle_sid is... SID of your database, of course.

                    Comment

                    • miguelangel.martin
                      Junior Member
                      • Apr 2016
                      • 7

                      #11
                      Hi Alex,

                      I'm so sorry, I've a lot of work in this moment and I couldn`t read the post until now. When I can, I will follow with this.

                      Thank you so much.

                      Miguel.

                      Comment

                      • A.Zabihi
                        Junior Member
                        • Aug 2016
                        • 14

                        #12
                        how to monitor oracle 12c with zabbix 3.2

                        this is my video on youtube about oracle12c monitoring with zabbix odbc

                        Comment

                        Working...