You are here

AAM Manager

40 posts / 0 new
Last post
WT0F
AAM Manager

Today I would like to announce the general availability of an application that I wrote mostly this past weekend.

It is AAM Manager (aka AAMM) to make manager AREDN alert messages easier. It allows one to create, update and delete AAMs from a web interface without having to log into a node or a Linux machine to hand edit files. In addition, it supports the new group AAMs that was added to the AREDN firmware in the 3.23.8.0 release.

This GA version (v0.1.2) can be found at https://gitlab.com/aredn-apps/aamm/-/packages/18753925 as an installable package for AREDN nodes. While AAMM can also run on Linux machines, like MeshChat, it requires access to the OLSR information found on nodes and this requires a number of extra steps to get a list of nodes into AAMM for creating alerts. Ideally, when a list of nodes does not get returned one can enter a node name into a text box, but this has not been tested on Linux yet. If necessary I can add a quick patch to force the text entry box to be used until AAMM gets more mature.

I am sure that there are still a few bugs and use cases that have not been discovered yet and I would encourage anyone using AAMM that finds anything to file an issue in the project so that I can address it. You will find a link to both the project and for creating issues at the bottom of the AAMM page.

If you would like to take a look at AAMM and are on a mesh connected to the Tennessee SouthMesh or connected to a Supernode that connects to the SouthMesh, you can go to http://10.252.176.33:8080/aam (also http://wt0f-1.local.mesh:8080/aam if you have a connection to SouthMesh). This is a test node, so it does not serve any real AAMs. You can log into this copy of AAMM with the password 'change_me'.

I would appreciate comments and suggestions, either here, as an issue in the project or you can contact me directly at wt0f@arrl.net.

73
--
Gerard
 

AB7PA
creating and maintaining AREDN Alert Messages

Gerard, thanks very much for this contribution!  It should help many people learn about, create and use AREDN Alert Messages on their networks, since it can run directly on a node (no separate server required to host the messages).  Looking forward to your many ideas and contributions.

AC2OG
AC2OG's picture
AAM Manager
Hi Gerard,
I have a separate WEB Server based on a Raspberry. Is your new package allowing for managing alert messages in this case?
Thanks !
73 de Leo, i3rke/ac2og
WT0F
Hey there Leo!
Hey there Leo!

Yes, it basically will. Or should I say should work. I have not yet had a chance to test it on a separate Linux machine. The one thing that will not work today (it will in the near future) is populating the dropdown list with all the node names. What you should get is a text entry box that would allow you to type in the node name directly to create the message. Worst case is you will still get the dropdown box and there is a selection for an unlisted node which then enables the text entry box. If you have difficulties running it on Linux, please let me know so that I can work with you to get it running flawlessly (which is one of my goals of the project).

I am not producing a Debian package of AAMM yet (again, another thing that will happen in the future), but installation on a Linux OS is pretty straight forward. Assuming you already have LUA installed on Linux, you would want to copy the files in the `www` directory to a `aam` directory in your web server root directory (probably /var/www/html/aam). Then copy the `aamm*` files to where your `cgi-bin` directory is located (probably /usr/lib/cgi-bin). Make sure that the `aamm.lua` file has execute permissions and then it should be accessible as http://<linux hostname/ip>:8080/aam/.

I would be interested in hearing your results.

73
--
Gerard, WTØF
 
WT0F
Doh!!
Doh!!

I decided to take a few moments before going to do some oil changes to get AAMM running on Linux to do some testing. One thing I was not thinking about is that the OpenWRT environment that AREDN uses has a number LUA modules installed which are not installed on Linux. I will either have to rewrite a few things to remove the dependency on the additional modules (luckly only 2-3 spots) or work on getting the modules installed under Linux. I tried but `nixio` was having problems compiling during the install.

So hold tight for a couple of days and I will have a new version out that will address these issues on Linux.

73
--
Gerard, WTØF
 
WT0F
Sorry for the delay, but I
Sorry for the delay, but I was having problems with the release software to work correctly. Now that things are working correctly I have released the Debian packaging for Linux installations. All the LUA code has been rewritten so that it should be working on Debian derivatives and AREDN nodes.

