summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/jobs.rb4
-rw-r--r--lib/oxidized/model/acos.rb15
-rw-r--r--lib/oxidized/model/panos.rb9
-rw-r--r--lib/oxidized/worker.rb4
4 files changed, 28 insertions, 4 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb
index 2c656f6..c566778 100644
--- a/lib/oxidized/jobs.rb
+++ b/lib/oxidized/jobs.rb
@@ -6,7 +6,9 @@ module Oxidized
def initialize max, interval, nodes
@max = max
- @interval = interval
+ # Set interval to 1 if interval is 0 (=disabled) so we don't break
+ # the 'ceil' function
+ @interval = interval == 0 ? 1 : interval
@nodes = nodes
@last = Time.now.utc
@durations = Array.new @nodes.size, AVERAGE_DURATION
diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb
index 7db8b00..bb9846e 100644
--- a/lib/oxidized/model/acos.rb
+++ b/lib/oxidized/model/acos.rb
@@ -7,6 +7,14 @@ class ACOS < Oxidized::Model
prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/
cmd 'show version' do |cfg|
+ cfg.gsub! /\s(Last configuration saved at).*/, ' \\1 <removed>'
+ cfg.gsub! /\s(Memory).*/, ' \\1 <removed>'
+ cfg.gsub! /\s(Current time is).*/, ' \\1 <removed>'
+ cfg.gsub! /\s(The system has been up).*/, ' \\1 <removed>'
+ comment cfg
+ end
+
+ cmd 'show bootimage' do |cfg|
comment cfg
end
@@ -14,7 +22,12 @@ class ACOS < Oxidized::Model
comment cfg
end
- cmd 'show running-config all-partitions'
+ cmd 'show running-config all-partitions' do |cfg|
+ cfg.gsub! /(Current configuration).*/, '\\1 <removed>'
+ cfg.gsub! /(Configuration last updated at).*/, '\\1 <removed>'
+ cfg.gsub! /(Configuration last saved at).*/, '\\1 <removed>'
+ cfg.gsub! /(Configuration last synchronized at).*/, '\\1 <removed>'
+ end
cmd 'show aflex all-partitions' do |cfg|
comment cfg
diff --git a/lib/oxidized/model/panos.rb b/lib/oxidized/model/panos.rb
index 35624b7..68d80c3 100644
--- a/lib/oxidized/model/panos.rb
+++ b/lib/oxidized/model/panos.rb
@@ -11,7 +11,14 @@ class PanOS < Oxidized::Model
end
cmd 'show system info' do |cfg|
- cfg.gsub! /^(up)?time:\ .*\n/, ''
+ cfg.gsub! /^(up)?time:\ .*$/, ''
+ cfg.gsub! /^app-.*?:\ .*$/, ''
+ cfg.gsub! /^av-.*?:\ .*$/, ''
+ cfg.gsub! /^threat-.*?:\ .*$/, ''
+ cfg.gsub! /^wildfire-.*?:\ .*$/, ''
+ cfg.gsub! /^wf-private.*?:\ .*$/, ''
+ cfg.gsub! /^url-filtering.*?:\ .*$/, ''
+ cfg.gsub! /^global-.*?:\ .*$/, ''
comment cfg
end
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb
index 324dcb5..48852ef 100644
--- a/lib/oxidized/worker.rb
+++ b/lib/oxidized/worker.rb
@@ -18,7 +18,9 @@ module Oxidized
# ask for next node in queue non destructive way
nextnode = @nodes.first
unless nextnode.last.nil?
- break if nextnode.last.end + Oxidized.config.interval > Time.now.utc
+ # Set unobtainable value for 'last' if interval checking is disabled
+ last = Oxidized.config.interval == 0 ? Time.now.utc + 10 : nextnode.last.end
+ break if last + Oxidized.config.interval > Time.now.utc
end
# shift nodes and get the next node
node = @nodes.get