summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/airos.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2014-08-15 20:19:02 +0300
committerytti <saku@ytti.fi>2014-08-15 20:19:02 +0300
commit8244ac7a5d6f5e2f7e6de361402f602bfa308978 (patch)
treee016e0a740e51e0026b6a81b0bce83caa37685c4 /lib/oxidized/model/airos.rb
parent956baa32db88f83a9c9d4a8192ebec16474ede0e (diff)
parentb1e49f82d5256c62121f1387aa7f22be0e9bc26a (diff)
Merge pull request #41 from willglynn/ubiquiti_airos
Add Ubiquiti AirOS model
Diffstat (limited to 'lib/oxidized/model/airos.rb')
-rw-r--r--lib/oxidized/model/airos.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/oxidized/model/airos.rb b/lib/oxidized/model/airos.rb
new file mode 100644
index 0000000..316c4f0
--- /dev/null
+++ b/lib/oxidized/model/airos.rb
@@ -0,0 +1,20 @@
+class Airos < Oxidized::Model
+ # Ubiquiti AirOS circa 5.x
+
+ prompt /^[^#]+# /
+
+ cmd 'cat /etc/board.info' do |cfg|
+ cfg.split("\n").map { |line| "# #{line}" }.join("\n") + "\n"
+ end
+
+ cmd 'cat /tmp/system.cfg'
+
+ cmd :secret do |cfg|
+ cfg.gsub! /^(users\.\d+\.password|snmp\.community)=.+/, "# \\1=<hidden>"
+ cfg
+ end
+
+ cfg :ssh do
+ exec true
+ end
+end