From 381b09dcd67af66e2f257cdc80dea84ce9582252 Mon Sep 17 00:00:00 2001 From: Anton Aksola Date: Mon, 7 Apr 2014 14:26:04 +0300 Subject: add model for Fortinet FortiOS used in Fortigate firewalls. Should work at least from version 5 onwards --- lib/oxidized/model/fortios.rb | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/oxidized/model/fortios.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb new file mode 100644 index 0000000..5e865be --- /dev/null +++ b/lib/oxidized/model/fortios.rb @@ -0,0 +1,39 @@ +class FortiOS < Oxidized::Model + + comment '# ' + + prompt /^([-\w\.]+(\s[\(\w\-\.\)]+)?\s?[#>]\s?)$/ + + cmd :all do |cfg, cmdstring| + new_cfg = comment "COMMAND: #{cmdstring}\n" + new_cfg << cfg.each_line.to_a[1..-2].join + end + + cmd 'get system status' do |cfg| + comment cfg + end + + cmd 'config global' + + cmd 'get hardware status' do |cfg| + comment cfg + end + + cmd 'diagnose autoupdate version' do |cfg| + comment cfg + end + + cmd 'end' + + cmd 'show' + + cfg :telnet do + username /^Username:/ + password /^Password:/ + end + + cfg :telnet, :ssh do + pre_logout "exit\n" + end + +end -- cgit v1.2.1