From 261e6d41f1daa6f37c2a0c5e3b059cbfd77dc895 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Feb 2017 14:28:59 +0100 Subject: added variable fortios_autoupdate, to control inclusion of autoupdate messages --- lib/oxidized/model/fortios.rb | 13 +++++++++---- 1 file 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 + -- cgit v1.2.1