summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/fortios.rb
diff options
context:
space:
mode:
authorNat Morris <nat@nuqe.net>2017-02-16 16:21:01 +0000
committerGitHub <noreply@github.com>2017-02-16 16:21:01 +0000
commite2d583728543e0b46c21a8fad56674bbda544006 (patch)
tree12f9fe9ba263121d9bf6fdc819444d8c19321a5a /lib/oxidized/model/fortios.rb
parent9a5bbb784ae36b824072051e570d5f752c531d68 (diff)
parentdeae31cb04c184266e1b9c843325604a90113665 (diff)
Merge pull request #10 from ytti/master
Bring Netflix master in sync with upstream
Diffstat (limited to 'lib/oxidized/model/fortios.rb')
-rw-r--r--lib/oxidized/model/fortios.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index cdb50d5..2415537 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -15,7 +15,8 @@ class FortiOS < Oxidized::Model
end
cmd :secret do |cfg|
- cfg.gsub! /(set (?:passwd|password)).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set (?:passwd|password|psksecret)).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m , '\\1 <configuration removed>'
cfg
end
@@ -30,14 +31,18 @@ class FortiOS < Oxidized::Model
cfg << cmd('config global') if @vdom_enabled
cfg << cmd('get hardware status') do |cfg|
- comment cfg
+ comment cfg
end
- cfg << cmd('diagnose autoupdate version') do |cfg|
- comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
+ #default behaviour: include autoupdate output (backwards compatibility)
+ #do not include if variable "show_autoupdate" is set to false
+ if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
+ cfg << cmd('diagnose autoupdate version') do |cfg|
+ comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
+ end
end
- cfg << cmd('end') if @vdom_enabled
+cfg << cmd('end') if @vdom_enabled
cfg << cmd('show')
cfg.join "\n"
@@ -53,3 +58,4 @@ class FortiOS < Oxidized::Model
end
end
+