Skip to content

Commit

Permalink
add barracuda files (not finished yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
lausser committed Jun 5, 2019
1 parent 10d3868 commit 8f12d3c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins-scripts/Classes/Barracuda.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ sub init {
$self->analyze_and_check_cpu_subsystem("Classes::UCDMIB::Component::CpuSubsystem");
} elsif ($self->mode =~ /device::hardware::memory/) {
$self->analyze_and_check_mem_subsystem("Classes::UCDMIB::Component::MemSubsystem");
} elsif ($self->mode =~ /device::fw::policy::connections/) {
$self->analyze_and_check_fw_subsystem("Classes::Barracuda::Component::FwSubsystem");
} elsif ($self->mode =~ /device::ha::/) {
$self->analyze_and_check_fw_subsystem("Classes::Barracuda::Component::HaSubsystem");
} else {
# Merkwuerdigerweise gibts ohne das hier einen Timeout bei
# IP-FORWARD-MIB::inetCidrRouteTable und den route-Modi
$self->mult_snmp_max_msg_size(5);
$self->no_such_mode();
}
}

30 changes: 30 additions & 0 deletions plugins-scripts/Classes/Barracuda/Component/FwSubsystem.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package Classes::Barracuda::Component::FwSubsystem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;

sub init {
my ($self) = @_;
if ($self->mode =~ /device::fw::policy::connections/) {
$self->get_snmp_tables('PHION-MIB', [
['fwstats', 'fwStatsTable', 'Classes::Barracuda::Component::FwSubsystem::FWStat'],
]);
$self->get_snmp_objects('PHION-MIB', qw(vpnUsers));
}
}


package Classes::Barracuda::Component::FwSubsystem::FWStat;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;

sub check {
my ($self) = @_;
$self->set_thresholds(warning => 300000, critical => 400000);
$self->add_message($self->check_thresholds($self->{firewallSessions64}),
sprintf 'fw has %s open sessions', $self->{firewallSessions64});
$self->add_perfdata(
label => 'fw_sessions',
value => $self->{firewallSessions64},
);
}

22 changes: 22 additions & 0 deletions plugins-scripts/Classes/Barracuda/Component/HaSubsystem.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package Classes::Barracuda::Component::HaSubsystem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };

sub init {
my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
$self->get_snmp_tables('PHION-MIB', [
['services', 'serverServicesTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
]);
if (! $self->opts->role()) {
$self->opts->override_opt('role', 'active');
}
}
}

sub check {
my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
}
}

0 comments on commit 8f12d3c

Please sign in to comment.