About network topology and ansible

236 views
Skip to first unread message

Daniel

unread,
Jul 28, 2020, 6:25:50 AM7/28/20
to OpenWISP
Hi everyone,

Here are several questions

1. How could I use the batman-adv in openwrt to send the mesh network topology to the collector on openwisp? I have already check other questions been posted before and  read http://wiki.ninux.org/TopologyVisualizer#Esempio_script_per_RECEIVE_strategy, but I have no idea about how batman-adv works like this. Does batman-adv in openwrt also have the functionality to send the json-like format?

2. If I want to delete all the things deployed by ansible on the production server, how should I do? And if I want to deploy the openwisp on the same production server but with different IP(such as 10.0.0.1 to 192.168.1.10), could I just change the IP in hosts and run the playbook again?

3. Is there any way to install the openwisp-monitoring in the openwisp deployed by ansible? It seems that monitoring module has not been released in ansible role.

Thanks,
Daniel

Federico Capoano

unread,
Jul 28, 2020, 12:58:17 PM7/28/20
to OpenWISP
Hi Daniel,

On Tue, Jul 28, 2020 at 5:25 AM Daniel <ljk2...@gmail.com> wrote:
Hi everyone,

Here are several questions

1. How could I use the batman-adv in openwrt to send the mesh network topology to the collector on openwisp? I have already check other questions been posted before and  read http://wiki.ninux.org/TopologyVisualizer#Esempio_script_per_RECEIVE_strategy, but I have no idea about how batman-adv works like this. Does batman-adv in openwrt also have the functionality to send the json-like format?
 
If I'm not mistaken they have a tool called alfred which collects information and can generate a json file: https://www.open-mesh.org/projects/alfred/wiki/Batadv-vis

2. If I want to delete all the things deployed by ansible on the production server, how should I do?

Delete /opt/openwisp2
Uninstall supervisord and delete /etc/supervisor
Remove the packages defined in the apt.yml file of ansible-openwisp2, but you have to be careful not to uninstall packages that may have been already been installed before for other services. In general we advise to dedicate a VM to just openwisp.
 
And if I want to deploy the openwisp on the same production server but with different IP(such as 10.0.0.1 to 192.168.1.10), could I just change the IP in hosts and run the playbook again?

Yes it should work.
 
3. Is there any way to install the openwisp-monitoring in the openwisp deployed by ansible? It seems that monitoring module has not been released in ansible role.

You're right, it's not included yet.
I left instructions on how to install it in another thread: https://groups.google.com/g/openwisp/c/WuhK5rJJTX8/m/H0RIZoMKAgAJ.
We'll include it soon, we're finishing some key improvements (see dev branch), you can follow updates on this thread if you're interested: https://groups.google.com/g/openwisp/c/rXHKkLdNiZ4/m/3a8yTeyfAAAJ

I hope this helps!
Best regards
Federico

Daniel

unread,
Jul 28, 2020, 1:25:22 PM7/28/20
to OpenWISP
Hi  Federico,

Thank you for your answer. It helps a lot!

Best regards,
Daniel 
federico...@gmail.com 在 2020年7月29日 星期三上午12:58:17 [UTC+8] 的信中寫道:

Daniel

unread,
Jul 29, 2020, 2:49:16 AM7/29/20
to OpenWISP
Hi  Federico,

I got some error message when I tried to follow the instruction in https://groups.google.com/g/openwisp/c/WuhK5rJJTX8/m/H0RIZoMKAgAJ to install openwisp-monitoring module.

Here is the error message.
screenshot.png

I also add the https://github.com/openwisp/openwisp-notifications/tarball/master in the openwisp2_extra_python_packages block.

Thanks,
Daniel

Daniel 在 2020年7月29日 星期三上午1:25:22 [UTC+8] 的信中寫道:

Ajay Tripathi

unread,
Jul 29, 2020, 9:53:03 AM7/29/20
to OpenWISP
Hi Daniel,

Sorry I haven't read the threat but the problem in the screenshot above is because you seem to be using Python2.7.
Python 2 has met the end of it's life cycle hence we have dropped it as well.
Please use Python3.6+.


Best,
Ajay Tripathi

Federico Capoano

unread,
Jul 29, 2020, 9:57:11 AM7/29/20
to OpenWISP
I think it's because the development version of the other openwisp modules need to be used, try with:


F.

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/fc451c50-a58e-4840-b90a-be1a102421a1n%40googlegroups.com.

Ajay Tripathi

unread,
Jul 29, 2020, 10:05:38 AM7/29/20
to OpenWISP
Disregard my earlier mail, on closer inspection, that doesn't seem to be the reason.

I haven't used openwisp-notifications with ansible yet, but it seems a development version of a dependency is used in openwisp-notification which is causing this.

I can't say with certainty without testing, but most likely adding the following in your playbook should work:


Ajay

Daniel

unread,
Jul 29, 2020, 11:13:23 AM7/29/20
to OpenWISP
Hi Ajay and Federico,

Thank you for yours answer. I will try it.

Here is another question I want to ask. Though it may be more related to nginx and certification problems.

Now I deploy my openwisp with a private ip, said 192.168.1.X, and I want to connect to the website from a public ip, said 140.X.X.X

I use a laptop based on ubuntu as the gateway with public(also 140.X.X.X) and private ip simultaneously, and use iptables to set NAT on it.

I set a PREROUTING rule with port 5000 to 192.168.1.X:443. And set a POSTROUTING rule for all traffic.

But when I type https://140.X.X.X:5000 in my broswer, it shows 404 not found, and it shows TLSv1.2 Alert 73, Level Fatal, Description: Certificate Unknown in wireshark.

