Script which logs to event log/notification center

TS-453A
QTS 5.2.3.3006 Build 20250108

I am trying to write a bash script that under certain conditions adds an event to the event log so that I can then use the notification server to send an email. I am having two problems.

Problem 1

I am logged in via SSH using my admin account (not the built-in admin account). I can’t get the log_tool to work successfully unless I use sudo, which obviously isn’t going to work in a script run via cron.


[MyAdminAccount@MyNAS ~]$ log_tool -v -a "MyError" -t 2
Appending append_msg log to database...
Done. Return value is -23

[MyAdminAccount@MyNAS ~]$ sudo log_tool -v -a "MyError" -t 2
Appending append_msg log to database...
Done. Return value is 0

Problem 2
From the Event Log viewer, if I try to “Create event notification rule” for the event, it takes me to the notification server with the error “A notification rule cannot be created for this application because this application did not successfully register with Notification Center”.

Do I have to register my script as an app or is there some way to work around these problems? I don’t want to have to register as a QNAP developer to do what I consider to be just normal admin stuff on my NAS.