Hey there,
playSMS is a great tool and nice to handle if you have spend some times for testing
But Iām frustrated using SMS Command Module.
Scenario:
My Company is using PRTG for Monitoring reasons, sending Notification works fine (using scripts and gammu-smsd-inject, not playsms http api).
Now I want to Acknowledge an Alarm, PRTG provides an HTTP(s) API which works fine while manual testing.
I created an SMS_Command with the Keyword āACKā, and PlaySMS reacts on the Keyword (Status in Reports -> All Feature Messages -> Keyword ACK) but playsms doesnāt run the script as I added to write in a test.log.
There is no logging for recognizing the keyword. The Directory itself is 777 chmodded.
So it says command output is empty. If i run this script manually there is an Output.
The Output command in the script is: echo āYou are not authorized to this Actionā
Okay, I tuned my script and it is working but I didnāt change anything of the echo command, more the fine tuning of the work flow. Also there is some data missing in between.
Unfortunately my other testscript doesnāt run, it just echoes system uptime and timestamp. Iāll post the log later but I think there is āno outputā again.
OK, so far so good.
My Output with echo works now (donāt know why). But there are several issues:
I canāt get any Output with curl, I think curl canāt be executed, So, the control of authorization (Number = User and Passwordhash) doesnāt work too.
Maybe Iāll create another script, which will be called by the SMS command. Letās see, Iāll Report.
ok, Problem solved:
as WWW-data user, I canāt run curl and some other commands,
So i outsourced the Code to another script and when a sms command is recognized by Playsms the scripts calls the other scripts with sudo: sudo -i -u sms
Itās important to use the -i option to run the script in the sudo user enviroment!