While I still need to get the release software working to post the changelog for the release, at least the packages will be automatically created and listed on the release page. You can find the latest packages at https://gitlab.com/aredn-apps/aamm/-/releases

If anyone finds any bugs or problems installing, please create an issue in the project.

BTW, I just noticed that the package names are not correct on the release, but that will get fixed in the next release.
 
nc8q
nc8q's picture
the new group AAMs that was added to the AREDN firmware in the 3

"the new group AAMs that was added to the AREDN firmware in the 3.23.8.0 release."

Hi, Gerard:

I would like to know more about AREDN-AAM and your AAMM.
I insert local airport temperature into my AAMs updated every 10 minutes.
What does your AAMM do?
Is there documentation available?

73, Chuck nc8q

 

AB7PA
AAMM documentation is

AAMM documentation is available both here and here.

WT0F
Thanks, Steve, for

Thanks, Steve, for documentation citations. I did not realize that AAMM entry had been put up on the arednmesh.org site and have been planning on putting something together. I was surprised to see it and happy to see the superb job you have done to keep that site up to date.

Chuck, the documenation that Steve has cited is what is out there right now. I will be continuing to put some more documentation out there around AAMM and certainly feel free to ask questions or suggest improvements. Questions will help guide me to where I need to work on improving the documentation.

AAMM right now works best on an AREDN node, but I am working to have it operate with the equivalent feature set on a Linux machine. I know that there are some that prefer to run AAMs off a separate web server. There are still a few things that need to happen to have it operate flawlessly on Linux, but it will get there. 

One of the future improvements is to continue to improve the API aspect so that automated messages can be created and removed with a series of scripts. The functionality is really there and you probably want to take a look at the API documentation for an idea of how this would be done. It is actually the same way that the web interface creates and removes AAMs.

73
--
Gerard.
 

K7EOK
AAMM Use Instructions

Hi Gerard,  this looks very useful.

I found the ipk package, great.  The docs provided say the messages have to be on a web server.  Do you mean while the package resides on a node, the message files must be on a separate web server ... something like a PC or other with Apache2?  This would mean that we have to configure the new AAMM with the ports and forwarding as well ... and have a unique port for this service on the other machine ... etc etc ...

Can you (or someone who gets it) make a step by step example of an installation ... with screen shots of an actual working instance?  Or a video how to set this up?  I especially would like to get the detail about how you make groups to receive messages so you don't spam the entire network with broadcast messages.

Thanks,
Ed
 

WT0F
Sorry for any confusion.
Sorry for any confusion.

If you are running AAMM on an AREDN node (which you proably are if you installed the .ipk file) then there is already a web server running and AAMM will use this web server. In this case you would set the nodes up to use http://<nodename>:8080/aam (nodename being the name of the node where AAMM is installed)  as the "Alert Message Local URL" in the advanced settings. This will cause all the nodes to check the node for any alerts periodically (set by the Alert Message Pollrate in the same section). I think the reference to the messages being on a web server is in the section about installing AAMM on a Linux machine and can be ignored if you are only using AAMM on a node.

AH, I just re-read the README file and I do reference a centralized web server there too. I will get some updates to clarify the statements as to not continue to confuse people. Thank you for pointing this out.

There will certainly be more documentation in the future as I continue to develop some of the aspects of AAMM. As for the group message functionality I would suggest reading the docs I wrote for the group messages in the AAM documentation. If you still have questions about group messages, please let me know and I will see if I can rewrite some of the documentation to make things clearer.

73
--
Gerard
 
nc8q
nc8q's picture
Password Required?

Hi, Gerard:
I looked 'there' and 'there' and 'there'.
Where do I program a password?
Someone please publish a skeleton GET and ACTION HTML
Chuck

 

Image Attachments: 
WT0F
Not a problem. It is a very

Not a problem. It is a very young project (most of it was written in a weekend) and there is still plenty of work to do.

When you have the opportunity read the configuration doc as that is where the password and other settings are found. The quick answer for you is to edit /www/cgi-bin/aamm_config.lua and set the password there. The default is "change_me" and you should be able to use that right now. The password is stored in plain text in the config file so you can set it to anything you want.

