netfishers-onl / Netshot

Network Configuration and Compliance Management
http://www.netfishers.onl/netshot
237 stars 58 forks source link

Driver required for routeros (mikrotik) #246

Open opiym-7 opened 1 year ago

opiym-7 commented 1 year ago

Hi. Perhaps there is a ready-made driver for routeros (mikrotik). Can someone share it?

Punkster812 commented 1 year ago

I have one I've been kinda working on. It's not perfect and has some kinda weird things in it due to the way Mikrotiks seem to respond to SSH. It doesn't support everything yet but gets backups (/export), system name, OS version, model, and interfaces and works vast majority of the time. I need to work on getting IP addresses. 7.1 and early behaves differently but also mostly works (tested back to 6.42).

Punkster812 commented 1 year ago

I actually did some work on this to expand the features it supports and to fix some things. Here is the latest version. RouterOS.js.txt

opiym-7 commented 1 year ago

Thank you, it's working.

opiym-7 commented 5 months ago

@Punkster812 Hello! Maybe there is a new version of your driver? I'm having problems with some devices during snapshot.

Punkster812 commented 5 months ago

What version of RouterOS are you having issues on? Early 7.x versions as well as 6.x were very spotty with how accurate it was, even on same models. I had two CRS switches at the same location running same version. One would consistently read fine, the other would fail most the time but randomly work.

I haven't tried on the very newest versions of RouterOS, but we're running a lot of stuff up to 7.12.1 and it's working on those. I think the only changes I made since I posted the above was some minor fixes that could be caused by long names or comments, or certain conditions were stopping it from getting IP addresses. I'll see if I can get a minute to grab it and get it cleaned up.

opiym-7 commented 5 months ago

@Punkster812 Version 6.49.10. Several routers work fine on this version. But there is one router on the same version and it receives an incorrect snapshot. Writes to the entire configuration or does not read the name correctly. You described the same problem as mine. I would be grateful if you can send me an updated driver.