27 Jan 2020 04:56 PM - last edited on 18 May 2023 03:21 PM by Michal_Gebacki
Hello,
I am developing a oneagent remote plugin which has to be installed on ActiveGate.
I have to retrieve some information from an oracle database whom the host is not monitored by OneAgent :
SELECT name, free_mb, total_mb, (free_mb/total_mb)*100, FROM v$asm_diskgroup;
Firstly, I would like to know what kind entity, metric group to choose in this case :
"entity": "CUSTOM_DEVICE",
"metricGroup": "tech.ORACLE_METRICS",
"technologies": "ORACLE_DB",
Secondly,
Did I need to make a find_single_process_group call ?
(ie: pgi = self.find_single_process_group(pgi_name(attached_process))
pgi_id = pgi.group_instance_id)
Indeed, I am not looking into a particular process. If the answer is yes, is the display method
self.results_builder.absolute(key=key_metrics, value=asm_rate, entity_id=ruxit.api.selectors.EntityType.CUSTOM_DEVICE)
Will be OK?
Best Regards,
Fousseyni B.
Solved! Go to Solution.
27 Jan 2020 07:36 PM
Hi Fousseyni,
Yes, you most likely will want to create a "custom device" entity and post the metric there. The metric group you have posted should work as well.
For your second point I am not entirely sure I would need to research the custom ActiveGate plugins a bit more since I have not looked in a while. If I get a chance I will try to follow up again.
Thanks
-Dallas
28 Jan 2020 07:59 AM
Hello Dallas,
Thanks for your answer.
Best Regards,
Fousseyni B.
28 Jan 2020 09:11 AM
Hello,
I try to build my remote agent plugin on my computer. It failed due to CUSTOM_DEVICE.
Here is the output of the command oneagent_build_plugin --no-upload :
File: /etc/init.d/dynatracefunctions not found
Arguments=Namespace(deployment_dir=None, no_cert_ver=False, no_upload=True, plugin_dir='/Users/leanovia/Downloads/Dynatrace/plugin', server=None, token=None, token_file=None, verbose=False)
Starting oneagent_build_plugin
Checking plugin metadata: /Users/leanovia/Downloads/Dynatrace/plugin/plugin.json
Validating plugin.json against schema
Validating plugin.json failed, details: 'CUSTOM_DEVICE' is not one of ['HOST', 'PROCESS_GROUP_INSTANCE']
Failed validating 'enum' in schema['properties']['entity']:
{'description': 'Entity type upon which the plugin is activated',
'enum': ['HOST', 'PROCESS_GROUP_INSTANCE'],
'type': 'string'}
On instance['entity']:
'CUSTOM_DEVICE'
Error occured: 'CUSTOM_DEVICE' is not one of ['HOST', 'PROCESS_GROUP_INSTANCE']
Failed validating 'enum' in schema['properties']['entity']:
{'description': 'Entity type upon which the plugin is activated',
'enum': ['HOST', 'PROCESS_GROUP_INSTANCE'],
'type': 'string'}
On instance['entity']:
'CUSTOM_DEVICE'
Here is the content of my plugin.json file :
{
"name": "custom.python.oracle.plugin",
"version": "1.0",
"type": "python",
"entity": "CUSTOM_DEVICE",
"metricGroup": "tech.ORACLE_METRICS",
"technologies": "ORACLE_DB",
"source": {
"package": "oracle_active_plugin",
"className": "RemoteOraclePlugin",
"install_requires": [
"cx-Oracle>=7.2.3"
],
"activation": "Remote"
},
"ui": {
"keymetrics": [{
"key": "databases_asm_disk_usage",
"displayname": "% ASM Usage"
}],
"keycharts": [{
"group": "Disk Usage",
"title": "Total Disk Usage",
"series": [{
"key": "databases_asm_disk_usage",
"displayname": "ASM Disk Usage",
"seriestype": "area",
"color": "#74cff7"
}]
}]
},
"metrics": [{
"timeseries": {
"key": "databases_asm_disk_usage",
"unit": "Count",
"displayname": "% ASM Disk Usage"
}
}],
"properties": [{
"key": "oracle_host",
"type": "String"
},
{
"key": "oracle_port",
"type": "String"
},
{
"key": "oracle_service",
"type": "String"
},
{
"key": "oracle_user",
"type": "String"
},
{
"key": "oracle_password",
"type": "Password"
}
],
"configUI": {
"displayName": "Oracle Connection Paramter",
"properties": [{
"key": "oracle_host",
"displayName": "Oracle host",
"displayOrder": 1
},
{
"key": "oracle_port",
"displayName": "Oracle port",
"displayOrder": 2
},
{
"key": "oracle_service",
"displayName": "Oracle service SID ",
"displayOrder": 3
},
{
"key": "oracle_user",
"displayName": "Oracle username",
"displayOrder": 4
},
{
"key": "oracle_password",
"displayName": "Oracle password",
"displayOrder": 5
}
]
}
}
Best Regards,
Fousseyni B.
28 Jan 2020 10:29 AM
It's treating the plugin as a OneAgent plugin due to your naming convention of the name property. Remote plugins needs to have the name: custom.remote.python.[yourname]
28 Jan 2020 01:33 PM
Hello Michael L,
Thanks to your response, the error has disappeared.
Best Regards,
Fousseyni B.
28 Jan 2020 10:30 AM
In the plugin SDK there is an examples folder, if you start with the "demo_activegate_plugin" in there it will be much easier to create the plugin.