diff options
| author | root <oh@onsteroids.net> | 2017-02-16 14:28:59 +0100 | 
|---|---|---|
| committer | root <oh@onsteroids.net> | 2017-02-16 14:28:59 +0100 | 
| commit | 261e6d41f1daa6f37c2a0c5e3b059cbfd77dc895 (patch) | |
| tree | 63aee7154725f5281385b0066ded3a7176caac86 | |
| parent | c89503a8b2c53d9ee2a1fc8020ecc5fba600a891 (diff) | |
added variable fortios_autoupdate, to control inclusion of autoupdate messages
| -rw-r--r-- | lib/oxidized/model/fortios.rb | 13 | 
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb index 3cfd102..2415537 100644 --- a/lib/oxidized/model/fortios.rb +++ b/lib/oxidized/model/fortios.rb @@ -31,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" @@ -54,3 +58,4 @@ class FortiOS < Oxidized::Model    end  end +  | 
