Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15133

SwOS • Re: SwOS api

$
0
0
OK I have put this up on Docker Hub and I'm using it with Homepage to give me details of my two switches. https://hub.docker.com/repository/docke ... sw/general

Just do a GET on /api/v1/getswitch/switchip/switchuser/password

I know that is dreadful, putting the username and password in the URL but the homepage custom api widget doesn't allow you to control the body of a post so that was the easiest way to do it without having to have a config for each switch.

Happy to modify or add features if people actually want to use it...
I was inspired. I have built a small docker application to act as a reverse proxy for any number of Mikrotik switches. I then make the call to the switch to pick up their config files "link.b" "sys.b" etc. and return json. I was frustrated that my Homepage dashboard only gave me widgets for RouterOS and not Switch OS.

I'm just testing this at home now and it only picks up Link status, Speed and name for each port but seems to work reliably at least for the two switches I have. I'll post on here in a wekk or so when I have completed it and where you can pull it from on docker hub. Now would be a good time to request anything specific you need.

Warning, because of my own needs this is brain dead when it comes to security and the router, username and password for the switch are in the url... I'll look at adding a post option which will hide thouse things.

Statistics: Posted by gaileys — Mon Mar 25, 2024 1:27 pm



Viewing all articles
Browse latest Browse all 15133

Trending Articles