# ExportD script not allowed to be run

**URL:** <https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287>\
**Category:** Report a Bug\
**Created:** [March 16, 2021, 5:55pm UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287 "2021-03-16T17:55:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbetsis](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kbetsis](https://community.datagerry.com/u/kbetsis)\
**Post date:** [March 16, 2021, 5:55pm UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287/1 "2021-03-16T17:55:26Z")

</div>

Dear all

I am trying to run an exportd with a simple script.  
I’ve followed all instructions however the exportd fails with the below message:

> You are not allowed to execute this script. Could not open .datagerry\_exec.json file.

I’ve included the .datagerry\_exec.json file including the script name as shown below:

> {  
> “allowed\_scripts”: [“onmsctl”]  
> }

This json is included in both of the below locations:

> /usr/bin/  
> /opt/onmsctl/

For the exportD script the following is defined as the script value:

> /usr/bin/onmsctl --url [https://onms.domain.priv/opennms](https://onms.domain.priv/opennms) --user username --passwd ‘password’ inv req add

In theory after the add the name of the respective value will be appended, which does not happen since I continuously get the communicated error.

The same command is run with both users root and datagerry, so there is no authorization issues on the users.

Is this a bug or I am not doing something correct?

---

<div class="post-metadata">

**Author:** ![sergej.dumler](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sergej.dumler](https://community.datagerry.com/u/sergej.dumler)\
**Post date:** [March 22, 2021, 6:48am UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287/2 "2021-03-22T06:48:29Z")

</div>

Hallo @kbetsis,

if I see this correctly, the file extension is missing:

{  
{  
“allowed\_scripts”: { “onmsctl”.]  
}

Try something like this.  
{  
“allowed\_scripts”: [“onmsctl.sh”]  
}

[https://docs.datagerry.com/latest/admin\_guide/exportd.html#externalsystemexecutescript](https://docs.datagerry.com/latest/admin_guide/exportd.html#externalsystemexecutescript)

---

<div class="post-metadata">

**Author:** ![kbetsis](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kbetsis](https://community.datagerry.com/u/kbetsis)\
**Post date:** [March 22, 2021, 5:25pm UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287/3 "2021-03-22T17:25:39Z")

</div>

Hi @sergej.dumler

I wish it was that, however, the script is run as is no extension needed.

> ls -lart  
> total 10960  
> drwxr-xr-x. 3 root root 21 Nov 8 16:42 …  
> drwxr-xr-x. 2 root root 27 Nov 8 16:42 .vscode  
> -rw-r–r–. 1 root root 310 Nov 8 16:42 .goreleaser.yml  
> -rw-r–r–. 1 root root 31 Nov 8 16:42 .gitignore  
> -rw-r–r–. 1 root root 5103 Nov 8 16:42 README.md  
> -rw-r–r–. 1 root root 34523 Nov 8 16:42 LICENSE  
> drwxr-xr-x. 2 root root 209 Nov 8 16:42 api  
> drwxr-xr-x. 11 root root 138 Nov 8 16:42 cli  
> -rw-r–r–. 1 root root 2631 Nov 8 16:42 go.sum  
> -rw-r–r–. 1 root root 308 Nov 8 16:42 go.mod  
> drwxr-xr-x. 2 root root 23 Nov 8 16:42 common  
> -rw-r–r–. 1 root root 2287 Nov 8 16:42 onmsctl.go  
> drwxr-xr-x. 2 root root 4096 Nov 8 16:42 model  
> drwxr-xr-x. 2 root root 22 Nov 8 16:42 test  
> drwxr-xr-x. 8 root root 163 Nov 8 16:42 .git  
> -rw-r–r–. 1 root root 258 Nov 8 17:09 my-ftdc.te  
> -rw-r–r–. 1 root root 1045 Nov 8 17:09 my-ftdc.pp  
> drwxr-xr-x. 2 root root 41 Nov 9 17:47 rest  
> drwxr-xr-x. 2 root root 4096 Nov 9 17:48 services  
> drwxr-xr-x. 2 root root 25 Mar 12 19:09 .onms  
> -rwxr-xr-x. 1 root root 11129793 Mar 12 19:33 onmsctl  
> -rw-r–r–. 1 root root 0 Mar 12 20:14 trace.txt  
> -rwxr-xr-x. 1 root root 37 Mar 16 17:09 .datagerry\_exec.json

---

<div class="post-metadata">

**Author:** ![sergej.dumler](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sergej.dumler](https://community.datagerry.com/u/sergej.dumler)\
**Post date:** [March 23, 2021, 8:05am UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287/4 "2021-03-23T08:05:38Z")

</div>

Hello @kbetsis,

try this statement

/usr/bin/onmsctl/ --url [https://onms.domain.priv/opennms](https://onms.domain.priv/opennms) --user username --passwd ‘password’ inv req add

There must be a backslash at the end: ‘/usr/bin/onmsctl/’.

---

<div class="post-metadata">

**Author:** ![adnan.smajic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/adnan.smajic/32/754_2.png) [@adnan.smajic](https://community.datagerry.com/u/adnan.smajic)\
**Post date:** [June 20, 2023, 10:49am UTC](https://community.datagerry.com/t/exportd-script-not-allowed-to-be-run/287/5 "2023-06-20T10:49:31Z")

</div>

Closed on June 20, 2023, 10:49am UTC