As for the API, it is a very simple syntax. Here are a couple of examples:

http://<node>:8080/cgi-bin/aamm.lua?action=list_alerts
http://<node>:8080/cgi-bin/aamm.lua?action=list_nodes
http://<node>:8080/cgi-bin/aamm.lua?action=create_alert&auth=<password>&alert_file=foobar.txt&alert_text=WARNING+WARNING+Will+Robinson

All the API calls return a JSON document on success or failure. Success will pass back data like for the list_alerts or list_nodes calls. Failures will pass back a result that tries to describe the failure. Also note that the alert_text needs to be quoted (encoded). I though that I had referenced the quoting function in the API document, but I don't see it. Here is the decoding function until I can get some more documentation about it: https://gitlab.com/aredn-apps/aamm/-/blob/main/aamm_lib.lua?ref_type=heads#L98


 

nc8q
nc8q's picture
read the configuration doc
Hi, Gerard:

Thanks.
I had no clue as to how to navigate the gitlab web site nor what filename to seek.

73, Chuck
 
K7EOK
OK, I'll wait for more
OK, I'll wait for more information.  One question now ... this package uses port 8080 on the node?  That is the same port used by meshchat and other packages.  is this a problem?  Do we need to change ports on one of the packages?  How do we accomplish this?

Add this to the bewildered potential grateful user questions list ... :-)
 
Ed
 
WT0F
Ed, keep asking the questions
Ed, keep asking the questions! It helps me understand if there is a gap in the documentation and/or help people increase their knowledge. I am happy for both.

On an AREDN node AAMM will run on port 8080. There is no conflict with any other packages as they all get accessed from different URLs. Think of it this way; you can run multiple applications on your computer with out having to have different operating systems for each application. Imagine how painful it would be if for one application you needed to run Windows XP and for another application you would need Windows 10. But wait to run that third application you would need Windows NT. Woefully inefficient! So it is the same with web applications as long as the paths in the URL don't collide.

This is slightly different for Linux. The default web server on Linux is preconfigured to use port 80 instead of port 8080. This can be changed, but in most casess it is sufficient to run AAMM on the port that the is used by the web server what ever operating system is actually being used.
 
K7EOK
OK, I'm lost
Hi again,

I found the lua package on github and installed it to a node.  Then I found the package on my node and the web interface by http://localnode.local.mesh:8080/aam/ and it comes up looking like the example.  I cannot login as I cannot find anywhere where the default admin password is.  I tried (blank), admin, password, my node admin password ... nothing gets me in and I can't find a default password in the github files.

I then went into the node using ssh and looked around to find the cgi-bin/aamm_config.lua file to try to edit the password and cannot figure out where it is located.  I really could use some help finding this and configuring the package.

Thanks,
Ed


 
WT0F
Hey there Ed,

Hey there Ed,

The default password is 'change_me'. If you look in the /www/cgi-bin/aamm_config.lua file you should see the password there that can be changed to what ever you want. Your config file should look something like this:

Config = {
    aam_dir = '/www/aam',
    api_url = '/cgi-bin/aamm.lua',
    password = 'change_me',

    debug = false,
    lock_file = '/www/aam/lock',
    alert_groups = {  },
}

return Config

