device details storing in openwisp and automating templates

59 views
Skip to first unread message

AlphaGhost

unread,
Jul 8, 2024, 11:29:25 AM7/8/24
to OpenWISP
Hi all,

          I am new to openwisp. right now i am monitoring 4 openwrt devices through openwisp. I was trying templates for pushing ipsec configuration for all the openwrt devices, I used placeholders for replacing the values while applying configuration, But my doubt is, It will be a time taking task if we have 100 devices monitored by openwisp while pushing device specific templates via place holders. so, can anyone guide me on how to automate the template pushing and also where the device details are stored and how to access those details and male it to fill in templates automatically.

Thanks,
Thrisha.

Federico Capoano

unread,
Jul 9, 2024, 1:01:28 PM7/9/24
to open...@googlegroups.com
The data is stored in the SQL database. 
You can automate this either with the REST API or with Python scripts, the exact way to do this depends on the details.
The REST API is documented in the README of OpenWISP Controller, or as soon as the unified documentation is published, it will be available there.
If you want to use a Python script, you need to be familiar with the Django ORM, you can find the model definitions in the source code of OpenWISP Controller on Github.  

I hope this helps.
Best regards
Federico Capoano

--
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/338c533f-197b-42cc-bc8f-4b7e53a0bbf4n%40googlegroups.com.

AlphaGhost

unread,
Jul 16, 2024, 11:28:21 AM7/16/24
to OpenWISP

Hi all,

        I am understanding what you have explained. I wanted to get clear on my understanding. Do we need to write a separate script and to integrate with our project so that at the time of pushing template to the edge device, the script should execute and push the template along with the device specific values. I wrote a python script which interacts with the db, fetch details and fill in the configuration automatically, but I dont know how to integrate it in the project. I am stuck at this place, Is my approach on this template is correct or kindly guide on this.

Thanks,
Thrisha,

Federico Capoano

unread,
Jul 17, 2024, 1:01:16 PM7/17/24
to open...@googlegroups.com
Without more information, I can't really give much help.

If you could share your script (removing any sensitive data) in a Github gist, give us more context and explain what you mean exactly with "integrating it with the project", we may be able to give some more advice.

Best regards
Federico Capoano

Reply all
Reply to author
Forward
0 new messages