remove tab
This commit is contained in:
parent
757ac8a861
commit
b46892d181
|
@ -61,14 +61,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /.*ActiveUsers_1m=.*/i) {
|
if ($webcontent !~ /.*ActiveUsers_1m=.*/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find eas actvie users info."
|
short_msg => "Cannot find eas actvie users info."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my @activeusers = split(" ",$webcontent);
|
my @activeusers = split(" ",$webcontent);
|
||||||
|
|
||||||
my $info;
|
my $info;
|
||||||
|
|
|
@ -61,14 +61,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /(LoadedClassCount|UnloadedClassCount)/i) {
|
if ($webcontent !~ /(LoadedClassCount|UnloadedClassCount)/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find classloading status."
|
short_msg => "Cannot find classloading status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($loadedclasscount, $unloadedclasscount) = (0, 0);
|
my ($loadedclasscount, $unloadedclasscount) = (0, 0);
|
||||||
|
|
||||||
if ($webcontent =~ /LoadedClassCount=\s*(\d+)/mi) {
|
if ($webcontent =~ /LoadedClassCount=\s*(\d+)/mi) {
|
||||||
|
|
|
@ -68,32 +68,32 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /^Name=/i) {
|
if ($webcontent !~ /^Name=/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find datasource \'" . $self->{option_results}->{datasource} . "\' status."
|
short_msg => "Cannot find datasource \'" . $self->{option_results}->{datasource} . "\' status."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $init_pool_size = -1;
|
my $init_pool_size = -1;
|
||||||
my $max_pool_size = -1;
|
my $max_pool_size = -1;
|
||||||
my $idle_timeout = -1;
|
my $idle_timeout = -1;
|
||||||
my $cur_conn_count = -1;
|
my $cur_conn_count = -1;
|
||||||
my $cur_avail_conn_count = -1;
|
my $cur_avail_conn_count = -1;
|
||||||
my $max_conn_count = -1;
|
my $max_conn_count = -1;
|
||||||
my $create_count = -1;
|
my $create_count = -1;
|
||||||
my $close_count = -1;
|
my $close_count = -1;
|
||||||
|
|
||||||
$init_pool_size = $1 if $webcontent =~ /InitialPoolSize=(\d+)\s/i;
|
$init_pool_size = $1 if $webcontent =~ /InitialPoolSize=(\d+)\s/i;
|
||||||
$max_pool_size = $1 if $webcontent =~ /MaxPoolSize=(\d+)\s/i;
|
$max_pool_size = $1 if $webcontent =~ /MaxPoolSize=(\d+)\s/i;
|
||||||
$idle_timeout = $1 if $webcontent =~ /IdleTimeout=(\d+)\s/i;
|
$idle_timeout = $1 if $webcontent =~ /IdleTimeout=(\d+)\s/i;
|
||||||
$cur_conn_count = $1 if $webcontent =~ /CurrentConnectionCount=(\d+)\s/i;
|
$cur_conn_count = $1 if $webcontent =~ /CurrentConnectionCount=(\d+)\s/i;
|
||||||
$cur_avail_conn_count = $1 if $webcontent =~ /CurrentAvailableConnectionCount=(\d+)\s/i;
|
$cur_avail_conn_count = $1 if $webcontent =~ /CurrentAvailableConnectionCount=(\d+)\s/i;
|
||||||
$max_conn_count = $1 if $webcontent =~ /MaxConnectionCount=(\d+)\s/i;
|
$max_conn_count = $1 if $webcontent =~ /MaxConnectionCount=(\d+)\s/i;
|
||||||
$create_count = $1 if $webcontent =~ /CreateCount=(\d+)\s/i;
|
$create_count = $1 if $webcontent =~ /CreateCount=(\d+)\s/i;
|
||||||
$close_count = $1 if $webcontent =~ /CloseCount=(\d+)\s/i;
|
$close_count = $1 if $webcontent =~ /CloseCount=(\d+)\s/i;
|
||||||
|
|
||||||
my $active_conn_count = $cur_conn_count - $cur_avail_conn_count;
|
my $active_conn_count = $cur_conn_count - $cur_avail_conn_count;
|
||||||
|
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("InitialPoolSize: %d", $init_pool_size));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("InitialPoolSize: %d", $init_pool_size));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxPoolSize: %d", $max_pool_size));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxPoolSize: %d", $max_pool_size));
|
||||||
|
|
|
@ -60,12 +60,12 @@ sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
if ($webcontent !~ /.*BOS=.*/i) {
|
if ($webcontent !~ /.*BOS=.*/i) {
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
$self->{output}->output_add(severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find eas license usage info.");
|
short_msg => "Cannot find eas license usage info.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my @licenseinfo = split(" ",$webcontent);
|
my @licenseinfo = split(" ",$webcontent);
|
||||||
|
|
||||||
my $info;
|
my $info;
|
||||||
|
|
|
@ -27,25 +27,25 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(
|
$options{options}->add_options(
|
||||||
arguments => {
|
arguments => {
|
||||||
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkhttphandler.jsp" },
|
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkhttphandler.jsp" },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||||
|
@ -59,37 +59,37 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /MaxThreads=\d+/i) {
|
if ($webcontent !~ /MaxThreads=\d+/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'"
|
short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'"
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($maxthreads, $minsparethreads, $maxsparethreads, $maxqueuesize, $idletimeout, $processedcount) = (0, 0, 0, 0, 0, 0);
|
my ($maxthreads, $minsparethreads, $maxsparethreads, $maxqueuesize, $idletimeout, $processedcount) = (0, 0, 0, 0, 0, 0);
|
||||||
my ($currentthreadcount, $availablethreadcount, $busythreadcount, $maxavailablethreadcount, $maxbusythreadcount) = (0, 0, 0, 0, 0);
|
my ($currentthreadcount, $availablethreadcount, $busythreadcount, $maxavailablethreadcount, $maxbusythreadcount) = (0, 0, 0, 0, 0);
|
||||||
my ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0);
|
my ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0);
|
||||||
|
|
||||||
$maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ;
|
$maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ;
|
||||||
$minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ;
|
$minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ;
|
||||||
$maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ;
|
$maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ;
|
||||||
$maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ;
|
$maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ;
|
||||||
$idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ;
|
$idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ;
|
||||||
$processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ;
|
$processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ;
|
||||||
$currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ;
|
$currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ;
|
||||||
$availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ;
|
$availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ;
|
||||||
$busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ;
|
$busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ;
|
||||||
$maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ;
|
$maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ;
|
||||||
$maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ;
|
$maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ;
|
||||||
$maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ;
|
$maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ;
|
||||||
$createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ;
|
$createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ;
|
||||||
$destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ;
|
$destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ;
|
||||||
|
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxThreads: %d", $maxthreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxThreads: %d", $maxthreads));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MinSpareThreads: %d", $minsparethreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MinSpareThreads: %d", $minsparethreads));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads));
|
||||||
|
|
|
@ -61,14 +61,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /CollectionCount=\d+/mi) {
|
if ($webcontent !~ /CollectionCount=\d+/mi) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find ibm jdk j9 gc status."
|
short_msg => "Cannot find ibm jdk j9 gc status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($collectioncount, $collectiontime) = (0, 0);
|
my ($collectioncount, $collectiontime) = (0, 0);
|
||||||
|
|
||||||
($collectioncount, $collectiontime) = ($1, $2) if ($webcontent =~ /CollectionCount=(\d+)\sCollectionTime=(\d+)/mi);
|
($collectioncount, $collectiontime) = ($1, $2) if ($webcontent =~ /CollectionCount=(\d+)\sCollectionTime=(\d+)/mi);
|
||||||
|
|
|
@ -63,20 +63,20 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /VmName=/mi) {
|
if ($webcontent !~ /VmName=/mi) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find java runtime status."
|
short_msg => "Cannot find java runtime status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my $vmname = $1 if $webcontent =~ /VmName=\'(.*?)\'/i;
|
my $vmname = $1 if $webcontent =~ /VmName=\'(.*?)\'/i;
|
||||||
my $specversion = $1 if $webcontent =~ /SpecVersion=([\d\.]+)/i;
|
my $specversion = $1 if $webcontent =~ /SpecVersion=([\d\.]+)/i;
|
||||||
my $vmversion = $1 if $webcontent =~ /VmVersion=(.*?)\s/i;
|
my $vmversion = $1 if $webcontent =~ /VmVersion=(.*?)\s/i;
|
||||||
my $vender = $1 if $webcontent =~ /VmVendor=\'(.*?)\'/i;
|
my $vender = $1 if $webcontent =~ /VmVendor=\'(.*?)\'/i;
|
||||||
my $uptime = $1 if $webcontent =~ /Uptime=(\d*)/i; #unit:ms
|
my $uptime = $1 if $webcontent =~ /Uptime=(\d*)/i; #unit:ms
|
||||||
my $startime = $1 if $webcontent =~ /StartTime=(\d*)/i;
|
my $startime = $1 if $webcontent =~ /StartTime=(\d*)/i;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $uptime / 1000, threshold => [
|
my $exit = $self->{perfdata}->threshold_check(value => $uptime / 1000, threshold => [
|
||||||
{ label => 'critical', 'exit_litteral' => 'critical' },
|
{ label => 'critical', 'exit_litteral' => 'critical' },
|
||||||
|
|
|
@ -27,36 +27,36 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ( $class, %options ) = @_;
|
my ( $class, %options ) = @_;
|
||||||
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(
|
$options{options}->add_options(
|
||||||
arguments => {
|
arguments => {
|
||||||
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmemory.jsp" },
|
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmemory.jsp" },
|
||||||
"warning-heap:s" => { name => 'warning-heap' , default => ",,,"},
|
"warning-heap:s" => { name => 'warning-heap' , default => ",,,"},
|
||||||
"warning-nonheap:s" => { name => 'warning-nonheap' , default => ",,,"},
|
"warning-nonheap:s" => { name => 'warning-nonheap' , default => ",,,"},
|
||||||
"critical-heap:s" => { name => 'critical-heap' , default => ",,,"},
|
"critical-heap:s" => { name => 'critical-heap' , default => ",,,"},
|
||||||
"critical-nonheap:s" => { name => 'critical-nonheap' , default => ",,,"},
|
"critical-nonheap:s" => { name => 'critical-nonheap' , default => ",,,"},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
($self->{warn_init_heap}, $self->{warn_max_heap}, $self->{warn_used_heap}, $self->{warn_committed_heap})
|
($self->{warn_init_heap}, $self->{warn_max_heap}, $self->{warn_used_heap}, $self->{warn_committed_heap})
|
||||||
= split /,/, $self->{option_results}->{"warning-heap"};
|
= split /,/, $self->{option_results}->{"warning-heap"};
|
||||||
($self->{warn_init_nonheap}, $self->{warn_max_nonheap}, $self->{warn_used_nonheap}, $self->{warn_committed_nonheap})
|
($self->{warn_init_nonheap}, $self->{warn_max_nonheap}, $self->{warn_used_nonheap}, $self->{warn_committed_nonheap})
|
||||||
= split /,/, $self->{option_results}->{"warning-nonheap"};
|
= split /,/, $self->{option_results}->{"warning-nonheap"};
|
||||||
($self->{crit_init_heap}, $self->{crit_max_heap}, $self->{crit_used_heap}, $self->{crit_committed_heap})
|
($self->{crit_init_heap}, $self->{crit_max_heap}, $self->{crit_used_heap}, $self->{crit_committed_heap})
|
||||||
= split /,/, $self->{option_results}->{"critical-heap"};
|
= split /,/, $self->{option_results}->{"critical-heap"};
|
||||||
($self->{crit_init_nonheap}, $self->{crit_max_nonheap}, $self->{crit_used_nonheap}, $self->{crit_committed_nonheap})
|
($self->{crit_init_nonheap}, $self->{crit_max_nonheap}, $self->{crit_used_nonheap}, $self->{crit_committed_nonheap})
|
||||||
= split /,/, $self->{option_results}->{"critical-nonheap"};
|
= split /,/, $self->{option_results}->{"critical-nonheap"};
|
||||||
|
|
||||||
# warning-heap
|
# warning-heap
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warn_init_heap', value => $self->{warn_init_heap})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warn_init_heap', value => $self->{warn_init_heap})) == 0) {
|
||||||
|
@ -132,167 +132,167 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /(^Type=HeapMemoryUsage|^Type=NonHeapMemoryUsage)/mi) {
|
if ($webcontent !~ /(^Type=HeapMemoryUsage|^Type=NonHeapMemoryUsage)/mi) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find heap or nonheap memory usage status."
|
short_msg => "Cannot find heap or nonheap memory usage status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ( $init_heap, $max_heap, $used_heap, $committed_heap ) = ( 0, 0, 0, 0 );
|
my ( $init_heap, $max_heap, $used_heap, $committed_heap ) = ( 0, 0, 0, 0 );
|
||||||
my ( $init_nonheap, $max_nonheap, $used_nonheap, $committed_nonheap ) = ( 0, 0, 0, 0 );
|
my ( $init_nonheap, $max_nonheap, $used_nonheap, $committed_nonheap ) = ( 0, 0, 0, 0 );
|
||||||
if ( $webcontent =~ /^Type=HeapMemoryUsage\sinit=(\d+)\smax=(\d+)\sused=(\d+)\scommitted=(\d+)/mi ){
|
if ( $webcontent =~ /^Type=HeapMemoryUsage\sinit=(\d+)\smax=(\d+)\sused=(\d+)\scommitted=(\d+)/mi ){
|
||||||
( $init_heap, $max_heap, $used_heap, $committed_heap ) = ( $1, $2, $3, $4 );
|
( $init_heap, $max_heap, $used_heap, $committed_heap ) = ( $1, $2, $3, $4 );
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'ok',
|
severity => 'ok',
|
||||||
short_msg => sprintf(
|
short_msg => sprintf(
|
||||||
"Heap Memory: init %d , max %d ,used %d ,commited %d",
|
"Heap Memory: init %d , max %d ,used %d ,commited %d",
|
||||||
$init_heap, $max_heap, $used_heap, $committed_heap
|
$init_heap, $max_heap, $used_heap, $committed_heap
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ( $webcontent =~ /^Type=NonHeapMemoryUsage\sinit=(\d+)\smax=(-{0,1}\d+)\sused=(\d+)\scommitted=(\d+)/mi ){
|
if ( $webcontent =~ /^Type=NonHeapMemoryUsage\sinit=(\d+)\smax=(-{0,1}\d+)\sused=(\d+)\scommitted=(\d+)/mi ){
|
||||||
( $init_nonheap, $max_nonheap, $used_nonheap, $committed_nonheap ) = ( $1, $2, $3, $4 );
|
( $init_nonheap, $max_nonheap, $used_nonheap, $committed_nonheap ) = ( $1, $2, $3, $4 );
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'ok',
|
severity => 'ok',
|
||||||
short_msg => sprintf(
|
short_msg => sprintf(
|
||||||
"NonHeap Memory: init %d , max %d ,used %d ,commited %d",
|
"NonHeap Memory: init %d , max %d ,used %d ,commited %d",
|
||||||
$init_nonheap, $max_nonheap,
|
$init_nonheap, $max_nonheap,
|
||||||
$used_nonheap, $committed_nonheap
|
$used_nonheap, $committed_nonheap
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $init_heap,
|
my $exit = $self->{perfdata}->threshold_check(value => $init_heap,
|
||||||
threshold => [ { label => 'crit_init_heap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_init_heap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_init_heap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_init_heap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Init Heap: %d", $init_heap)
|
short_msg => sprintf("Init Heap: %d", $init_heap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $max_heap,
|
$exit = $self->{perfdata}->threshold_check(value => $max_heap,
|
||||||
threshold => [ { label => 'crit_max_heap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_max_heap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_max_heap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_max_heap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Max Heap: %d", $max_heap)
|
short_msg => sprintf("Max Heap: %d", $max_heap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $used_heap,
|
$exit = $self->{perfdata}->threshold_check(value => $used_heap,
|
||||||
threshold => [ { label => 'crit_used_heap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_used_heap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_used_heap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_used_heap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Used Heap: %d", $used_heap)
|
short_msg => sprintf("Used Heap: %d", $used_heap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $committed_heap,
|
$exit = $self->{perfdata}->threshold_check(value => $committed_heap,
|
||||||
threshold => [ { label => 'crit_committed_heap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_committed_heap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_committed_heap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_committed_heap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Committed Heap: %d", $committed_heap)
|
short_msg => sprintf("Committed Heap: %d", $committed_heap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $init_nonheap,
|
$exit = $self->{perfdata}->threshold_check(value => $init_nonheap,
|
||||||
threshold => [ { label => 'crit_init_nonheap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_init_nonheap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_init_nonheap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_init_nonheap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Init NonHeap: %d", $init_nonheap)
|
short_msg => sprintf("Init NonHeap: %d", $init_nonheap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $max_nonheap,
|
$exit = $self->{perfdata}->threshold_check(value => $max_nonheap,
|
||||||
threshold => [ { label => 'crit_max_nonheap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_max_nonheap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_max_nonheap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_max_nonheap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Max NonHeap: %d", $max_nonheap)
|
short_msg => sprintf("Max NonHeap: %d", $max_nonheap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $used_nonheap,
|
$exit = $self->{perfdata}->threshold_check(value => $used_nonheap,
|
||||||
threshold => [ { label => 'crit_used_nonheap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_used_nonheap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_used_nonheap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_used_nonheap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Used NonHeap: %d", $used_nonheap)
|
short_msg => sprintf("Used NonHeap: %d", $used_nonheap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $committed_nonheap,
|
$exit = $self->{perfdata}->threshold_check(value => $committed_nonheap,
|
||||||
threshold => [ { label => 'crit_committed_nonheap', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_committed_nonheap', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_committed_nonheap', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_committed_nonheap', 'exit_litteral' => 'warning' } ]);
|
||||||
if ($exit ne "ok"){
|
if ($exit ne "ok"){
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("Committed NonHeap: %d", $committed_nonheap)
|
short_msg => sprintf("Committed NonHeap: %d", $committed_nonheap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "init_heap",
|
label => "init_heap",
|
||||||
value => $init_heap,
|
value => $init_heap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_heap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_heap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_heap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_heap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "max_heap",
|
label => "max_heap",
|
||||||
value => $max_heap,
|
value => $max_heap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_heap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_heap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_heap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_heap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "used_heap",
|
label => "used_heap",
|
||||||
value => $used_heap,
|
value => $used_heap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_heap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_heap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_heap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_heap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "committed_heap",
|
label => "committed_heap",
|
||||||
value => $committed_heap,
|
value => $committed_heap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_heap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_heap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_heap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_heap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "init_nonheap",
|
label => "init_nonheap",
|
||||||
value => $init_nonheap,
|
value => $init_nonheap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_nonheap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_nonheap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_nonheap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_nonheap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "max_nonheap",
|
label => "max_nonheap",
|
||||||
value => $max_nonheap,
|
value => $max_nonheap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_nonheap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_nonheap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_nonheap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_nonheap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "used_nonheap",
|
label => "used_nonheap",
|
||||||
value => $used_nonheap,
|
value => $used_nonheap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_nonheap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_nonheap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_nonheap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_nonheap'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "committed_nonheap",
|
label => "committed_nonheap",
|
||||||
value => $committed_nonheap,
|
value => $committed_nonheap,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_nonheap'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_nonheap'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_nonheap'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_nonheap'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -27,25 +27,25 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ( $class, %options ) = @_;
|
my ( $class, %options ) = @_;
|
||||||
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(
|
$options{options}->add_options(
|
||||||
arguments => {
|
arguments => {
|
||||||
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmuxhandler.jsp" },
|
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmuxhandler.jsp" },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||||
|
@ -58,37 +58,37 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /MaxThreads=\d+/i) {
|
if ($webcontent !~ /MaxThreads=\d+/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'"
|
short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'"
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($maxthreads, $minsparethreads, $maxsparethreads, $maxqueuesize, $idletimeout, $processedcount) = (0, 0, 0, 0, 0, 0);
|
my ($maxthreads, $minsparethreads, $maxsparethreads, $maxqueuesize, $idletimeout, $processedcount) = (0, 0, 0, 0, 0, 0);
|
||||||
my ($currentthreadcount, $availablethreadcount, $busythreadcount, $maxavailablethreadcount, $maxbusythreadcount) = (0, 0, 0, 0, 0);
|
my ($currentthreadcount, $availablethreadcount, $busythreadcount, $maxavailablethreadcount, $maxbusythreadcount) = (0, 0, 0, 0, 0);
|
||||||
my ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0);
|
my ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0);
|
||||||
|
|
||||||
$maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ;
|
$maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ;
|
||||||
$minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ;
|
$minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ;
|
||||||
$maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ;
|
$maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ;
|
||||||
$maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ;
|
$maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ;
|
||||||
$idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ;
|
$idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ;
|
||||||
$processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ;
|
$processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ;
|
||||||
$currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ;
|
$currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ;
|
||||||
$availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ;
|
$availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ;
|
||||||
$busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ;
|
$busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ;
|
||||||
$maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ;
|
$maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ;
|
||||||
$maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ;
|
$maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ;
|
||||||
$maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ;
|
$maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ;
|
||||||
$createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ;
|
$createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ;
|
||||||
$destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ;
|
$destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ;
|
||||||
|
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxThreads: %d", $maxthreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxThreads: %d", $maxthreads));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MinSpareThreads: %d", $minsparethreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MinSpareThreads: %d", $minsparethreads));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads));
|
||||||
|
|
|
@ -61,14 +61,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ( $webcontent !~ /MinorGCCount=\d+/mi ) {
|
if ( $webcontent !~ /MinorGCCount=\d+/mi ) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find jvm gc status."
|
short_msg => "Cannot find jvm gc status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($minorgccount, $minorgctime, $fullgccount, $fullgctime) = (0, 0, 0, 0);
|
my ($minorgccount, $minorgctime, $fullgccount, $fullgctime) = (0, 0, 0, 0);
|
||||||
|
|
||||||
($minorgccount, $minorgctime, $fullgccount, $fullgctime) = ($1, $2, $3, $4) if ($webcontent =~ /MinorGCCount=(\d+)\sMinorGCTime=(\d+)\sFullGCCount=(\d+)\sFullGCTime=(\d+)/mi);
|
($minorgccount, $minorgctime, $fullgccount, $fullgctime) = ($1, $2, $3, $4) if ($webcontent =~ /MinorGCCount=(\d+)\sMinorGCTime=(\d+)\sFullGCCount=(\d+)\sFullGCTime=(\d+)/mi);
|
||||||
|
|
|
@ -68,14 +68,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ($webcontent !~ /^COUNT.*?=\d+/i) {
|
if ($webcontent !~ /^COUNT.*?=\d+/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find ksql temptable status."
|
short_msg => "Cannot find ksql temptable status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i;
|
my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [
|
my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [
|
||||||
|
|
|
@ -68,14 +68,14 @@ sub run {
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
|
|
||||||
if ( $webcontent !~ /^COUNT.*?=\d+/i ) {
|
if ( $webcontent !~ /^COUNT.*?=\d+/i ) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find oracle recyclebin status."
|
short_msg => "Cannot find oracle recyclebin status."
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i;
|
my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [
|
my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Copyright 2016 Centreon (http://www.centreon.com/)
|
# Copyright 2016 Centreon (http://www.centreon.com/)
|
||||||
#
|
#
|
||||||
# Centreon is a full-fledged industry-strength solution that meets
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# the needs in IT infrastructure and application monitoring for
|
# the needs in IT infrastructure application monitoring for
|
||||||
# service performance.
|
# service performance.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Author : CHEN JUN , aladdin.china@gmail.com
|
# Author : CHEN JUN , aladdin.china@gmail.com
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Copyright 2016 Centreon (http://www.centreon.com/)
|
# Copyright 2016 Centreon (http://www.centreon.com/)
|
||||||
#
|
#
|
||||||
# Centreon is a full-fledged industry-strength solution that meets
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# the needs in IT infrastructure and application monitoring for
|
# the needs in IT infrastructure application monitoring for
|
||||||
# service performance.
|
# service performance.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Author : CHEN JUN , aladdin.china@gmail.com
|
# Author : CHEN JUN , aladdin.china@gmail.com
|
||||||
|
@ -118,8 +118,8 @@ sub run {
|
||||||
$scheduler = $1 if $webcontent =~ /^WAIT_CLASS=Scheduler\sCOUNT=(\d+)/mi;
|
$scheduler = $1 if $webcontent =~ /^WAIT_CLASS=Scheduler\sCOUNT=(\d+)/mi;
|
||||||
$idle = $1 if $webcontent =~ /^WAIT_CLASS=Idle\sCOUNT=(\d+)/mi;
|
$idle = $1 if $webcontent =~ /^WAIT_CLASS=Idle\sCOUNT=(\d+)/mi;
|
||||||
|
|
||||||
#cpu and cpuwait
|
#cpu cpuwait
|
||||||
my $cpuandwait = $idle + $network ;
|
my $cpu wait = $idle + $network ;
|
||||||
|
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Other: %d", $other));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Other: %d", $other));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Queueing: %d", $queueing));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Queueing: %d", $queueing));
|
||||||
|
@ -131,7 +131,7 @@ sub run {
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("System I/O: %d", $systemio));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("System I/O: %d", $systemio));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("User I/O: %d", $userio));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("User I/O: %d", $userio));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Scheduler: %d", $scheduler));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("Scheduler: %d", $scheduler));
|
||||||
$self->{output}->output_add(severity => "ok", short_msg => sprintf("CPU + CPU Wait: %d", $cpuandwait));
|
$self->{output}->output_add(severity => "ok", short_msg => sprintf("CPU + CPU Wait: %d", $cpu wait));
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $activecount, threshold => [ { label => 'crit_activecount', exit_litteral => 'critical' },
|
my $exit = $self->{perfdata}->threshold_check(value => $activecount, threshold => [ { label => 'crit_activecount', exit_litteral => 'critical' },
|
||||||
{ label => 'warn_activecount', exit_litteral => 'warning' } ]);
|
{ label => 'warn_activecount', exit_litteral => 'warning' } ]);
|
||||||
|
@ -151,7 +151,7 @@ sub run {
|
||||||
$self->{output}->perfdata_add(label => "System I/O", unit => '', value => sprintf("%d", $systemio));
|
$self->{output}->perfdata_add(label => "System I/O", unit => '', value => sprintf("%d", $systemio));
|
||||||
$self->{output}->perfdata_add(label => "User I/O", unit => '', value => sprintf("%d", $userio));
|
$self->{output}->perfdata_add(label => "User I/O", unit => '', value => sprintf("%d", $userio));
|
||||||
$self->{output}->perfdata_add(label => "Scheduler", unit => '', value => sprintf("%d", $scheduler));
|
$self->{output}->perfdata_add(label => "Scheduler", unit => '', value => sprintf("%d", $scheduler));
|
||||||
$self->{output}->perfdata_add(label => "CPU + CPU Wait", unit => '', value => sprintf("%d", $cpuandwait));
|
$self->{output}->perfdata_add(label => "CPU + CPU Wait", unit => '', value => sprintf("%d", $cpu wait));
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => "ActiveCount", unit => '',
|
$self->{output}->perfdata_add(label => "ActiveCount", unit => '',
|
||||||
value => sprintf("%d", $activecount),
|
value => sprintf("%d", $activecount),
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Copyright 2016 Centreon (http://www.centreon.com/)
|
# Copyright 2016 Centreon (http://www.centreon.com/)
|
||||||
#
|
#
|
||||||
# Centreon is a full-fledged industry-strength solution that meets
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# the needs in IT infrastructure and application monitoring for
|
# the needs in IT infrastructure application monitoring for
|
||||||
# service performance.
|
# service performance.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Author : CHEN JUN , aladdin.china@gmail.com
|
# Author : CHEN JUN , aladdin.china@gmail.com
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Copyright 2016 Centreon (http://www.centreon.com/)
|
# Copyright 2016 Centreon (http://www.centreon.com/)
|
||||||
#
|
#
|
||||||
# Centreon is a full-fledged industry-strength solution that meets
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# the needs in IT infrastructure and application monitoring for
|
# the needs in IT infrastructure application monitoring for
|
||||||
# service performance.
|
# service performance.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Author : CHEN JUN , aladdin.china@gmail.com
|
# Author : CHEN JUN , aladdin.china@gmail.com
|
||||||
|
|
|
@ -27,30 +27,30 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ( $class, %options ) = @_;
|
my ( $class, %options ) = @_;
|
||||||
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(
|
$options{options}->add_options(
|
||||||
arguments => {
|
arguments => {
|
||||||
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkrpc.jsp" },
|
"urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkrpc.jsp" },
|
||||||
"warning:s" => { name => 'warning' , default => ",,,,,,"},
|
"warning:s" => { name => 'warning' , default => ",,,,,,"},
|
||||||
"critical:s" => { name => 'critical' , default => ",,,,,,"},
|
"critical:s" => { name => 'critical' , default => ",,,,,,"},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
($self->{warn_activethreadcount}, $self->{warn_stubcount}, $self->{warn_proxycount}, $self->{warn_clientsessioncount} ,$self->{warn_serversessioncount} ,$self->{warn_invokecountpermin} ,$self->{warn_servicecountpermin})
|
($self->{warn_activethreadcount}, $self->{warn_stubcount}, $self->{warn_proxycount}, $self->{warn_clientsessioncount} ,$self->{warn_serversessioncount} ,$self->{warn_invokecountpermin} ,$self->{warn_servicecountpermin})
|
||||||
= split /,/, $self->{option_results}->{"warning"};
|
= split /,/, $self->{option_results}->{"warning"};
|
||||||
($self->{crit_activethreadcount}, $self->{crit_stubcount}, $self->{crit_proxycount}, $self->{crit_clientsessioncount} ,$self->{crit_serversessioncount} ,$self->{crit_invokecountpermin} ,$self->{crit_servicecountpermin})
|
($self->{crit_activethreadcount}, $self->{crit_stubcount}, $self->{crit_proxycount}, $self->{crit_clientsessioncount} ,$self->{crit_serversessioncount} ,$self->{crit_invokecountpermin} ,$self->{crit_servicecountpermin})
|
||||||
= split /,/, $self->{option_results}->{"critical"};
|
= split /,/, $self->{option_results}->{"critical"};
|
||||||
|
|
||||||
# warning
|
# warning
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warn_activethreadcount', value => $self->{warn_activethreadcount})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warn_activethreadcount', value => $self->{warn_activethreadcount})) == 0) {
|
||||||
|
@ -114,132 +114,132 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ( $self, %options ) = @_;
|
my ( $self, %options ) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
if ($webcontent !~ /ActiveThreadCount=\d+/i) {
|
if ($webcontent !~ /ActiveThreadCount=\d+/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find ormrpc status in response: \'" . $webcontent . "\'"
|
short_msg => "Cannot find ormrpc status in response: \'" . $webcontent . "\'"
|
||||||
);
|
);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($activethreadcount, $stubcount, $proxycount, $clientsessioncount, $serversessioncount, $invokecountpermin, $servicecountpermin, $invokecount, $servicecount) = (0, 0, 0, 0, 0, 0, 0, 0, 0);
|
my ($activethreadcount, $stubcount, $proxycount, $clientsessioncount, $serversessioncount, $invokecountpermin, $servicecountpermin, $invokecount, $servicecount) = (0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
$activethreadcount = $1 if $webcontent =~ /ActiveThreadCount=(\d+)/mi ;
|
$activethreadcount = $1 if $webcontent =~ /ActiveThreadCount=(\d+)/mi ;
|
||||||
$stubcount = $1 if $webcontent =~ /StubCount=(\d+)/mi ;
|
$stubcount = $1 if $webcontent =~ /StubCount=(\d+)/mi ;
|
||||||
$proxycount = $1 if $webcontent =~ /ProxyCount=(\d+)/mi ;
|
$proxycount = $1 if $webcontent =~ /ProxyCount=(\d+)/mi ;
|
||||||
$clientsessioncount = $1 if $webcontent =~ /ClientSessionCount=(\d+)/mi ;
|
$clientsessioncount = $1 if $webcontent =~ /ClientSessionCount=(\d+)/mi ;
|
||||||
$serversessioncount = $1 if $webcontent =~ /ServerSessionCount=(\d+)/mi ;
|
$serversessioncount = $1 if $webcontent =~ /ServerSessionCount=(\d+)/mi ;
|
||||||
$invokecountpermin = $1 if $webcontent =~ /ClientInvokeCountPerMinute=(\d+)/mi ;
|
$invokecountpermin = $1 if $webcontent =~ /ClientInvokeCountPerMinute=(\d+)/mi ;
|
||||||
$servicecountpermin = $1 if $webcontent =~ /ProcessedServiceCountPerMinute=(\d+)/mi ;
|
$servicecountpermin = $1 if $webcontent =~ /ProcessedServiceCountPerMinute=(\d+)/mi ;
|
||||||
$invokecount = $1 if $webcontent =~ /ClientInvokeCount=(\d+)/mi ;
|
$invokecount = $1 if $webcontent =~ /ClientInvokeCount=(\d+)/mi ;
|
||||||
$servicecount = $1 if $webcontent =~ /ProcessedServiceCount=(\d+)/mi ;
|
$servicecount = $1 if $webcontent =~ /ProcessedServiceCount=(\d+)/mi ;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $activethreadcount,
|
my $exit = $self->{perfdata}->threshold_check(value => $activethreadcount,
|
||||||
threshold => [ { label => 'crit_activethreadcount', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_activethreadcount', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_activethreadcount', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_activethreadcount', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("ActiveTrheadCount: %d", $activethreadcount)
|
short_msg => sprintf("ActiveTrheadCount: %d", $activethreadcount)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $stubcount,
|
$exit = $self->{perfdata}->threshold_check(value => $stubcount,
|
||||||
threshold => [ { label => 'crit_stubcount', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_stubcount', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_stubcount', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_stubcount', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("StubCount: %d", $stubcount)
|
short_msg => sprintf("StubCount: %d", $stubcount)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $proxycount,
|
$exit = $self->{perfdata}->threshold_check(value => $proxycount,
|
||||||
threshold => [ { label => 'crit_proxycount', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_proxycount', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_proxycount', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_proxycount', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("ProxyCount: %d", $proxycount)
|
short_msg => sprintf("ProxyCount: %d", $proxycount)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $clientsessioncount,
|
$exit = $self->{perfdata}->threshold_check(value => $clientsessioncount,
|
||||||
threshold => [ { label => 'crit_clientsessioncount', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_clientsessioncount', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_clientsessioncount', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_clientsessioncount', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("ClientSessionCount: %d", $clientsessioncount)
|
short_msg => sprintf("ClientSessionCount: %d", $clientsessioncount)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $serversessioncount,
|
$exit = $self->{perfdata}->threshold_check(value => $serversessioncount,
|
||||||
threshold => [ { label => 'crit_serversessioncount', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_serversessioncount', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_serversessioncount', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_serversessioncount', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("ServerSessionCount: %d", $serversessioncount)
|
short_msg => sprintf("ServerSessionCount: %d", $serversessioncount)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $invokecountpermin,
|
$exit = $self->{perfdata}->threshold_check(value => $invokecountpermin,
|
||||||
threshold => [ { label => 'crit_invokecountpermin', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_invokecountpermin', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_invokecountpermin', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_invokecountpermin', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("InvokeCountPerMinute: %d", $invokecountpermin)
|
short_msg => sprintf("InvokeCountPerMinute: %d", $invokecountpermin)
|
||||||
);
|
);
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $servicecountpermin,
|
$exit = $self->{perfdata}->threshold_check(value => $servicecountpermin,
|
||||||
threshold => [ { label => 'crit_servicecountpermin', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'crit_servicecountpermin', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warn_servicecountpermin', 'exit_litteral' => 'warning' } ]);
|
{ label => 'warn_servicecountpermin', 'exit_litteral' => 'warning' } ]);
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit,
|
severity => $exit,
|
||||||
short_msg => sprintf("ServiceCountPerMinute: %d", $servicecountpermin)
|
short_msg => sprintf("ServiceCountPerMinute: %d", $servicecountpermin)
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "ActiveTrheadCount",
|
label => "ActiveTrheadCount",
|
||||||
value => $activethreadcount,
|
value => $activethreadcount,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_activethreadcount'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_activethreadcount'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_activethreadcount'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_activethreadcount'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "StubCount",
|
label => "StubCount",
|
||||||
value => $stubcount,
|
value => $stubcount,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_stubcount'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_stubcount'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_stubcount'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_stubcount'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "ProxyCount",
|
label => "ProxyCount",
|
||||||
value => $proxycount,
|
value => $proxycount,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_proxycount'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_proxycount'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_proxycount'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_proxycount'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "ClientSessionCount",
|
label => "ClientSessionCount",
|
||||||
value => $clientsessioncount,
|
value => $clientsessioncount,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_clientsessioncount'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_clientsessioncount'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_clientsessioncount'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_clientsessioncount'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "ServerSessionCount",
|
label => "ServerSessionCount",
|
||||||
value => $serversessioncount,
|
value => $serversessioncount,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_serversessioncount'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_serversessioncount'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_serversessioncount'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_serversessioncount'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "InvokeCount /min",
|
label => "InvokeCount /min",
|
||||||
value => $invokecountpermin,
|
value => $invokecountpermin,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_invokecountpermin'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_invokecountpermin'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_invokecountpermin'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_invokecountpermin'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "ServiceCount /min",
|
label => "ServiceCount /min",
|
||||||
value => $servicecountpermin,
|
value => $servicecountpermin,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_servicecountpermin'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_servicecountpermin'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_servicecountpermin'),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_servicecountpermin'),
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "c[InvokeCount]",
|
label => "c[InvokeCount]",
|
||||||
value => $invokecount,
|
value => $invokecount,
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => "c[ServiceCount]",
|
label => "c[ServiceCount]",
|
||||||
value => $servicecount,
|
value => $servicecount,
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -48,9 +48,9 @@ sub check_options {
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
($self->{warn_activecount}, $self->{warn_timeoutcount})
|
($self->{warn_activecount}, $self->{warn_timeoutcount})
|
||||||
= split /,/, $self->{option_results}->{"warning"};
|
= split /,/, $self->{option_results}->{"warning"};
|
||||||
($self->{crit_activecount}, $self->{crit_timeoutcount})
|
($self->{crit_activecount}, $self->{crit_timeoutcount})
|
||||||
= split /,/, $self->{option_results}->{"critical"};
|
= split /,/, $self->{option_results}->{"critical"};
|
||||||
|
|
||||||
# warning
|
# warning
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warn_activecount', value => $self->{warn_activecount})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warn_activecount', value => $self->{warn_activecount})) == 0) {
|
||||||
|
@ -76,23 +76,23 @@ sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path});
|
||||||
if ($webcontent !~ /TransactionCount=\d+/i) {
|
if ($webcontent !~ /TransactionCount=\d+/i) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => 'UNKNOWN',
|
severity => 'UNKNOWN',
|
||||||
short_msg => "Cannot find transaction status."
|
short_msg => "Cannot find transaction status."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($transactioncount, $totaltransactiontime, $committedcount, $rolledbackcount, $activecount, $maxtransactiontime, $defaulttimeout, $timeoutcount) = (0, 0, 0, 0, 0, 0, 0, 0);
|
my ($transactioncount, $totaltransactiontime, $committedcount, $rolledbackcount, $activecount, $maxtransactiontime, $defaulttimeout, $timeoutcount) = (0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
$transactioncount = $1 if $webcontent =~ /TransactionCount=(\d+)\s/i;
|
$transactioncount = $1 if $webcontent =~ /TransactionCount=(\d+)\s/i;
|
||||||
$totaltransactiontime = $1 if $webcontent =~ /TotalTransactionTime=(\d+)\s/i;
|
$totaltransactiontime = $1 if $webcontent =~ /TotalTransactionTime=(\d+)\s/i;
|
||||||
$committedcount = $1 if $webcontent =~ /CommittedCount=(\d+)\s/i;
|
$committedcount = $1 if $webcontent =~ /CommittedCount=(\d+)\s/i;
|
||||||
$rolledbackcount = $1 if $webcontent =~ /RolledbackCount=(\d+)\s/i;
|
$rolledbackcount = $1 if $webcontent =~ /RolledbackCount=(\d+)\s/i;
|
||||||
$activecount = $1 if $webcontent =~ /ActiveCount=(\d+)\s/i;
|
$activecount = $1 if $webcontent =~ /ActiveCount=(\d+)\s/i;
|
||||||
$maxtransactiontime = $1 if $webcontent =~ /MaxTransactionTime=(\d+)\s/i;
|
$maxtransactiontime = $1 if $webcontent =~ /MaxTransactionTime=(\d+)\s/i;
|
||||||
$defaulttimeout = $1 if $webcontent =~ /DefaultTimeout=(\d+)\s/i;
|
$defaulttimeout = $1 if $webcontent =~ /DefaultTimeout=(\d+)\s/i;
|
||||||
$timeoutcount = $1 if $webcontent =~ /TimedOutCount=(\d+)\s/i;
|
$timeoutcount = $1 if $webcontent =~ /TimedOutCount=(\d+)\s/i;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $activecount, threshold => [ { label => 'crit_activecount', exit_litteral => 'critical' },
|
my $exit = $self->{perfdata}->threshold_check(value => $activecount, threshold => [ { label => 'crit_activecount', exit_litteral => 'critical' },
|
||||||
{ label => 'warn_activecount', exit_litteral => 'warning' } ]);
|
{ label => 'warn_activecount', exit_litteral => 'warning' } ]);
|
||||||
|
|
Loading…
Reference in New Issue