summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/mikrotik.rb
diff options
context:
space:
mode:
authorEric <eric@emj.se>2015-03-16 19:26:24 +0100
committerEric <eric@emj.se>2015-03-16 19:26:24 +0100
commitcbe717301d6d734f6c2acb07361eef8c9ae1c486 (patch)
tree3d5e4bd5594c9ef27753f391d45d548b3c3f8f4f /lib/oxidized/model/mikrotik.rb
parentbf89123121deab937fa24c3530fd349a5cc9049b (diff)
Added support for Mikrotik RouterOS
Diffstat (limited to 'lib/oxidized/model/mikrotik.rb')
-rw-r--r--lib/oxidized/model/mikrotik.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/oxidized/model/mikrotik.rb b/lib/oxidized/model/mikrotik.rb
new file mode 100644
index 0000000..69eeabc
--- /dev/null
+++ b/lib/oxidized/model/mikrotik.rb
@@ -0,0 +1,21 @@
+class Mikrotik < Oxidized::Model
+ prompt /^\[\w+@\S+\]\s?>\s?$/
+ comment "# "
+
+ cmd '/system routerboard print' do |cfg|
+ comment cfg
+ end
+
+ cmd '/export' do |cfg|
+ cfg = cfg.split("\n").select { |line| not line[/^\#\s\w{3}\/\d{2}\/\d{4}.*$/] }
+ cfg.join("\n") + "\n"
+ end
+
+ cfg :telnet do
+ pre_logout "quit"
+ end
+
+ cfg :ssh do
+ exec true
+ end
+end