I am not sure the question is relevant or not. let me tell you the scenario.
I have nearly 10 openwrt devices running. Having dashboard to show the status to the clients. Now my concern is that every time when user clicks the button from front end, the request comes to backend and from there I am getting the required data using http ubus call and giving back to the client. It works very comfortably.
But when devices increases or when it is needed to make so many calls for the single status, It is taking time to pull all the details from all the devices. So I want to reduce the time taken for the dashboard.
What is the best way to achieve this?
sending requests to devices in regular intervals seems good. but that also will heavily affects the server performance.
I am thinking that why cant I write some scripts in device so that it will send data in regular interval to the server ? Is this the correct way to do this? or any other packages or scripts available/
Hope I am clear !! Thanks, Happy Day !!
Not very clear.
What data exactly you want to send?
Can you give example?
sorry for the late reply. i want to send the data something like interface up/down status, mwan3 status.. I can achieve this through simple http call. But when multiple http calls required for the single status, this work takes long time.
So I want to send the data for every x interval from the device to server. or is there any other ways to achieve this? Thanks. Hope I am clear.
Thanks @cezary, yes, this will be useful. I think this package not readily available in opkg. we need to compile ?
Yes and probably write your own modules.
i would think of sending status only when a change occurs. No point sending same status periodically.
Yes you are correct. But how can I know that status changes? Any way to achieve this?
pseudocode via cron
if json.old != json.new then scp json.new centralip:/host.json
cp json.new json.old
status changes are sent to logger by default.
remote syslog "logger" output to a server and look for particular string for each event.