diff options
author | Anton Aksola <anton.aksola@nebula.fi> | 2014-04-07 14:26:04 +0300 |
---|---|---|
committer | Anton Aksola <anton.aksola@nebula.fi> | 2014-04-07 14:26:04 +0300 |
commit | 381b09dcd67af66e2f257cdc80dea84ce9582252 (patch) | |
tree | f5ca66ce406bef072a1eb1cef874d3814d849b37 | |
parent | fe8a7e7edb63d0924476dd0536af09277bf63866 (diff) |
add model for Fortinet FortiOS used in Fortigate firewalls. Should work
at least from version 5 onwards
-rw-r--r-- | lib/oxidized/model/fortios.rb | 39 |
1 files changed, 39 insertions, 0 deletions
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 |