Take a look to see if there is a aamm_config.lua.opkg file. This would indicate that there was already an aamm_config.lua file (from a previous install) and the package manager would not clobber the existing file. Maybe on the previous install the password line got accidentally deleted? If the line is not there, you can add it with any text editor (just make sure you don't forget the comma at the end of the line). That should get you going without too much trouble.

73

Gerard, WT0F


 

K7EOK
OK, I used the default
OK, I used the default password and got into the package.  Our mesh nodes were listed and I selected a node, created a message for it to display.  Nothing happened.

Can you provide a step by step explanation how this is supposed to work?

Thanks,
Ed
 
WT0F
Sorry the documentation for
Sorry the documentation for AAMM is still a bit sparse. The past couple of months have been busy with relocating everything to Florida and selling houses and such. But things are slowly getting back to normal and hopefully in the early part of the new year I will have time to create the documentation. 
 
In the mean time, you will find that AAMM is a very simple application. You have already seen that you can select a node that is on your mesh and this enables a text box that allows you to create the alert message for that node. When you click the create button, you will see that node appear in the list of AAMs on the left side. You can select any of the AAMs on the left side to update the message or delete it. That is most of it right there. What it is doing on the back side is managing the files in the /www/aam directory. If you go look at that directory you should see files labeled <NODE>.txt.

The additional things that AAMM does is allow you to list the group AAM labels and create those alerts also. You will need to update the config file with the group names in the appropriate config setting. See the AREDN AAM settings documentation for a discussion about group AAMs.

In the node drop down you will see "Other node not listed" and "All nodes". Use the "Other node not listed" when you do not have the node in the dropdown list.This can occur if the node has just recently come up or if the node is disconnected from the mesh and is not present in the OLSR broadcasts. The "All nodes" will allow you to create an AAM message for every node on the mesh.

That is about it. Like I say it is not a complicated application. It just makes it easer to work with AAMs--especially for people that are not familur with a UNIX like operating system.

BTW, there is a little bit of documenation (I agree not much) on the documentation link at the bottom of the page. Make sure that you are running version 0.2.1, although anything beyond 0.1.2 should be quite functional.

73
Gerard, WT0F
 
K7EOK
I can't figure out how to
I can't figure out how to create a message in the package, then have it display on the node.  I've done alert message refresh several times.

I guess I'll wait until the movie comes out smiley
 
WT0F
I forget the default poll
I forget the default poll time for AAM on the nodes, but it is in the order of 6-8 hours. So if you are creating a message and expecting it to display on the node just after creating the message, that is almost never going to happen. The poll time can be tuned and is in the advanced configuration on the node. Also insure that you have set the AAM URL to point to http://<NODE>.local.mesh:8080/aam/. <NODE> of course is the node name that you have AAMM installed on.

Hope this helps you.

73
Gerard, WT0F
 
K7EOK
Yes and Yes
Yes and Yes. 
K7EOK
Finally got this to work. 
Finally got this to work.  More practice and testing to go.

Interesting how you have to set the local url on each node to make it able to pick up a message.  Next I work on the logic of creating groups of nodes to get regional messages without spamming the entire network.

Q.  You have to put a local url for message pickup into the field in advanced settings for a node to look for a message, ok.  Can one node be setup with multiple locations (multiple nodes) to look for messages on?

Ed
 
WT0F
No, nodes are not able to
No, nodes are not able to look at multiple URLs for AAMs. The code will only accept a single URL for where to find AAMs.
AB7PA
Local Alert Messages are an "opt in" service

Local Alert Messages are an "opt in" service. Node owners choose whether or not they want local alert messages, and if so, then they opt in by following the steps Gerard WT0F provided a link to in his reply below.

K7EOK
And now Q2. 

And now Q2. 

I can see in a node's advanced settings how you enter Alert Message Groups for what message groups you want your node to retrieve messages from.  OK.  What is not at all clear is the syntax that is or is not allowed for the group names.  Also not clear is how to use the AAMM web tool to create a group. 

I guess to make a group the previous way you would go manually into the node files and make a .txt file that has the "group name" you want to make available.  I can't see how to make a group using the AAMM tool. 

Thanks,
Ed
 

WT0F
Please have a look again at
Please have a look again at https://docs.arednmesh.org/en/latest/arednGettingStarted/advanced_config.html#aredn-trade-alert-messages. Specifically the second bullet of the Alert Message Local URL section. That describes the format to the group AAM name.

As for AAMM, the group names need to be entered into the configuration file so that AAMM is aware of the group names. The group AAM names can actually include upper case characters in AAMM, but the file is always written with lower case characters to adhere to the AAM naming convention.

73
Gerard, WTØF
 
K7EOK
OK, so if I'm reading this

OK, so if I'm reading this correctly then the format of a group name is pretty flexible, but I have to use ssh and a linux text editor to go into the node files to create the .txt file in the correct directory with the node name, then I can reference that node name in the node that is the repository and in the advanced settings of the node that opts in to receive. 

You can make the all.txt file on the AAMM tool, you can make <nodename>.txt files for specific nodes on the AAMM tool ... so a feature request would be the ability to make the group .txt files also using the AAMM tool.  (Edit ... I'd like the AAMM tool to be able to create the GROUP NAME not just the message for an existing group).

Another related request would be for the developers in general ... it might be nice to put control if the receiving node can refresh any alert messages or clear old ones on the main status page.  I can see why the settings need to be password protected, but if the node operator isn't available for some reason and many people use the node it would be helpful if they could both clear old messages, and see if there are new ones wiithout having to login to the admin page.

Thanks,
Ed

WT0F
Please refer back to my
Please refer back to my message dated 12/10/2023 where I provide the aamm_config.lua file that is distributed in the AAMM package. You just might find a configuration value there that allows one to define the AAM group names. There might also be a bit of a definition in https://gitlab.com/aredn-apps/aamm/-/blob/main/docs/Configuration.md?ref... to describe the configuration values.

So, yes you do still need to log into the node and use a text editor, but not to create the group AAM files but the AAMM configuration file.

Although, I do admit that I should probably have a bit more text around how the group names get listed. LUA expects each group name to be quoted and the values need to be comma separated. I will get some more verbiage around how to format the values in the configuration documentation.

73
Gerard, WTØF
 
K7EOK
Cannot find the config file

OK, dumb Linux newbie question ...

Configuration of AAM Manager is controlled by the aamm_config.lua file that is usually located in the web server's cgi-bin. For an AREDN1 node installation this location would be /www/cgi-bin. For other installations, please consult the web server documentation for the location of the cgi-bin directory.


I have aam manager installed on a hAP ac lite, running 3.23.12.0, and have logged into the node via ssh.  Doing a ls search for the directory www I cannot find it anywhere.  Can you explain the full url path for these files so I can access them?  I've looked in every existing folder (blue) I can find and nowhere can I find the aam files.  I see all the usual linux folders etc, lib, usr, web ... but nowhere is www.   I know that cgi-bin exists because I have pointed to that location with my web browser to get to the aam and sometimes for navigation around the setup files in general. 

I'm assuming I'm supposed to get into the node via ssh and use a text editor to change the config files ... correct?  I'd try this if I could find them.

Thanks,
Ed
 

nc8q
nc8q's picture
ls -l /

Hi, Ed:

gelmce@nc8q-desktop:~/Pictures$ ssh -p2222 root@nc8q-hap1
root@nc8q-hap1's password:


BusyBox v1.36.1 (2023-11-14 13:38:11 UTC) built-in shell (ash)

              _____  ______ _____  _   _
        /\   |  __ \|  ____|  __ \| \ | |TM
       /  \  | |__) | |__  | |  | |  \| |
      / /\ \ |  _  /|  __| | |  | | . ` |
     / ____ \| | \ \| |____| |__| | |\  |
    /_/    \_\_|  \_\______|_____/|_| \_|
    AMATEUR  RADIO EMERGENCY DATA NETWORK
-----------------------------------------------
 1) Research AREDN and choose a supported device
 2) Download and install AREDN firmware
 3) Deploy and enjoy the mesh
-----------------------------------------------
  20231219-cd4b991, r23630-842932a63d
 ----------------------------------------------
root@NC8Q-hAP1:~# ls -l /
drwxr-xr-x    2 root     root           762 Nov 14 13:38 bin
drwxr-xr-x    4 root     root          1120 Dec 19 13:12 dev
drwxr-xr-x    1 root     root             0 Dec 19 13:12 etc
drwxr-xr-x   11 root     root           497 Nov 14 13:38 lib
drwxr-xr-x    2 root     root             3 Nov 14 13:38 mnt
drwxr-xr-x    5 root     root             0 Jan  1  1970 overlay
dr-xr-xr-x   90 root     root             0 Jan  1  1970 proc
drwxr-xr-x   16 root     root           223 Nov 14 13:38 rom
drwxr-xr-x    2 root     root             3 Nov 14 13:38 root
drwxr-xr-x    2 root     root           804 Nov 14 13:38 sbin
dr-xr-xr-x   11 root     root             0 Jan  1  1970 sys
drwxrwxrwt   21 root     root           720 Dec 19 15:55 tmp
drwxr-xr-x    1 root     root             0 Nov 14 13:38 usr
lrwxrwxrwx    1 root     root             3 Nov 14 13:38 var -> tmp
drwxr-xr-x    1 root     root             0 Dec 19 14:12 www
root@NC8Q-hAP1:~#


 

K7EOK
Yep ... still no www directory ????

Here is my node

K7EOK
Weird ... when I add a space before the / I get ...

drwxr-xr-x    2 root     root           762 Apr 27  2023 bin
drwxr-xr-x    4 root     root          1040 Dec 18 01:23 dev
drwxr-xr-x    1 root     root             0 Dec 18 01:00 etc
drwxr-xr-x   11 root     root           460 Apr 27  2023 lib
drwxr-xr-x    2 root     root             3 Apr 27  2023 mnt
drwxr-xr-x    5 root     root             0 Jan  1  1970 overlay
dr-xr-xr-x   88 root     root             0 Jan  1  1970 proc
drwxr-xr-x   16 root     root           223 Apr 27  2023 rom
drwxr-xr-x    2 root     root             3 Apr 27  2023 root
drwxr-xr-x    2 root     root           816 Apr 27  2023 sbin
dr-xr-xr-x   11 root     root             0 Jan  1  1970 sys
drwxrwxrwt   22 root     root           700 Dec 19 16:31 tmp
drwxr-xr-x    1 root     root             0 Oct  7 17:03 usr
lrwxrwxrwx    1 root     root             3 Apr 27  2023 var -> tmp
drwxr-xr-x    1 root     root             0 Oct  7 17:03 www

I guess blank spaces were the command issue.  I can cd /www/cgi-bin/   now

Thanks Chuck for the hints in the command line.  Now I can try to learn vim instead of nano for text editor ... or is it reasonable to put nano on an AREDN node?

Ed
 

nc8q
nc8q's picture
Weird!

Hi, Ed:
You did not 'add a space'...you omitted a space.
Had you used 'click-and-drag then copy-and-paste' instead of eyes and fingers...
;-)
No better time than now to learn vi.
73, Chuck

 

K7EOK
Every day ... a learning

Every day ... a learning experience.   Now I gotta quite fooling around with AREDN and get to work.

OK, I went into the config.lua file with vi and did add a group ... now the aam manager won't let me login.  I didn't change password but somehow editing this file destabilized the whole thing.  I think I will have to delete the package and start over fresh.

BTW is it reasonable in memory burden to install nano on the AREDN node itself?  vi is SO not intuitive.  If I didn't read how to use it I would have no idea ...

Ed
 

nc8q
nc8q's picture
scp down:edit with your favorite:scp up

Hi, Ed:
If the file to edit is uncomfortably large for vi or vim,
I create/edit the file locally, then use 'scp' to send it to the node.
e.g. I edit a local whitepages for our local PBX, the use a bash
script to 'scp' it to several nodes.
3s, Chuck
 

K7EOK
And now Q3.
And now Q3.

I have AAMM installed on a node, and have been using it.  I am using ssh, trying to get to the www/cgi-bin/aam folder so I can add manually a <groupname>.txt file for aam.

I cannot find this anywhere in the directory structure.  Can someone give me a full path as I would find it on an AREDN node to the directory?

Thanks,
Ed


 
WT0F
The directory for AAMs is
The directory for AAMs is actually /www/aam.

As I was referring to in my last reply, you don't need to create a text file for the group AAM. In fact, AAMM will not really have knowledge of the group AAM message just by creating the text file. The group AAM names need to be properly registered in the AAMM config file (/www/cgi-bin/aamm_config.lua) so that AAMM would be able to create the files for you when you create the actually group alert.

73
Gerard, WTØF
 
K7EOK
Errors in the config file
Errors in the config file found and corrected, now works.  Also a group created and tested.  I see many potential uses for this tool.

I still would like pull and purge control on the main status page.  I can see how the existing tools can manipulate the group .txt files.

Ed
 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer