NetXMS Support Forum

English Support => General Support => Topic started by: sq on October 29, 2021, 12:07:10 AM

Title: Notification Channel driver "Shell"
Post by: sq on October 29, 2021, 12:07:10 AM
Hi, could you please provide some documentation for the "Shell" "Notification Channel" driver?

I was looking for some documentation in the source code:

https://github.com/netxms/netxms/blob/3f1e052583ade764a1512e30c16ca6809ec8e982/src/ncdrivers/shell/shell.cpp

but for example

Command=/usr/bin/test.py --message=${text}

${text} ends up empty.

and I'm not sure how to enable a higher debug level (6) for this shell driver, the debug of the dummy driver worked pretty much as expected, for the shell driver I've tried to enable the debug output with the following command:

nxadm -c "debug ncd.shell 6"

Title: Re: Notification Channel driver "Shell"
Post by: Filipp Sudanov on November 01, 2021, 02:07:30 PM
Your debug approach looks to be correct. There also could be also some information under "nc" tag.
Is the actual .py script executed?

I've tried like this, it's working:
Command=/bin/bash -c "/bin/echo ${recipient} ${text} >> /tmp/sss.txt"

What exact version of netxms are you using?
Title: Re: Notification Channel driver "Shell"
Post by: sq on November 04, 2021, 05:04:36 PM
NetXMS Server Version 3.9.298 Build 3.9-298-g2adbdd51e5 (UNICODE)
NXCP: 5.53.1.31 (AES-256, Blowfish-256, 3DES, AES-128, Blowfish-128)
Built with: g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0


for test purposes I've copied your command, /tmp/sss.txt is created, but empty.
Title: Re: Notification Channel driver "Shell"
Post by: sq on November 04, 2021, 05:23:34 PM
I'm now on

NetXMS Server Version 3.9.334 Build 3.9-334-g799c5eb953 (UNICODE)
NXCP: 5.53.1.31 (AES-256, Blowfish-256, 3DES, AES-128, Blowfish-128)
Built with: g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0


same behavior, but I've figured out the file /tmp/sss.txt  isn't "empty" a blank line is added for every test notification.
Title: Re: Notification Channel driver "Shell"
Post by: Filipp Sudanov on November 09, 2021, 04:51:55 PM
Replicated this on Ubuntu 18 so looks to be a bug. Created an issue, you can monitor resolution there: https://track.radensolutions.com/issue/NX-2170
Title: Re: Notification Channel driver "Shell"
Post by: Victor Kirhenshtein on November 17, 2021, 09:34:09 AM
Fixed in 3.9.361.

Best regards,
Victor