# OneAgent Plugin: Oracle Process Group Instance Names

**URL:** <https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474>\
**Category:** Extensions\
**Tags:** extensions, oneagent-sdk\
**Created:** [February 12, 2021, 8:28am UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474 "2021-02-12T08:28:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![STiAT](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@STiAT](https://community.dynatrace.com/u/STiAT)\
**Post date:** [February 12, 2021, 8:28am UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/1 "2021-02-12T08:28:31Z")

</div>

Hi there,

I’ve been trying to implement a custom plugin for Oracle, since Insights does not fully fit our needs. The issue I seem to have is plugin activation respectively actually finding the process group instances.

If I see that correctly in dynatrace, the process group name should be “Oralce Database”, the technology “ORACLE\_DB”.

from the plugin.json

```auto
"entity": "PROCESS_GROUP_INSTANCE",
    "technologies": [
      "ORACLE_DB"
    ],

```

In the simulator I’ve used the following

```auto
{
            "group_name": "Oracle Database",
            "group_instance_id":2,
            "processes":[
                {
                    "process_name":"Oracle Database (gccon)"
                }
            ],
            "properties": {"Technologies": "ORACLE_DB"}
        },

```

After the simulator is triggered, I read the process\_name:

```auto
p_list = self.find_all_processes(lambda entry: entry.process_name.startswith("Oracle Database"))
            active_dbs = {}
            for process in p_list:
                m = re.search("^.*?\((.*)?\)$", process[1].process_name)
                if(m):
                    active_dbs[m.group(1)] = process[0].group_instance_id

```

The issue is, that this does not trigger the plugin on the actual server, at least it does not seem as if I do get any “active\_dbs”. Looking at the support archives, it seems that “Oracle Database (gccon)” is actually not the process name but the “inherited name”, and my guess is entry.process\_name.startswith(“Oracle Database”) does not find it since process\_name seems not to be what it displays in Dynatrace.

What’s the proper way to get the process group instances for the oracle database in this case? The inherited name is a nice thing, since I can identify the actual database instance to connect to.

Best regards,

Georg

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [February 12, 2021, 8:41am UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/2 "2021-02-12T08:41:52Z")

</div>

Hi, if you’re sure that the query method is executing (just do a logger as the first line) then what I would do if I were you is to change the extension to run once per Oracle process by setting this in the plugin.json:

```auto
"activation": "SnapshotEntry"

```

Once the extension is initiated once per process you can log the full snapshot of the entity that each extension thread connects to, by doing this:

```auto
logger.info(kwargs["associated_entity"])

```

From there on you can change your code to get any property that Dynatrace has seen.

Out of curiosity, what are you missing in the Oracle DB Insights?

Mike

---

<div class="post-metadata">

**Author:** ![STiAT](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@STiAT](https://community.dynatrace.com/u/STiAT)\
**Post date:** [February 12, 2021, 9:15am UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/3 "2021-02-12T09:15:58Z")

</div>

Hi there, thanks for the answer.

I’ve done that, but the “entity” seems to name it only “Oracle Database”, there seems to be no hint which instance it is:

```auto
<ol><li>{ key=entityid=ce4f7357c3bf4ed5 ; name="Oracle Database" ; type="Oracle" }</li></ol>

```

Is there a way to get “more” information to that entity? The name is the Process Groups one, not the instance name itself as it seems.

---

<div class="post-metadata">

**Author:** ![STiAT](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@STiAT](https://community.dynatrace.com/u/STiAT)\
**Post date:** [February 12, 2021, 11:21am UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/4 "2021-02-12T11:21:23Z")

</div>

What would probably be interesting in this case is to get a full process snapshot of the host to test with in a json as expected by the simulator\_snapshot.json… that would make testing a lot easier. Is there a way to do that?

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [February 12, 2021, 12:20pm UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/5 "2021-02-12T12:20:50Z")

</div>

If the above command (when executed as part of a deployed OneAgent Extension, not through the simulator) doesn’t have the information then you are out of luck and might have to get it from somewhere else than the snapshot.

If you do get something else back when it is deployed then you can take that output and drop it into your process snapshot.

Mike

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [February 12, 2021, 12:22pm UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/6 "2021-02-12T12:22:20Z")

</div>

Not simply. The process snapshot (but in a bit different format) can be found in the logs of the plugin agent once a custom extension has been deployed. It is usually easier to use the method I wrote about in the other reply.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [February 12, 2021, 5:11pm UTC](https://community.dynatrace.com/t/oneagent-plugin-oracle-process-group-instance-names/21474/7 "2021-02-12T17:11:20Z")

</div>

Unless the ORACLE\_DB technology type doesn’t bring back the correct entity. But my post in the other question regarding the process snapshot location would help you with that.
