ExportD script not allowed to be run

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 --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?

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

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

Hello @kbetsis,

try this statement

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

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