# ActiveGate extension - configuration upload issue

**URL:** <https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732>\
**Category:** Extensions\
**Tags:** activegate, extensions\
**Created:** [December 16, 2022, 1:45pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732 "2022-12-16T13:45:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MathieuB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mathieub/32/16706_2.png) [@MathieuB](https://community.dynatrace.com/u/MathieuB)\
**Post date:** [December 16, 2022, 1:45pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/1 "2022-12-16T13:45:52Z")

</div>

Hi,

I have an ActiveGate extension, with valid _plugin.json_ and a&nbsp;_properties.json_ to set configuration parameters.

When I upload a new version of my extension, with new configuration, I see that the configuration parameters&nbsp;have not changed. [_the version is incraised on the plugin.json and the upload is successful_]

I see several issues :

- The parameters on the config UI have not been updated (_Setting/Monitoring/Monitored technologies/MyPlugin/Endpoint configuration_)  
--\> Is it a bug or do I miss nothing on the build/upload process ?
- The extension is not restarted, so it continues to loop the **query()** function. But I read my configuration parameters on the&nbsp;**initialize()** function, so the new parameters are not loaded.  
--\> How to restart the extension after a new build ?

I see on the log that the new code has been deployed successfully.

I am quite new on my Dynatrace company, so maybe I miss something basic&nbsp;:sweat\_smile:

_plugin.json :_

```python
{
	"name": "custom.remote.python.myplugin",
	"version": "0.945",
	"type": "python",
	"entity": "CUSTOM_DEVICE",
	"metricGroup": "myplugin",
	"technologies": ["MYPLUGIN"],
	"source": {
		"package": "activegate_plugin_myplugin",
		"className": "MyPlugin",
		"activation": "Remote"
	},
	"properties": [
		{
			"key": "debug",
			"type": "Dropdown",
			"dropdownValues" : ["WARNING", "INFO", "DEBUG"],
			"defaultValue" : "INFO"
		},
		{
			"key": "url",
			"type": "String"
		},
		{
			"key": "url2",
			"type": "String"
		}
	],
	"configUI": {
		"displayName": "MyPlugin",
		"properties" : [
			{"key" : "url", "displayName": "First URL", "displayOrder": 1},
			{"key" : "url2", "displayName": "Second URL", "displayOrder": 2},
			{"key" : "debug", "type":"String", "displayName": "Enable debug logging", "displayOrder": 3}
		]
	}
}

```

_properties.json :_

```python
{
	"debug": "DEBUG",
	"url": "https://google.fr",
	"url2": "https://google.com"
}

```

---

<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:** [December 20, 2022, 9:31am UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/2 "2022-12-20T09:31:13Z")

</div>

Hi,

The properties.json file is only used during oneagent\_simulate\_plugin. The rest of the time the configuration is coming from the Dynatrace cluster. If the properties change you’ll have to hit “update” in the Dynatrace UI to send the new properties to the ActiveGate. Once new configurations are sent the plugin will restart and run initialize again.

The new code is loaded in whenever the RemotePluginModule or PluginAgent process (depending on ActiveGate/OneAgent) is restarted. The process is automatically restarted whenever a new version is found in a plugin.json. You can always force it by restarting the remote plugin or OneAgent service.

---

<div class="post-metadata">

**Author:** ![MathieuB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mathieub/32/16706_2.png) [@MathieuB](https://community.dynatrace.com/u/MathieuB)\
**Post date:** [December 23, 2022, 2:46pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/3 "2022-12-23T14:46:41Z")

</div>

Hi,

Thanks for your help [@Mike\_L](https://community.dynatrace.com/user/11520)&nbsp;.

I will rework my json files to see if the new parameters are propagated. Because I don’t want to update the parameters from the UI.

---

<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:** [December 23, 2022, 3:07pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/4 "2022-12-23T15:07:38Z")

</div>

If you don’t want to update the parameters in the UI, maybe make them hardcoded in the python code (either in the script itself or by importing a json or so from the file system.

---

<div class="post-metadata">

**Author:** ![MathieuB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mathieub/32/16706_2.png) [@MathieuB](https://community.dynatrace.com/u/MathieuB)\
**Post date:** [January 6, 2023, 4:09pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/5 "2023-01-06T16:09:32Z")

</div>

Hi again [@Mike\_L](https://community.dynatrace.com/user/11520)&nbsp;,

So you said that the only way to update the parameters from the plugin.json is to update them in the UI ?  
Therefore, I do not understand why there is a ‘defaultValue’ in the json.

I perform some test and after the update (with the&nbsp;_build\_plugin_ command), the new code is running but the script starts at the _**query()**_ function and not the _**initialize()**_.

```markup
class DemoPluginRemote(RemoteBasePlugin):
    def initialize(self, **kwargs):
        self.url = self.config["url"]

    def query(self, **kwargs):
        #plugin routine

```

So maybe my issue cames from the&nbsp;RemotePluginModule&nbsp;that do no restart. I will look on the ActiveGate configuration.

---

<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:** [January 6, 2023, 4:26pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/6 "2023-01-06T16:26:30Z")

</div>

If you’re fine with the ability of changing it in the UI then you can do something like this in the python code:

```markup
def initialize(self, **kwargs):
  config = kwargs['config']
  self.url = config["url"].strip()

  if self.url == '':
    self.url = "https://dynatrace.com"

```

---

<div class="post-metadata">

**Author:** ![MathieuB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mathieub/32/16706_2.png) [@MathieuB](https://community.dynatrace.com/u/MathieuB)\
**Post date:** [January 9, 2023, 3:40pm UTC](https://community.dynatrace.com/t/activegate-extension-configuration-upload-issue/37732/7 "2023-01-09T15:40:03Z")

</div>

No I don’t want to hardcode parameters.

So I’m going to read the properties.json or get parameters from&nbsp;_kwargs[‘json\_config’][‘properties’]_

_Thanks for your help Mike\_L._
