forked from lausser/check_nwc_health
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
140 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,22 @@ | ||
package Classes::AVOS; | ||
|
||
use strict; | ||
|
||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; | ||
|
||
our @ISA = qw(Classes::Bluecoat); | ||
use strict; | ||
|
||
sub init { | ||
my $self = shift; | ||
my %params = @_; | ||
$self->{components} = { | ||
powersupply_subsystem => undef, | ||
fan_subsystem => undef, | ||
temperature_subsystem => undef, | ||
cpu_subsystem => undef, | ||
security_subsystem => undef, | ||
}; | ||
$self->{serial} = 'unknown'; | ||
$self->{product} = 'unknown'; | ||
$self->{romversion} = 'unknown'; | ||
# serial is 1.3.6.1.2.1.47.1.1.1.1.11.1 | ||
#$self->collect(); | ||
if (! $self->check_messages()) { | ||
##$self->set_serial(); | ||
if ($self->mode =~ /device::hardware::health/) { | ||
$self->no_such_mode(); | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_cpu_subsystem(); | ||
$self->check_cpu_subsystem(); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_mem_subsystem(); | ||
$self->check_mem_subsystem(); | ||
} elsif ($self->mode =~ /device::licenses::/) { | ||
$self->analyze_key_subsystem(); | ||
$self->check_key_subsystem(); | ||
} elsif ($self->mode =~ /device::connections/) { | ||
$self->analyze_connection_subsystem(); | ||
$self->check_connection_subsystem(); | ||
} elsif ($self->mode =~ /device::security/) { | ||
$self->analyze_security_subsystem(); | ||
$self->check_security_subsystem(); | ||
} | ||
if ($self->mode =~ /device::hardware::health/) { | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_and_check_cpu_subsystem("Classes::AVOS::Component::CpuSubsystem"); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_and_check_mem_subsystem("Classes::AVOS::Component::MemSubsystem"); | ||
} elsif ($self->mode =~ /device::licenses::/) { | ||
$self->analyze_and_check_key_subsystem("Classes::AVOS::Component::KeySubsystem"); | ||
} elsif ($self->mode =~ /device::connections/) { | ||
$self->analyze_and_check_connection_subsystem("Classes::AVOS::Component::ConnectionSubsystem"); | ||
} elsif ($self->mode =~ /device::security/) { | ||
$self->analyze_and_check_security_subsystem("Classes::AVOS::Component::SecuritySubsystem"); | ||
} else { | ||
$self->no_such_mode(); | ||
} | ||
} | ||
|
||
sub analyze_environmental_subsystem { | ||
my $self = shift; | ||
$self->{components}->{environmental_subsystem} = | ||
Classes::AVOS::Component::EnvironmentalSubsystem->new(); | ||
} | ||
|
||
sub analyze_cpu_subsystem { | ||
my $self = shift; | ||
$self->{components}->{cpu_subsystem} = | ||
Classes::AVOS::Component::CpuSubsystem->new(); | ||
} | ||
|
||
sub analyze_mem_subsystem { | ||
my $self = shift; | ||
$self->{components}->{mem_subsystem} = | ||
Classes::AVOS::Component::MemSubsystem->new(); | ||
} | ||
|
||
sub analyze_key_subsystem { | ||
my $self = shift; | ||
$self->{components}->{key_subsystem} = | ||
Classes::AVOS::Component::KeySubsystem->new(); | ||
} | ||
|
||
sub analyze_security_subsystem { | ||
my $self = shift; | ||
$self->{components}->{security_subsystem} = | ||
Classes::AVOS::Component::SecuritySubsystem->new(); | ||
} | ||
|
||
sub analyze_connection_subsystem { | ||
my $self = shift; | ||
$self->{components}->{connection_subsystem} = | ||
Classes::AVOS::Component::ConnectionSubsystem->new(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,19 @@ | ||
package Classes::AlliedTelesyn; | ||
|
||
use strict; | ||
|
||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; | ||
|
||
our @ISA = qw(Classes::Device); | ||
use strict; | ||
|
||
sub init { | ||
my $self = shift; | ||
my %params = @_; | ||
$self->SUPER::init(%params); | ||
$self->{components} = { | ||
powersupply_subsystem => undef, | ||
fan_subsystem => undef, | ||
temperature_subsystem => undef, | ||
cpu_subsystem => undef, | ||
memory_subsystem => undef, | ||
disk_subsystem => undef, | ||
environmental_subsystem => undef, | ||
}; | ||
$self->{serial} = 'unknown'; | ||
$self->{product} = 'unknown'; | ||
$self->{romversion} = 'unknown'; | ||
# serial is 1.3.6.1.2.1.47.1.1.1.1.11.1 | ||
#$self->collect(); | ||
if (! $self->check_messages()) { | ||
##$self->set_serial(); | ||
if ($self->mode =~ /device::hardware::health/) { | ||
$self->analyze_environmental_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_environmental_subsystem(); | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_cpu_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_cpu_subsystem(); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_mem_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_mem_subsystem(); | ||
} elsif ($self->mode =~ /device::hsrp/) { | ||
$self->analyze_hsrp_subsystem(); | ||
$self->check_interface_subsystem(); | ||
} | ||
if ($self->mode =~ /device::hardware::health/) { | ||
$self->analyze_and_check_environmental_subsystem("Classes::AlliedTelesyn::Component::EnvironmentalSubsystem"); | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_and_check_cpu_subsystem("Classes::AlliedTelesyn::Component::CpuSubsystem"); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_and_check_mem_subsystem("Classes::AlliedTelesyn::Component::MemSubsystem"); | ||
} elsif ($self->mode =~ /device::hsrp/) { | ||
$self->analyze_and_check_hsrp_subsystem("Classes::HSRP::Component::HSRPSubsystem"); | ||
} else { | ||
$self->no_such_mode(); | ||
} | ||
} | ||
|
||
sub analyze_hsrp_subsystem { | ||
my $self = shift; | ||
$self->{components}->{hsrp} = | ||
Classes::HSRP::Component::HSRPSubsystem->new(); | ||
} | ||
|
||
sub analyze_environmental_subsystem { | ||
my $self = shift; | ||
$self->{components}->{environmental_subsystem} = | ||
Classes::AlliedTelesyn::Component::EnvironmentalSubsystem->new(); | ||
} | ||
|
||
sub analyze_cpu_subsystem { | ||
my $self = shift; | ||
$self->{components}->{cpu_subsystem} = | ||
Classes::AlliedTelesyn::Component::CpuSubsystem->new(); | ||
} | ||
|
||
sub analyze_mem_subsystem { | ||
my $self = shift; | ||
$self->{components}->{mem_subsystem} = | ||
Classes::AlliedTelesyn::Component::MemSubsystem->new(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
package Classes::BGP; | ||
|
||
use strict; | ||
|
||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; | ||
|
||
our @ISA = qw(Classes::Device); | ||
use strict; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,17 @@ | ||
package Classes::CiscoAsyncOS; | ||
|
||
use strict; | ||
|
||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; | ||
|
||
our @ISA = qw(Classes::Cisco); | ||
use strict; | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{components} = { | ||
powersupply_subsystem => undef, | ||
fan_subsystem => undef, | ||
temperature_subsystem => undef, | ||
cpu_subsystem => undef, | ||
memory_subsystem => undef, | ||
disk_subsystem => undef, | ||
environmental_subsystem => undef, | ||
connection_subsystem => undef, | ||
key_subsystem => undef, | ||
}; | ||
$self->{serial} = 'unknown'; | ||
$self->{product} = 'unknown'; | ||
$self->{romversion} = 'unknown'; | ||
# serial is 1.3.6.1.2.1.47.1.1.1.1.11.1 | ||
#$self->collect(); | ||
if (! $self->check_messages()) { | ||
##$self->set_serial(); | ||
if ($self->mode =~ /device::hardware::health/) { | ||
$self->analyze_environmental_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_environmental_subsystem(); | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_cpu_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_cpu_subsystem(); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_mem_subsystem(); | ||
#$self->auto_blacklist(); | ||
$self->check_mem_subsystem(); | ||
} elsif ($self->mode =~ /device::licenses::/) { | ||
$self->analyze_key_subsystem(); | ||
$self->check_key_subsystem(); | ||
} elsif ($self->mode =~ /device::shinken::interface/) { | ||
$self->analyze_interface_subsystem(); | ||
$self->shinken_interface_subsystem(); | ||
} | ||
if ($self->mode =~ /device::hardware::health/) { | ||
$self->analyze_and_check_environmental_subsystem("Classes::CiscoAsyncOS::Component::EnvironmentalSubsystem"); | ||
} elsif ($self->mode =~ /device::hardware::load/) { | ||
$self->analyze_and_check_cpu_subsystem("Classes::CiscoAsyncOS::Component::CpuSubsystem"); | ||
} elsif ($self->mode =~ /device::hardware::memory/) { | ||
$self->analyze_and_check_mem_subsystem("Classes::CiscoAsyncOS::Component::MemSubsystem"); | ||
} elsif ($self->mode =~ /device::licenses::/) { | ||
$self->analyze_and_check_key_subsystem("Classes::CiscoAsyncOS::Component::KeySubsystem"); | ||
} | ||
} | ||
|
||
sub analyze_environmental_subsystem { | ||
my $self = shift; | ||
$self->{components}->{environmental_subsystem} = | ||
Classes::CiscoAsyncOS::Component::EnvironmentalSubsystem->new(); | ||
} | ||
|
||
sub analyze_cpu_subsystem { | ||
my $self = shift; | ||
$self->{components}->{cpu_subsystem} = | ||
Classes::CiscoAsyncOS::Component::CpuSubsystem->new(); | ||
} | ||
|
||
sub analyze_mem_subsystem { | ||
my $self = shift; | ||
$self->{components}->{mem_subsystem} = | ||
Classes::CiscoAsyncOS::Component::MemSubsystem->new(); | ||
} | ||
|
||
sub analyze_key_subsystem { | ||
my $self = shift; | ||
$self->{components}->{key_subsystem} = | ||
Classes::CiscoAsyncOS::Component::KeySubsystem->new(); | ||
} | ||
|
Oops, something went wrong.