I want to know how to solve it. Sorry for that this question is not related to openwisp and I am not familiar with nginx and certification.

Thanks!
Daniel
ajay...@gmail.com 在 2020年7月29日 星期三下午10:05:38 [UTC+8] 的信中寫道:

Federico Capoano

unread,
Jul 29, 2020, 12:57:20 PM7/29/20
to OpenWISP
That question is not related to OpenWISP but to iptables, I suggest you to ask on superuser/stackexchange.


--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.

Daniel

unread,
Jul 30, 2020, 11:10:57 AM7/30/20
to OpenWISP
Hi Federico,

Sorry for bothering you again.

I have tried to use the development version of the other openwisp modules, but there is still an error message when migration.

Here is the error message.

screenshot.png

Thanks!
Daniel
federico...@gmail.com 在 2020年7月30日 星期四上午12:57:20 [UTC+8] 的信中寫道:

Hardik Jain

unread,
Jul 30, 2020, 6:58:27 PM7/30/20
to open...@googlegroups.com
Hi Daniel,
I think openwisp-notifications needs to be installed.

It is now a permanent dependency of openwisp-monitoring. At the time of sharing the above playbook, that wasn't the case. Hence, missed out I think.

Regards
Hardik

screenshot.png

Federico Capoano

unread,
Jul 30, 2020, 7:03:25 PM7/30/20
to OpenWISP
Try to remove openwisp_monitoring.notifications from INSTALLED_APPS but ensure openwisp_notifications is present in INSTALLED_APPS and also installed as a dependency as Hardik pointed out.

If it doesn't work, share the playbook with us please (removing sensitive info) so we can have better insight.

F.

Daniel

unread,
Jul 31, 2020, 6:15:22 AM7/31/20
to OpenWISP
Hi,

Here are still also several error messages.

screenshot.png

And the attached file is my playbook.

Thanks,
Daniel
federico...@gmail.com 在 2020年7月31日 星期五上午7:03:25 [UTC+8] 的信中寫道:
playbook_bk.yml

Federico Capoano

unread,
Jul 31, 2020, 11:35:45 AM7/31/20
to OpenWISP
The playbook looks good.
The problem seems to be in a line that has been changed recently in a data migration, which is causing that issue.
It should be fixed, can you run the playbook again, ensuring the latest master of openwisp-monitoring is installed and let me know please?

Thanks
Federico

Message has been deleted
Message has been deleted

Yu Shuo Chang

unread,
Aug 1, 2020, 9:38:41 AM8/1/20
to open...@googlegroups.com
It works now! Thank you so much!

Best regards,
Daniel

Federico Capoano <federico...@gmail.com>於 2020年7月31日 週五,下午11:35寫道:

Daniel

unread,
Aug 2, 2020, 5:31:46 AM8/2/20
to OpenWISP

Hi Federico,

Here is another question.

After running the playbook successfully, I cannot see any chart or device status.

I can only see that there is a check method ping. And the health status is always unknown even I have successfully changed some configuration and applied to my AP.

Is there something about settings.py or other things missing in the playbook? Or is there something to be added in the openwisp-config of AP?

Sorry for asking so many questions so far.

Best regards,
Daniel
Daniel 在 2020年8月1日 星期六下午9:38:41 [UTC+8] 的信中寫道:

Federico Capoano

unread,
Aug 2, 2020, 8:34:10 PM8/2/20
to OpenWISP
Hey Daniel,

correct, there's a part missing, since this is still a work-in-progress, but I forgot to tell you.

You have to create a template (flag it as default and assign it to your devices): the content of the template is here: https://gist.github.com/nemesisdesign/cb005dc80a75536cf8537105c3038a71

In the future we should make this an openwrt package like openwisp-config, but now I'm doing it this way in order to move faster and the other contributors are just following along.

For now, we are iterating and improving the "netjson-monitoring" script in this repo: https://github.com/openwisp/lua-monitoring/
We update it often to add new features (eg: https://github.com/openwisp/lua-monitoring/pull/17).

Regarding the monitoring system and notifications module, we have a lot of improvements that will be soon merged in the master branch (the playbook will have to be updated too), now available in the dev branches of openwisp-monitoring and openwisp-notifications, so I suggest to stay tuned for updates, I don't really suggest you to try these yet, since I'm doing it and I'm finding a some rough edges that we're working to fix, it may be too frustrating for you to try that now.

Let me know if you can make it work!

Federico

Federico Capoano

unread,
Aug 2, 2020, 8:46:37 PM8/2/20
to OpenWISP
One more thing:

On Sunday, August 2, 2020 at 4:31:46 AM UTC-5 Daniel wrote:
I can only see that there is a check method ping. And the health status is always unknown even I have successfully changed some configuration and applied to my AP.

This should not happen. At least the ping check should work also without the lua script and you should see the uptime, packet loss and RTT charts.

When this happens, it means that the active checks are not being run.

There's a part of the playbook which mentions "templates/celerybeat.j2".
Is this part of the playbook executed correctly? Maybe the ansible template is missing, ensure this is in the templates/ dir of the ansible playbook:

[program:celerybeat]
user={{ www_user }}
directory={{ openwisp2_path }}
command={{ openwisp2_path }}/env/bin/celery -A openwisp2 beat -l info
autostart=true
autorestart=true
stopsignal=INT
redirect_stderr=true
stdout_logfile={{ openwisp2_path }}/log/celerybeat.log
stdout_logfile_maxbytes=30MB
stdout_logfile_backups=5

Ensure celerybeat is correctly installed in the supervisor configuration and shows up as "RUNNING" when you do:

supervisorctl status

Federico
Reply all
Reply to author
Forward
0 new messages