this is the message I'm getting when i run "sudo -u asterisk /etc/asterisk/scripts/astdb.sh"
PHP Warning: fopen(/var/www/html/supermon/astdb.txt): Failed to open stream: Permission denied in /var/www/html/supermon/astdb.php on line 98
Cannot open /var/www/html/supermon/astdb.txt./etc/asterisk/scripts/astdb.sh: line 12: astdb.txt.1: Permission denied
mv: cannot stat 'astdb.txt.1': No such file or directory
Then definitely a permissions issue as @Mike stated.
You could cd into the folder and type ls -a which will show the owners of that file and the permission level. If it is working with sudo -s and that's not an issue then you could always use it with that.
What mike is saying is that in the error it says line 98 is causing the issue so share that line from within the file.
I think maybe if you add your asterisk user to the www-data (or the relevant user group) then the issue will get resolved.
A 'shell script' is just a list of commands that you can run from the command line. But you must have the right of the files.. All asl files will be owned by user asterisk and group asterisk.
But I don't know what this is., sorry I don't use supermon
Go to this file and see what is on line 12
But the other error seems to be that the asterisk db is not opening for reading.
Likely causing the other error.
That is the best I can guess from what you presented.
yes and yes
i think it is
-rw-r--r-- 1 root root 1404661 May 18 12:53 astdb.txt - sm folder
-rw-r--r-- 1 asterisk asterisk 1406215 May 18 12:51 astdb.txt - asterisk folder