From 69f02cfa3822cce0a6d39cc80522806769fe9524 Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Fri, 29 Jan 2016 11:20:09 +0000 Subject: Add F5 TMOS model --- README.md | 2 ++ lib/oxidized/model/tmos.rb | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 lib/oxidized/model/tmos.rb diff --git a/README.md b/README.md index e6454ce..9e55ea6 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * AOSW * Extreme Networks * XOS + * F5 + * TMOS * Force10 * FTOS * Force10 diff --git a/lib/oxidized/model/tmos.rb b/lib/oxidized/model/tmos.rb new file mode 100644 index 0000000..4841b98 --- /dev/null +++ b/lib/oxidized/model/tmos.rb @@ -0,0 +1,48 @@ +class TMOS < Oxidized::Model + + comment '# ' + + cmd :secret do |cfg| + cfg.gsub!(/password (\S+)/, 'password ') + cfg.gsub!(/passphrase (\S+)/, 'passphrase ') + cfg.gsub!(/community (\S+)/, 'community ') + cfg.gsub!(/community-name (\S+)/, 'community-name ') + cfg + end + + cmd('tmsh show sys version') { |cfg| comment cfg } + + cmd('tmsh show sys software') { |cfg| comment cfg } + + cmd 'tmsh show sys hardware field-fmt' do |cfg| + cfg.gsub!(/fan-speed (\S+)/, '') + cfg.gsub!(/temperature (\S+)/, '') + comment cfg + end + + cmd('cat /config/bigip.license') { |cfg| comment cfg } + + cmd 'tmsh list' do |cfg| + cfg.gsub!(/state (up|down)/, '') + cfg.gsub!(/errors (\d+)/, '') + cfg + end + + cmd('tmsh list net route all') { |cfg| comment cfg } + + cmd('/bin/ls --full-time --color=never /config/ssl/ssl.crt') { |cfg| comment cfg } + + cmd('/bin/ls --full-time --color=never /config/ssl/ssl.key') { |cfg| comment cfg } + + cmd 'tmsh show running-config sys db all-properties' do |cfg| + cfg.gsub!(/sys db configsync.localconfigtime {[^}]+}/m, '') + cfg.gsub!(/sys db gtm.configtime {[^}]+}/m, '') + cfg.gsub!(/sys db ltm.configtime {[^}]+}/m, '') + comment cfg + end + + cfg :ssh do + exec true # don't run shell, run each command in exec channel + end + +end -- cgit v1.2.1