Ad Widget

Collapse

Zabbix agent2 multiple Oracle databases

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xyz123
    Junior Member
    • Jul 2021
    • 1

    #1

    Zabbix agent2 multiple Oracle databases

    Hi

    I need to monitor Oracle databases on several hosts (on each host around 20-30 instances). I tested Oracle by Zabbix agent 2 template and it works fine for one database. There is any solution to automate process instead of manually adding items, triggers etc for each database instance?
  • Glencoe
    Zabbix developer
    • Oct 2019
    • 152

    #2
    If the number of hosts and instances per each host changes frequently you can invest in setting up LLD rules and create your hosts automatically: https://www.zabbix.com/documentation...evel_discovery
    In your case, each host can represent one Oracle instance. Your LLD discovery rule can have a host prototype with the Oracle template linked and {$ORACLE.SERVICE} macro overridden with your SIDs.

    Or, if this is just a one-off task, you can create your hosts manually - also one host per instance:

    1. create host
    2. link Oracle template
    3. configure macros ({$ORACLE.CONNSTRING}, {$ORACLE.SERVICE},{$ORACLE.SERVICE})
    4. clone host, change macros, repeat

    Comment

    • GasperDBA
      Junior Member
      • Aug 2021
      • 6

      #3
      Greetings,

      I am also having problem configuring multiple instances per host. Host is created, Oracle template linked, but it only queries the first instance. I have set named sessions in conf file and zabbix-get queries data from Oracle instances:

      /etc/zabbix/zabbix_agent2.conf:
      Code:
      Plugins.Oracle.Sessions.OracleTqc.Uri=tcp://oracle.local:1521
      Plugins.Oracle.Sessions.OracleTqc.User=zabbix
      Plugins.Oracle.Sessions.OracleTqc.Password=<password>
      Plugins.Oracle.Sessions.OracleTqc.Service=tqc.world
      
      Plugins.Oracle.Sessions.OracleTeb.Uri=tcp://oracle.local:1521
      Plugins.Oracle.Sessions.OracleTeb.User=zabbix
      Plugins.Oracle.Sessions.OracleTeb.Password=<password>
      Plugins.Oracle.Sessions.OracleTeb.Service=teb.world
      Code:
      oracle@oracle:~ $ zabbix_get -s oracle.local -p 10050 -k oracle.sessions.stats[OracleTqc]
      {"active_background":60,"active_user":4,"concurrency_rate":0,"inactive_user":38,"lock_rate":0,"long_time_locked":0,"total":102}
      oracle@oracle:~ $ zabbix_get -s oracle.local -p 10050 -k oracle.sessions.stats[OracleTeb]
      {"active_background":58,"active_user":35,"concurrency_rate":0,"inactive_user":127,"lock_rate":0,"long_time_locked":0,"total":220}
      Manually I can get data from both instances.
      What is the next step?
      Creating new template with duplicate items (one for each instance)?
      Is there any example of multi instance config?

      I am thinking about exporting template to xml (>3k lines), add the second instance with named sessions and import into new template. Or is there any alternative easier way of doing it?

      Regards,

      Gašper
      Last edited by GasperDBA; 25-08-2021, 14:05.

      Comment

      • GasperDBA
        Junior Member
        • Aug 2021
        • 6

        #4
        Thanks for response. It works!

        I did create two hosts that point to the same IP. They have same template with different macros.

        Comment


        • yau
          yau commented
          Editing a comment
          dirty solution
      • sbelkin
        Junior Member
        • Dec 2016
        • 17

        #5
        Originally posted by GasperDBA
        Thanks for response. It works!

        I did create two hosts that point to the same IP. They have same template with different macros.
        GasperDBA what macros did you custom for each instance?

        Comment

        • gofree
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2017
          • 400

          #6
          I guess that youre using passive agent ( ? ) because im not sure if this can work with active agent items ( as they're sendig data to "named host " ) - passive chceks on db ( can be thousand ) could be a drag on the system itself

          Comment

          • nivethaa
            Junior Member
            • Sep 2024
            • 11

            #7
            Hello GasperDBA, how did you clone the host with same ip/port , I have the same issue . I have set up LLD rule with host prototype and Oracle template linked with {$ORACLE.SERVICE} macro overridden with the SIDs. It automatically created the hosts with each host representing one Oracle instance . I'm using zabbix agent active on every template, LLD, items and have one agent installed on the actual host having the oracle database .

            The issue is the discovered hosts I set up through LLD all report as "the interface being down" .

            I even cloned the host and assigned the oracle template , but it does not gather data and shows as "interface unknown" . I have one zabbix agent installed on the server .

            Comment

            Working...