My SWAG is that the system user running Graylog doesn’t have sufficient permissions to run the script in /root (which only root has, naturally).
Try copying the script to another location (e. g. /usr/local/bin/) and set proper file permissions (e. g. 0755, which translates to everyone is allowed to read and execute the file).