diff options
author | ytti <saku@ytti.fi> | 2016-01-29 14:51:21 +0200 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2016-01-29 14:51:21 +0200 |
commit | 324d22e243b127f2055245911276c147f95e9e6b (patch) | |
tree | 772ff7c4fcb955f0f50922f92b5c0fea3841e1c3 /lib/oxidized/model/tmos.rb | |
parent | 5e3e1442ee875528f567a7802a757b713a95d0c6 (diff) | |
parent | 69f02cfa3822cce0a6d39cc80522806769fe9524 (diff) |
Merge pull request #296 from ocadotechnology/f5-model
Add F5 BIG-IP model
Diffstat (limited to 'lib/oxidized/model/tmos.rb')
-rw-r--r-- | lib/oxidized/model/tmos.rb | 48 |
1 files changed, 48 insertions, 0 deletions
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 <secret removed>') + cfg.gsub!(/passphrase (\S+)/, 'passphrase <secret removed>') + cfg.gsub!(/community (\S+)/, 'community <secret removed>') + cfg.gsub!(/community-name (\S+)/, 'community-name <secret removed>') + 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 |