1 # Copyright (C) 2003 Shawn Ferry
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17 # $Id: CiscoFirewall.pm,v 1.1 2010-12-27 00:03:56 ivan Exp $
18 # Shawn Ferry <lalartu at obscure dot org> <sferry at sevenspace dot com>
20 # Cisco Firewall devices discovery
22 package Torrus::DevDiscover::CiscoFirewall;
28 $Torrus::DevDiscover::registry{'CiscoFirewall'} = {
30 'checkdevtype' => \&checkdevtype,
31 'discover' => \&discover,
32 'buildConfig' => \&buildConfig
39 'ciscoFirewallMIB' => '1.3.6.1.4.1.9.9.147',
40 'cfwBasicEventsTableLastRow' => '1.3.6.1.4.1.9.9.147.1.1.4',
41 'cfwConnectionStatTable' => '1.3.6.1.4.1.9.9.147.1.2.2.2.1',
42 'cfwConnectionStatMax' => '1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.7',
50 my $devdetails = shift;
52 my $session = $dd->session();
53 my $data = $devdetails->data();
55 if( $devdetails->isDevType('CiscoGeneric') and
56 $dd->checkSnmpTable('ciscoFirewallMIB') )
58 $devdetails->setCap('interfaceIndexingManaged');
69 my $devdetails = shift;
71 my $data = $devdetails->data();
72 my $session = $dd->session();
74 $data->{'nameref'}{'ifReferenceName'} = 'ifName';
75 $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT';
76 $data->{'param'}{'ifindex-table'} = '$ifName';
78 if( not defined( $data->{'param'}{'snmp-oids-per-pdu'} ) )
81 $devdetails->param('CiscoFirewall::snmp-oids-per-pdu');
82 if( $oidsPerPDU == 0 )
86 $data->{'param'}{'snmp-oids-per-pdu'} = $oidsPerPDU;
89 if( $dd->checkSnmpOID('cfwConnectionStatMax') )
91 $devdetails->setCap('CiscoFirewall::connections');
94 # I have not seen a system that supports this.
95 if( $dd->checkSnmpOID('cfwBasicEventsTableLastRow') )
97 $devdetails->setCap('CiscoFirewall::events');
106 my $devdetails = shift;
109 my $data = $devdetails->data();
111 my $fwStatsTree = "Firewall_Stats";
113 'precedence' => '-1000',
114 'comment' => 'Firewall Stats',
117 my @templates = ('CiscoFirewall::cisco-firewall-subtree');
119 if( $devdetails->hasCap('CiscoFirewall::connections') )
121 push( @templates, 'CiscoFirewall::connections');
124 if( $devdetails->hasCap('CiscoFirewall::events') )
126 push( @templates, 'CiscoFirewall::events');
129 $cb->addSubtree( $devNode, $fwStatsTree, $fwStatsParam, \@templates );
140 # indent-tabs-mode: nil
141 # perl-indent-level: 4