remove useless code
This commit is contained in:
parent
023d7b7e05
commit
60feb006af
|
@ -95,8 +95,7 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -116,18 +115,25 @@ sub manage_selection {
|
||||||
my $oid_pop3Hits = '.1.3.6.1.4.1.21067.2.1.2.9.1.0';
|
my $oid_pop3Hits = '.1.3.6.1.4.1.21067.2.1.2.9.1.0';
|
||||||
my $oid_imapHits = '.1.3.6.1.4.1.21067.2.1.2.9.2.0';
|
my $oid_imapHits = '.1.3.6.1.4.1.21067.2.1.2.9.2.0';
|
||||||
my $oid_smtpHits = '.1.3.6.1.4.1.21067.2.1.2.9.3.0';
|
my $oid_smtpHits = '.1.3.6.1.4.1.21067.2.1.2.9.3.0';
|
||||||
my $result = $options{snmp}->get_leef(oids => [$oid_liveUsers, $oid_httpHits, $oid_ftpHits, $oid_pop3Hits,
|
my $result = $options{snmp}->get_leef(
|
||||||
$oid_imapHits, $oid_smtpHits], nothing_quit => 1);
|
oids => [
|
||||||
|
$oid_liveUsers, $oid_httpHits, $oid_ftpHits, $oid_pop3Hits,
|
||||||
|
$oid_imapHits, $oid_smtpHits
|
||||||
|
],
|
||||||
|
nothing_quit => 1
|
||||||
|
);
|
||||||
|
|
||||||
$self->{cache_name} = "cyberoam_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
$self->{cache_name} = "cyberoam_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||||
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
|
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
|
||||||
|
|
||||||
$self->{global} = { live_users => $result->{$oid_liveUsers},
|
$self->{global} = {
|
||||||
|
live_users => $result->{$oid_liveUsers},
|
||||||
http_hits => $result->{$oid_httpHits},
|
http_hits => $result->{$oid_httpHits},
|
||||||
ftp_hits => $result->{$oid_ftpHits},
|
ftp_hits => $result->{$oid_ftpHits},
|
||||||
pop3_hits => $result->{$oid_pop3Hits},
|
pop3_hits => $result->{$oid_pop3Hits},
|
||||||
imap_hits => $result->{$oid_imapHits},
|
imap_hits => $result->{$oid_imapHits},
|
||||||
smtp_hits => $result->{$oid_smtpHits} };
|
smtp_hits => $result->{$oid_smtpHits}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -33,6 +33,7 @@ sub set_counters {
|
||||||
{ name => 'global', type => 0 },
|
{ name => 'global', type => 0 },
|
||||||
{ name => 'sea_msg', type => 1, cb_prefix_output => 'prefix_seamsg_output', message_multiple => 'All messages are ok' },
|
{ name => 'sea_msg', type => 1, cb_prefix_output => 'prefix_seamsg_output', message_multiple => 'All messages are ok' },
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'queue', set => {
|
{ label => 'queue', set => {
|
||||||
key_values => [ { name => 'queue' } ],
|
key_values => [ { name => 'queue' } ],
|
||||||
|
@ -95,9 +96,8 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'filter-type:s' => { name => 'filter_type' },
|
||||||
"filter-type:s" => { name => 'filter_type' },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -115,12 +115,6 @@ my $oid_seaStatisticsQueuedMessages = '.1.3.6.1.4.1.2604.1.1.1.5';
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $oid_liveUsers = '.1.3.6.1.4.1.21067.2.1.2.6.0';
|
|
||||||
my $oid_httpHits = '.1.3.6.1.4.1.21067.2.1.2.7.0';
|
|
||||||
my $oid_ftpHits = '.1.3.6.1.4.1.21067.2.1.2.8.0';
|
|
||||||
my $oid_pop3Hits = '.1.3.6.1.4.1.21067.2.1.2.9.1.0';
|
|
||||||
my $oid_imapHits = '.1.3.6.1.4.1.21067.2.1.2.9.2.0';
|
|
||||||
my $oid_smtpHits = '.1.3.6.1.4.1.21067.2.1.2.9.3.0';
|
|
||||||
my $results = $options{snmp}->get_table(oid => $oid_sophosStatisticsEmail, nothing_quit => 1);
|
my $results = $options{snmp}->get_table(oid => $oid_sophosStatisticsEmail, nothing_quit => 1);
|
||||||
|
|
||||||
$self->{cache_name} = "sophos_es_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
$self->{cache_name} = "sophos_es_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||||
|
@ -142,8 +136,10 @@ sub manage_selection {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{sea_msg}->{lc($result->{counterType})} = { display => lc($result->{counterType}),
|
$self->{sea_msg}->{lc($result->{counterType})} = {
|
||||||
in => $result->{counterInbound}, out => $result->{counterOutbound}
|
display => lc($result->{counterType}),
|
||||||
|
in => $result->{counterInbound},
|
||||||
|
out => $result->{counterOutbound}
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{global}->{total_in} += $result->{counterInbound};
|
$self->{global}->{total_in} += $result->{counterInbound};
|
||||||
|
@ -170,14 +166,9 @@ Filter message type (can be a regexp).
|
||||||
Only display some counters (regexp can be used).
|
Only display some counters (regexp can be used).
|
||||||
Example: --filter-counters='queue'
|
Example: --filter-counters='queue'
|
||||||
|
|
||||||
=item B<--warning-*>
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
Threshold warning.
|
|
||||||
|
|
||||||
=item B<--critical-*>
|
|
||||||
|
|
||||||
Threshold critical.
|
|
||||||
|
|
||||||
|
Thresholds.
|
||||||
Can be: queue, total-msg-in, total-msg-out, msg-in, msg-out.
|
Can be: queue, total-msg-in, total-msg-out, msg-in, msg-out.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
Loading…
Reference in New Issue