davidgsd / AllScan

AllStar Favorites Management & Scanning Web App
https://allscan.info
GNU General Public License v3.0
27 stars 5 forks source link

Add support for Allmon3 #7

Closed Allan-N closed 2 months ago

Allan-N commented 5 months ago

I've been looking into setting up a node with "Allmon3" installed and without "Supermon".

Unfortunately, AllScan does not look at the "/etc/allmon3/allmon3.ini" file and doesn't like that the node's "passwd" key was changed to "pass". But, with a few [local] tweaks to "include/common.php" and "astapi/server.php" I have AllScan working.

Would you consider rev'ing the project to support Allmon3?

Thank you!

p.s. I'm happy to share my changes and/or create a pull request

davidgsd commented 2 months ago

Thanks for the info, I will not be able to work on this for a month or two, and I may just go with reading from /etc/asterisk/manager.conf rather than have unnecessary dependencies on supermon/allmon.

Allan-N commented 2 months ago

I may just go with reading from /etc/asterisk/manager.conf rather than have unnecessary dependencies on supermon/allmon.

+1 for removing unnecessary dependencies

alexjj commented 2 months ago

I've been looking into setting up a node with "Allmon3" installed and without "Supermon".

Unfortunately, AllScan does not look at the "/etc/allmon3/allmon3.ini" file and doesn't like that the node's "passwd" key was changed to "pass". But, with a few [local] tweaks to "include/common.php" and "astapi/server.php" I have AllScan working.

@Allan-N, would you mind sharing these changes? Perhaps in your forked version of Allscan? I've just setup a new node with ASL3 and Allmon3.

Thanks!

Allan-N commented 2 months ago

Yes, I'll see if I can pull back my forked (and archived) version. If not, I'll post notes here.

Allan-N commented 2 months ago

@alexjj I ended up needing to "delete" and "re-fork" so if you already had a copy you will need to re-clone.

@davidgsd I just created a pull request that will allow AllScan to pull the node and AMI information from "allmon3.ini" file. The pull request also gets AllScan running on the just announced ASL3 !

Note: one needs to open up the filesystem permissions of /etc/allmon3/allmon3.ini in order for the file to be used by exec'ing : sudo chmod o+r /etc/allmon3/allmon3.ini

davidgsd commented 2 months ago

Merged Allan's changes to support ASL3 and AllMon3

alexjj commented 2 months ago

Got it running with ASL3...thank you!

I did the sudo chmod o+r /etc/allmon3/allmon3.ini command, but I notice in asterisk -rvvv that it says it fails to authenticate as 'admin' and so cannot connect to nodes. I can use allmon3 to connect to nodes...so guessing it's still a file permission item.

I did try changing the group of /etc/allmon3 and /etc/allmon3/allmon3.ini to www-data but that didn't help either.

Allan-N commented 2 months ago

THE AMI 'secret' (in /etc/asterisk/manager.conf) is what should be stored in /etc/allmon3/allmon3.ini (as 'pass') The two need to be in the same.

Also, if you ever change the 'secret' in manager.conf then asterisk needs to be restarted. If you change the 'pass' in allmon3.ini then you need to refresh your AllScan browser window.

alexjj commented 2 months ago

I've verified the AMI secret is the same in the two files. I can control the node via allmon3 webUI, so suggests the password is correct and working. However AllScan still fails to authenticate when making node commands.

If allscan reads from another location for the AMI password, I can make the file there too...?

Allan-N commented 2 months ago

Odd. David will have to jump in for troubleshooting.

alexjj commented 2 months ago

Sure, there's no rush.

Just to check things...I removed allmon3, and reinstalled. Allscan definetely doesn't work at all without sudo chmod o+r /etc/allmon3/allmon3.ini, i.e. says there's no node configured. Then immediately following that command, it can identify the node and show the status.

What's interesting is on the allscan page it shows:

Connecting to Asterisk Manager 60161 127.0.0.1...Login OK
Could not login 

Where the first line is logging in to see the node details but then the second "could not login" is when I press a button to connect to a node, or issue any command to the node.