From b46892d181c0b5216fb71ed9e1b871c2ab1418f2 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 6 Dec 2017 17:18:24 +0100 Subject: [PATCH] remove tab --- apps/kingdee/eas/mode/activeusers.pm | 16 +- apps/kingdee/eas/mode/classloading.pm | 16 +- apps/kingdee/eas/mode/datasource.pm | 46 ++-- apps/kingdee/eas/mode/easlicense.pm | 10 +- apps/kingdee/eas/mode/httphandler.pm | 74 ++--- apps/kingdee/eas/mode/ibmjvmgc.pm | 16 +- apps/kingdee/eas/mode/javaruntime.pm | 26 +- apps/kingdee/eas/mode/memory.pm | 270 +++++++++---------- apps/kingdee/eas/mode/muxhandler.pm | 74 ++--- apps/kingdee/eas/mode/oraclejvmgc.pm | 16 +- apps/kingdee/eas/mode/oracleksqltemptable.pm | 16 +- apps/kingdee/eas/mode/oraclerecyclebin.pm | 16 +- apps/kingdee/eas/mode/oracleredolog.pm | 4 +- apps/kingdee/eas/mode/oraclesession.pm | 12 +- apps/kingdee/eas/mode/oracletable.pm | 4 +- apps/kingdee/eas/mode/oracleversion.pm | 4 +- apps/kingdee/eas/mode/ormrpc.pm | 230 ++++++++-------- apps/kingdee/eas/mode/transaction.pm | 34 +-- 18 files changed, 442 insertions(+), 442 deletions(-) diff --git a/apps/kingdee/eas/mode/activeusers.pm b/apps/kingdee/eas/mode/activeusers.pm index b75612963..9f01160cf 100644 --- a/apps/kingdee/eas/mode/activeusers.pm +++ b/apps/kingdee/eas/mode/activeusers.pm @@ -61,14 +61,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /.*ActiveUsers_1m=.*/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find eas actvie users info." - ); - $self->{output}->option_exit(); - } - + if ($webcontent !~ /.*ActiveUsers_1m=.*/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find eas actvie users info." + ); + $self->{output}->option_exit(); + } + my @activeusers = split(" ",$webcontent); my $info; diff --git a/apps/kingdee/eas/mode/classloading.pm b/apps/kingdee/eas/mode/classloading.pm index 4e8b34b4d..cd2719858 100644 --- a/apps/kingdee/eas/mode/classloading.pm +++ b/apps/kingdee/eas/mode/classloading.pm @@ -61,14 +61,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /(LoadedClassCount|UnloadedClassCount)/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find classloading status." - ); - $self->{output}->option_exit(); - } - + if ($webcontent !~ /(LoadedClassCount|UnloadedClassCount)/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find classloading status." + ); + $self->{output}->option_exit(); + } + my ($loadedclasscount, $unloadedclasscount) = (0, 0); if ($webcontent =~ /LoadedClassCount=\s*(\d+)/mi) { diff --git a/apps/kingdee/eas/mode/datasource.pm b/apps/kingdee/eas/mode/datasource.pm index 0094a2976..37913ccdc 100644 --- a/apps/kingdee/eas/mode/datasource.pm +++ b/apps/kingdee/eas/mode/datasource.pm @@ -68,32 +68,32 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /^Name=/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find datasource \'" . $self->{option_results}->{datasource} . "\' status." - ); - } + if ($webcontent !~ /^Name=/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find datasource \'" . $self->{option_results}->{datasource} . "\' status." + ); + } - my $init_pool_size = -1; - my $max_pool_size = -1; - my $idle_timeout = -1; - my $cur_conn_count = -1; - my $cur_avail_conn_count = -1; - my $max_conn_count = -1; - my $create_count = -1; - my $close_count = -1; + my $init_pool_size = -1; + my $max_pool_size = -1; + my $idle_timeout = -1; + my $cur_conn_count = -1; + my $cur_avail_conn_count = -1; + my $max_conn_count = -1; + my $create_count = -1; + my $close_count = -1; - $init_pool_size = $1 if $webcontent =~ /InitialPoolSize=(\d+)\s/i; - $max_pool_size = $1 if $webcontent =~ /MaxPoolSize=(\d+)\s/i; - $idle_timeout = $1 if $webcontent =~ /IdleTimeout=(\d+)\s/i; - $cur_conn_count = $1 if $webcontent =~ /CurrentConnectionCount=(\d+)\s/i; - $cur_avail_conn_count = $1 if $webcontent =~ /CurrentAvailableConnectionCount=(\d+)\s/i; - $max_conn_count = $1 if $webcontent =~ /MaxConnectionCount=(\d+)\s/i; - $create_count = $1 if $webcontent =~ /CreateCount=(\d+)\s/i; - $close_count = $1 if $webcontent =~ /CloseCount=(\d+)\s/i; + $init_pool_size = $1 if $webcontent =~ /InitialPoolSize=(\d+)\s/i; + $max_pool_size = $1 if $webcontent =~ /MaxPoolSize=(\d+)\s/i; + $idle_timeout = $1 if $webcontent =~ /IdleTimeout=(\d+)\s/i; + $cur_conn_count = $1 if $webcontent =~ /CurrentConnectionCount=(\d+)\s/i; + $cur_avail_conn_count = $1 if $webcontent =~ /CurrentAvailableConnectionCount=(\d+)\s/i; + $max_conn_count = $1 if $webcontent =~ /MaxConnectionCount=(\d+)\s/i; + $create_count = $1 if $webcontent =~ /CreateCount=(\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("MaxPoolSize: %d", $max_pool_size)); diff --git a/apps/kingdee/eas/mode/easlicense.pm b/apps/kingdee/eas/mode/easlicense.pm index 740e819af..ba1d70769 100644 --- a/apps/kingdee/eas/mode/easlicense.pm +++ b/apps/kingdee/eas/mode/easlicense.pm @@ -60,12 +60,12 @@ sub run { my ($self, %options) = @_; my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /.*BOS=.*/i) { - $self->{output}->output_add(severity => 'UNKNOWN', + if ($webcontent !~ /.*BOS=.*/i) { + $self->{output}->output_add(severity => 'UNKNOWN', short_msg => "Cannot find eas license usage info."); - $self->{output}->option_exit(); - } - + $self->{output}->option_exit(); + } + my @licenseinfo = split(" ",$webcontent); my $info; diff --git a/apps/kingdee/eas/mode/httphandler.pm b/apps/kingdee/eas/mode/httphandler.pm index faab9670c..25e2154eb 100644 --- a/apps/kingdee/eas/mode/httphandler.pm +++ b/apps/kingdee/eas/mode/httphandler.pm @@ -27,25 +27,25 @@ use strict; use warnings; sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new( package => __PACKAGE__, %options ); - bless $self, $class; + my ($class, %options) = @_; + my $self = $class->SUPER::new( package => __PACKAGE__, %options ); + bless $self, $class; - $self->{version} = '1.0'; - $options{options}->add_options( - arguments => { - "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkhttphandler.jsp" }, - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - } - ); + $self->{version} = '1.0'; + $options{options}->add_options( + arguments => { + "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkhttphandler.jsp" }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + } + ); - return $self; + return $self; } sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); + my ($self, %options) = @_; + $self->SUPER::init(%options); 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} . "'."); @@ -59,37 +59,37 @@ sub check_options { } sub run { - my ($self, %options) = @_; + my ($self, %options) = @_; my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /MaxThreads=\d+/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'" - ); - $self->{output}->option_exit(); - } + if ($webcontent !~ /MaxThreads=\d+/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'" + ); + $self->{output}->option_exit(); + } 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 ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0); - $maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ; - $minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ; - $maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ; - $maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ; - $idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ; - $processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ; - $currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ; - $availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ; - $busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ; - $maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ; - $maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ; - $maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ; - $createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ; - $destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ; - + $maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ; + $minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ; + $maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ; + $maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ; + $idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ; + $processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ; + $currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ; + $availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ; + $busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ; + $maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ; + $maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ; + $maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ; + $createcount = $1 if $webcontent =~ /CreateCount=(\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("MinSpareThreads: %d", $minsparethreads)); $self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads)); diff --git a/apps/kingdee/eas/mode/ibmjvmgc.pm b/apps/kingdee/eas/mode/ibmjvmgc.pm index 88beb8b0d..65a4833c6 100644 --- a/apps/kingdee/eas/mode/ibmjvmgc.pm +++ b/apps/kingdee/eas/mode/ibmjvmgc.pm @@ -61,14 +61,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /CollectionCount=\d+/mi) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find ibm jdk j9 gc status." - ); - $self->{output}->option_exit(); - } - + if ($webcontent !~ /CollectionCount=\d+/mi) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find ibm jdk j9 gc status." + ); + $self->{output}->option_exit(); + } + my ($collectioncount, $collectiontime) = (0, 0); ($collectioncount, $collectiontime) = ($1, $2) if ($webcontent =~ /CollectionCount=(\d+)\sCollectionTime=(\d+)/mi); diff --git a/apps/kingdee/eas/mode/javaruntime.pm b/apps/kingdee/eas/mode/javaruntime.pm index 54c30f604..421704264 100644 --- a/apps/kingdee/eas/mode/javaruntime.pm +++ b/apps/kingdee/eas/mode/javaruntime.pm @@ -63,20 +63,20 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /VmName=/mi) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find java runtime status." - ); - $self->{output}->option_exit(); - } - + if ($webcontent !~ /VmName=/mi) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find java runtime status." + ); + $self->{output}->option_exit(); + } + my $vmname = $1 if $webcontent =~ /VmName=\'(.*?)\'/i; - my $specversion = $1 if $webcontent =~ /SpecVersion=([\d\.]+)/i; - my $vmversion = $1 if $webcontent =~ /VmVersion=(.*?)\s/i; - my $vender = $1 if $webcontent =~ /VmVendor=\'(.*?)\'/i; - my $uptime = $1 if $webcontent =~ /Uptime=(\d*)/i; #unit:ms - my $startime = $1 if $webcontent =~ /StartTime=(\d*)/i; + my $specversion = $1 if $webcontent =~ /SpecVersion=([\d\.]+)/i; + my $vmversion = $1 if $webcontent =~ /VmVersion=(.*?)\s/i; + my $vender = $1 if $webcontent =~ /VmVendor=\'(.*?)\'/i; + my $uptime = $1 if $webcontent =~ /Uptime=(\d*)/i; #unit:ms + my $startime = $1 if $webcontent =~ /StartTime=(\d*)/i; my $exit = $self->{perfdata}->threshold_check(value => $uptime / 1000, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, diff --git a/apps/kingdee/eas/mode/memory.pm b/apps/kingdee/eas/mode/memory.pm index 413f445fc..f4eab5aa2 100644 --- a/apps/kingdee/eas/mode/memory.pm +++ b/apps/kingdee/eas/mode/memory.pm @@ -27,36 +27,36 @@ use strict; use warnings; sub new { - my ( $class, %options ) = @_; - my $self = $class->SUPER::new( package => __PACKAGE__, %options ); - bless $self, $class; + my ( $class, %options ) = @_; + my $self = $class->SUPER::new( package => __PACKAGE__, %options ); + bless $self, $class; - $self->{version} = '1.0'; - $options{options}->add_options( - arguments => { - "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmemory.jsp" }, - "warning-heap:s" => { name => 'warning-heap' , default => ",,,"}, - "warning-nonheap:s" => { name => 'warning-nonheap' , default => ",,,"}, - "critical-heap:s" => { name => 'critical-heap' , default => ",,,"}, - "critical-nonheap:s" => { name => 'critical-nonheap' , default => ",,,"}, - } - ); + $self->{version} = '1.0'; + $options{options}->add_options( + arguments => { + "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmemory.jsp" }, + "warning-heap:s" => { name => 'warning-heap' , default => ",,,"}, + "warning-nonheap:s" => { name => 'warning-nonheap' , default => ",,,"}, + "critical-heap:s" => { name => 'critical-heap' , default => ",,,"}, + "critical-nonheap:s" => { name => 'critical-nonheap' , default => ",,,"}, + } + ); - return $self; + return $self; } sub check_options { - my ( $self, %options ) = @_; - $self->SUPER::init(%options); + my ( $self, %options ) = @_; + $self->SUPER::init(%options); ($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}) - = 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}) - = 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}) - = split /,/, $self->{option_results}->{"critical-nonheap"}; + = split /,/, $self->{option_results}->{"critical-nonheap"}; # warning-heap if (($self->{perfdata}->threshold_validate(label => 'warn_init_heap', value => $self->{warn_init_heap})) == 0) { @@ -132,167 +132,167 @@ sub check_options { } 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) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find heap or nonheap memory usage status." - ); - $self->{output}->option_exit(); - } + if ($webcontent !~ /(^Type=HeapMemoryUsage|^Type=NonHeapMemoryUsage)/mi) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find heap or nonheap memory usage status." + ); + $self->{output}->option_exit(); + } - 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 ); - 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 ); - $self->{output}->output_add( - severity => 'ok', - short_msg => sprintf( - "Heap Memory: init %d , max %d ,used %d ,commited %d", - $init_heap, $max_heap, $used_heap, $committed_heap - ) - ); - } - 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 ); - $self->{output}->output_add( - severity => 'ok', - short_msg => sprintf( - "NonHeap Memory: init %d , max %d ,used %d ,commited %d", - $init_nonheap, $max_nonheap, - $used_nonheap, $committed_nonheap - ) - ); - } - - my $exit = $self->{perfdata}->threshold_check(value => $init_heap, - threshold => [ { label => 'crit_init_heap', 'exit_litteral' => 'critical' }, + 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 ); + 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 ); + $self->{output}->output_add( + severity => 'ok', + short_msg => sprintf( + "Heap Memory: init %d , max %d ,used %d ,commited %d", + $init_heap, $max_heap, $used_heap, $committed_heap + ) + ); + } + 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 ); + $self->{output}->output_add( + severity => 'ok', + short_msg => sprintf( + "NonHeap Memory: init %d , max %d ,used %d ,commited %d", + $init_nonheap, $max_nonheap, + $used_nonheap, $committed_nonheap + ) + ); + } + + my $exit = $self->{perfdata}->threshold_check(value => $init_heap, + threshold => [ { label => 'crit_init_heap', 'exit_litteral' => 'critical' }, { label => 'warn_init_heap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Init Heap: %d", $init_heap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Init Heap: %d", $init_heap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $max_heap, - threshold => [ { label => 'crit_max_heap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $max_heap, + threshold => [ { label => 'crit_max_heap', 'exit_litteral' => 'critical' }, { label => 'warn_max_heap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Max Heap: %d", $max_heap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Max Heap: %d", $max_heap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $used_heap, - threshold => [ { label => 'crit_used_heap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $used_heap, + threshold => [ { label => 'crit_used_heap', 'exit_litteral' => 'critical' }, { label => 'warn_used_heap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Used Heap: %d", $used_heap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Used Heap: %d", $used_heap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $committed_heap, - threshold => [ { label => 'crit_committed_heap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $committed_heap, + threshold => [ { label => 'crit_committed_heap', 'exit_litteral' => 'critical' }, { label => 'warn_committed_heap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Committed Heap: %d", $committed_heap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Committed Heap: %d", $committed_heap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $init_nonheap, - threshold => [ { label => 'crit_init_nonheap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $init_nonheap, + threshold => [ { label => 'crit_init_nonheap', 'exit_litteral' => 'critical' }, { label => 'warn_init_nonheap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Init NonHeap: %d", $init_nonheap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Init NonHeap: %d", $init_nonheap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $max_nonheap, - threshold => [ { label => 'crit_max_nonheap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $max_nonheap, + threshold => [ { label => 'crit_max_nonheap', 'exit_litteral' => 'critical' }, { label => 'warn_max_nonheap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Max NonHeap: %d", $max_nonheap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Max NonHeap: %d", $max_nonheap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $used_nonheap, - threshold => [ { label => 'crit_used_nonheap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $used_nonheap, + threshold => [ { label => 'crit_used_nonheap', 'exit_litteral' => 'critical' }, { label => 'warn_used_nonheap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Used NonHeap: %d", $used_nonheap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Used NonHeap: %d", $used_nonheap) + ); } - $exit = $self->{perfdata}->threshold_check(value => $committed_nonheap, - threshold => [ { label => 'crit_committed_nonheap', 'exit_litteral' => 'critical' }, + $exit = $self->{perfdata}->threshold_check(value => $committed_nonheap, + threshold => [ { label => 'crit_committed_nonheap', 'exit_litteral' => 'critical' }, { label => 'warn_committed_nonheap', 'exit_litteral' => 'warning' } ]); if ($exit ne "ok"){ - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("Committed NonHeap: %d", $committed_nonheap) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Committed NonHeap: %d", $committed_nonheap) + ); } - $self->{output}->perfdata_add( - label => "init_heap", - value => $init_heap, + $self->{output}->perfdata_add( + label => "init_heap", + value => $init_heap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_heap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_heap'), - ); - $self->{output}->perfdata_add( - label => "max_heap", - value => $max_heap, + ); + $self->{output}->perfdata_add( + label => "max_heap", + value => $max_heap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_heap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_heap'), - ); - $self->{output}->perfdata_add( - label => "used_heap", - value => $used_heap, + ); + $self->{output}->perfdata_add( + label => "used_heap", + value => $used_heap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_heap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_heap'), - ); - $self->{output}->perfdata_add( - label => "committed_heap", - value => $committed_heap, + ); + $self->{output}->perfdata_add( + label => "committed_heap", + value => $committed_heap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_heap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_heap'), - ); - $self->{output}->perfdata_add( - label => "init_nonheap", - value => $init_nonheap, + ); + $self->{output}->perfdata_add( + label => "init_nonheap", + value => $init_nonheap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_init_nonheap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_init_nonheap'), - ); - $self->{output}->perfdata_add( - label => "max_nonheap", - value => $max_nonheap, + ); + $self->{output}->perfdata_add( + label => "max_nonheap", + value => $max_nonheap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_max_nonheap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_max_nonheap'), - ); - $self->{output}->perfdata_add( - label => "used_nonheap", - value => $used_nonheap, + ); + $self->{output}->perfdata_add( + label => "used_nonheap", + value => $used_nonheap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_used_nonheap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_used_nonheap'), - ); - $self->{output}->perfdata_add( - label => "committed_nonheap", - value => $committed_nonheap, + ); + $self->{output}->perfdata_add( + label => "committed_nonheap", + value => $committed_nonheap, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_committed_nonheap'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_committed_nonheap'), - ); + ); - $self->{output}->display(); - $self->{output}->exit(); + $self->{output}->display(); + $self->{output}->exit(); } 1; diff --git a/apps/kingdee/eas/mode/muxhandler.pm b/apps/kingdee/eas/mode/muxhandler.pm index 3451cdfc6..10b6bfd2b 100644 --- a/apps/kingdee/eas/mode/muxhandler.pm +++ b/apps/kingdee/eas/mode/muxhandler.pm @@ -27,25 +27,25 @@ use strict; use warnings; sub new { - my ( $class, %options ) = @_; - my $self = $class->SUPER::new( package => __PACKAGE__, %options ); - bless $self, $class; + my ( $class, %options ) = @_; + my $self = $class->SUPER::new( package => __PACKAGE__, %options ); + bless $self, $class; - $self->{version} = '1.0'; - $options{options}->add_options( - arguments => { - "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmuxhandler.jsp" }, - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - } - ); + $self->{version} = '1.0'; + $options{options}->add_options( + arguments => { + "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkmuxhandler.jsp" }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + } + ); - return $self; + return $self; } sub check_options { - my ( $self, %options ) = @_; - $self->SUPER::init(%options); + my ( $self, %options ) = @_; + $self->SUPER::init(%options); 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} . "'."); @@ -58,37 +58,37 @@ sub check_options { } sub run { - my ( $self, %options ) = @_; + my ( $self, %options ) = @_; my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /MaxThreads=\d+/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'" - ); - $self->{output}->option_exit(); - } + if ($webcontent !~ /MaxThreads=\d+/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find httphandler status in response: '" . $webcontent . "'" + ); + $self->{output}->option_exit(); + } 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 ($maxprocessedtime, $createcount, $destroycount) = (0, 0, 0); - $maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ; - $minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ; - $maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ; - $maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ; - $idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ; - $processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ; - $currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ; - $availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ; - $busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ; - $maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ; - $maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ; - $maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ; - $createcount = $1 if $webcontent =~ /CreateCount=(\d+)/mi ; - $destroycount = $1 if $webcontent =~ /DestroyCount=(\d+)/mi ; - + $maxthreads = $1 if $webcontent =~ /MaxThreads=(\d+)/mi ; + $minsparethreads = $1 if $webcontent =~ /MinSpareThreads=(\d+)/mi ; + $maxsparethreads = $1 if $webcontent =~ /MaxSpareThreads=(\d+)/mi ; + $maxqueuesize = $1 if $webcontent =~ /MaxQueueSize=(\d+)/mi ; + $idletimeout = $1 if $webcontent =~ /IdleTimeout=(\d+)/mi ; + $processedcount = $1 if $webcontent =~ /ProcessedCount=(\d+)/mi ; + $currentthreadcount = $1 if $webcontent =~ /CurrentThreadCount=(\d+)/mi ; + $availablethreadcount = $1 if $webcontent =~ /AvailableThreadCount=(\d+)/mi ; + $busythreadcount = $1 if $webcontent =~ /BusyThreadCount=(\d+)/mi ; + $maxavailablethreadcount = $1 if $webcontent =~ /MaxAvailableThreadCount=(\d+)/mi ; + $maxbusythreadcount = $1 if $webcontent =~ /MaxBusyThreadCount=(\d+)/mi ; + $maxprocessedtime = $1 if $webcontent =~ /MaxProcessedTime=(\d+)/mi ; + $createcount = $1 if $webcontent =~ /CreateCount=(\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("MinSpareThreads: %d", $minsparethreads)); $self->{output}->output_add(severity => "ok", short_msg => sprintf("MaxSpareThreads: %d", $maxsparethreads)); diff --git a/apps/kingdee/eas/mode/oraclejvmgc.pm b/apps/kingdee/eas/mode/oraclejvmgc.pm index 7da8092ab..f86fc8c26 100644 --- a/apps/kingdee/eas/mode/oraclejvmgc.pm +++ b/apps/kingdee/eas/mode/oraclejvmgc.pm @@ -61,14 +61,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ( $webcontent !~ /MinorGCCount=\d+/mi ) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find jvm gc status." - ); - $self->{output}->option_exit(); - } - + if ( $webcontent !~ /MinorGCCount=\d+/mi ) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find jvm gc status." + ); + $self->{output}->option_exit(); + } + 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); diff --git a/apps/kingdee/eas/mode/oracleksqltemptable.pm b/apps/kingdee/eas/mode/oracleksqltemptable.pm index 2f6903413..e797911ca 100644 --- a/apps/kingdee/eas/mode/oracleksqltemptable.pm +++ b/apps/kingdee/eas/mode/oracleksqltemptable.pm @@ -68,14 +68,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /^COUNT.*?=\d+/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find ksql temptable status." - ); - $self->{output}->option_exit(); - } - + if ($webcontent !~ /^COUNT.*?=\d+/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find ksql temptable status." + ); + $self->{output}->option_exit(); + } + my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i; my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [ diff --git a/apps/kingdee/eas/mode/oraclerecyclebin.pm b/apps/kingdee/eas/mode/oraclerecyclebin.pm index 6d87493e9..ab5d8f31d 100644 --- a/apps/kingdee/eas/mode/oraclerecyclebin.pm +++ b/apps/kingdee/eas/mode/oraclerecyclebin.pm @@ -68,14 +68,14 @@ sub run { my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ( $webcontent !~ /^COUNT.*?=\d+/i ) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find oracle recyclebin status." - ); - $self->{output}->option_exit(); - } - + if ( $webcontent !~ /^COUNT.*?=\d+/i ) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find oracle recyclebin status." + ); + $self->{output}->option_exit(); + } + my $count = $1 if $webcontent =~ /^COUNT.*?=(\d+)/i; my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [ diff --git a/apps/kingdee/eas/mode/oracleredolog.pm b/apps/kingdee/eas/mode/oracleredolog.pm index 3a53cb6ab..edff66177 100644 --- a/apps/kingdee/eas/mode/oracleredolog.pm +++ b/apps/kingdee/eas/mode/oracleredolog.pm @@ -2,7 +2,7 @@ # Copyright 2016 Centreon (http://www.centreon.com/) # # 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. # # 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 # distributed under the License is distributed on an "AS IS" BASIS, # 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. # # Author : CHEN JUN , aladdin.china@gmail.com diff --git a/apps/kingdee/eas/mode/oraclesession.pm b/apps/kingdee/eas/mode/oraclesession.pm index 77312ea03..bb86cca0e 100644 --- a/apps/kingdee/eas/mode/oraclesession.pm +++ b/apps/kingdee/eas/mode/oraclesession.pm @@ -2,7 +2,7 @@ # Copyright 2016 Centreon (http://www.centreon.com/) # # 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. # # 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 # distributed under the License is distributed on an "AS IS" BASIS, # 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. # # Author : CHEN JUN , aladdin.china@gmail.com @@ -118,8 +118,8 @@ sub run { $scheduler = $1 if $webcontent =~ /^WAIT_CLASS=Scheduler\sCOUNT=(\d+)/mi; $idle = $1 if $webcontent =~ /^WAIT_CLASS=Idle\sCOUNT=(\d+)/mi; - #cpu and cpuwait - my $cpuandwait = $idle + $network ; + #cpu cpuwait + 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("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("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("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' }, { 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 => "User I/O", unit => '', value => sprintf("%d", $userio)); $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 => '', value => sprintf("%d", $activecount), diff --git a/apps/kingdee/eas/mode/oracletable.pm b/apps/kingdee/eas/mode/oracletable.pm index d1d8f2cd7..b2defa60d 100644 --- a/apps/kingdee/eas/mode/oracletable.pm +++ b/apps/kingdee/eas/mode/oracletable.pm @@ -2,7 +2,7 @@ # Copyright 2016 Centreon (http://www.centreon.com/) # # 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. # # 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 # distributed under the License is distributed on an "AS IS" BASIS, # 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. # # Author : CHEN JUN , aladdin.china@gmail.com diff --git a/apps/kingdee/eas/mode/oracleversion.pm b/apps/kingdee/eas/mode/oracleversion.pm index 0aa1d39ef..6a8a51040 100644 --- a/apps/kingdee/eas/mode/oracleversion.pm +++ b/apps/kingdee/eas/mode/oracleversion.pm @@ -2,7 +2,7 @@ # Copyright 2016 Centreon (http://www.centreon.com/) # # 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. # # 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 # distributed under the License is distributed on an "AS IS" BASIS, # 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. # # Author : CHEN JUN , aladdin.china@gmail.com diff --git a/apps/kingdee/eas/mode/ormrpc.pm b/apps/kingdee/eas/mode/ormrpc.pm index 70efe5419..68689ff65 100644 --- a/apps/kingdee/eas/mode/ormrpc.pm +++ b/apps/kingdee/eas/mode/ormrpc.pm @@ -27,30 +27,30 @@ use strict; use warnings; sub new { - my ( $class, %options ) = @_; - my $self = $class->SUPER::new( package => __PACKAGE__, %options ); - bless $self, $class; + my ( $class, %options ) = @_; + my $self = $class->SUPER::new( package => __PACKAGE__, %options ); + bless $self, $class; - $self->{version} = '1.0'; - $options{options}->add_options( - arguments => { - "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkrpc.jsp" }, - "warning:s" => { name => 'warning' , default => ",,,,,,"}, - "critical:s" => { name => 'critical' , default => ",,,,,,"}, - } - ); + $self->{version} = '1.0'; + $options{options}->add_options( + arguments => { + "urlpath:s" => { name => 'url_path', default => "/easportal/tools/nagios/checkrpc.jsp" }, + "warning:s" => { name => 'warning' , default => ",,,,,,"}, + "critical:s" => { name => 'critical' , default => ",,,,,,"}, + } + ); - return $self; + return $self; } sub check_options { - my ( $self, %options ) = @_; - $self->SUPER::init(%options); + my ( $self, %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}) - = 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}) - = split /,/, $self->{option_results}->{"critical"}; + = split /,/, $self->{option_results}->{"critical"}; # warning if (($self->{perfdata}->threshold_validate(label => 'warn_activethreadcount', value => $self->{warn_activethreadcount})) == 0) { @@ -114,132 +114,132 @@ sub check_options { } sub run { - my ( $self, %options ) = @_; + my ( $self, %options ) = @_; my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /ActiveThreadCount=\d+/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find ormrpc status in response: \'" . $webcontent . "\'" - ); - $self->{output}->option_exit(); - } + if ($webcontent !~ /ActiveThreadCount=\d+/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => "Cannot find ormrpc status in response: \'" . $webcontent . "\'" + ); + $self->{output}->option_exit(); + } 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 ; - $stubcount = $1 if $webcontent =~ /StubCount=(\d+)/mi ; - $proxycount = $1 if $webcontent =~ /ProxyCount=(\d+)/mi ; - $clientsessioncount = $1 if $webcontent =~ /ClientSessionCount=(\d+)/mi ; - $serversessioncount = $1 if $webcontent =~ /ServerSessionCount=(\d+)/mi ; - $invokecountpermin = $1 if $webcontent =~ /ClientInvokeCountPerMinute=(\d+)/mi ; - $servicecountpermin = $1 if $webcontent =~ /ProcessedServiceCountPerMinute=(\d+)/mi ; - $invokecount = $1 if $webcontent =~ /ClientInvokeCount=(\d+)/mi ; - $servicecount = $1 if $webcontent =~ /ProcessedServiceCount=(\d+)/mi ; - - my $exit = $self->{perfdata}->threshold_check(value => $activethreadcount, - threshold => [ { label => 'crit_activethreadcount', 'exit_litteral' => 'critical' }, + $activethreadcount = $1 if $webcontent =~ /ActiveThreadCount=(\d+)/mi ; + $stubcount = $1 if $webcontent =~ /StubCount=(\d+)/mi ; + $proxycount = $1 if $webcontent =~ /ProxyCount=(\d+)/mi ; + $clientsessioncount = $1 if $webcontent =~ /ClientSessionCount=(\d+)/mi ; + $serversessioncount = $1 if $webcontent =~ /ServerSessionCount=(\d+)/mi ; + $invokecountpermin = $1 if $webcontent =~ /ClientInvokeCountPerMinute=(\d+)/mi ; + $servicecountpermin = $1 if $webcontent =~ /ProcessedServiceCountPerMinute=(\d+)/mi ; + $invokecount = $1 if $webcontent =~ /ClientInvokeCount=(\d+)/mi ; + $servicecount = $1 if $webcontent =~ /ProcessedServiceCount=(\d+)/mi ; + + my $exit = $self->{perfdata}->threshold_check(value => $activethreadcount, + threshold => [ { label => 'crit_activethreadcount', 'exit_litteral' => 'critical' }, { label => 'warn_activethreadcount', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("ActiveTrheadCount: %d", $activethreadcount) - ); - $exit = $self->{perfdata}->threshold_check(value => $stubcount, - threshold => [ { label => 'crit_stubcount', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("ActiveTrheadCount: %d", $activethreadcount) + ); + $exit = $self->{perfdata}->threshold_check(value => $stubcount, + threshold => [ { label => 'crit_stubcount', 'exit_litteral' => 'critical' }, { label => 'warn_stubcount', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("StubCount: %d", $stubcount) - ); - $exit = $self->{perfdata}->threshold_check(value => $proxycount, - threshold => [ { label => 'crit_proxycount', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("StubCount: %d", $stubcount) + ); + $exit = $self->{perfdata}->threshold_check(value => $proxycount, + threshold => [ { label => 'crit_proxycount', 'exit_litteral' => 'critical' }, { label => 'warn_proxycount', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("ProxyCount: %d", $proxycount) - ); - $exit = $self->{perfdata}->threshold_check(value => $clientsessioncount, - threshold => [ { label => 'crit_clientsessioncount', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("ProxyCount: %d", $proxycount) + ); + $exit = $self->{perfdata}->threshold_check(value => $clientsessioncount, + threshold => [ { label => 'crit_clientsessioncount', 'exit_litteral' => 'critical' }, { label => 'warn_clientsessioncount', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("ClientSessionCount: %d", $clientsessioncount) - ); - $exit = $self->{perfdata}->threshold_check(value => $serversessioncount, - threshold => [ { label => 'crit_serversessioncount', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("ClientSessionCount: %d", $clientsessioncount) + ); + $exit = $self->{perfdata}->threshold_check(value => $serversessioncount, + threshold => [ { label => 'crit_serversessioncount', 'exit_litteral' => 'critical' }, { label => 'warn_serversessioncount', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("ServerSessionCount: %d", $serversessioncount) - ); - $exit = $self->{perfdata}->threshold_check(value => $invokecountpermin, - threshold => [ { label => 'crit_invokecountpermin', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("ServerSessionCount: %d", $serversessioncount) + ); + $exit = $self->{perfdata}->threshold_check(value => $invokecountpermin, + threshold => [ { label => 'crit_invokecountpermin', 'exit_litteral' => 'critical' }, { label => 'warn_invokecountpermin', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("InvokeCountPerMinute: %d", $invokecountpermin) - ); - $exit = $self->{perfdata}->threshold_check(value => $servicecountpermin, - threshold => [ { label => 'crit_servicecountpermin', 'exit_litteral' => 'critical' }, + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("InvokeCountPerMinute: %d", $invokecountpermin) + ); + $exit = $self->{perfdata}->threshold_check(value => $servicecountpermin, + threshold => [ { label => 'crit_servicecountpermin', 'exit_litteral' => 'critical' }, { label => 'warn_servicecountpermin', 'exit_litteral' => 'warning' } ]); - $self->{output}->output_add( - severity => $exit, - short_msg => sprintf("ServiceCountPerMinute: %d", $servicecountpermin) - ); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("ServiceCountPerMinute: %d", $servicecountpermin) + ); - $self->{output}->perfdata_add( - label => "ActiveTrheadCount", - value => $activethreadcount, + $self->{output}->perfdata_add( + label => "ActiveTrheadCount", + value => $activethreadcount, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_activethreadcount'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_activethreadcount'), - ); - $self->{output}->perfdata_add( - label => "StubCount", - value => $stubcount, + ); + $self->{output}->perfdata_add( + label => "StubCount", + value => $stubcount, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_stubcount'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_stubcount'), - ); - $self->{output}->perfdata_add( - label => "ProxyCount", - value => $proxycount, + ); + $self->{output}->perfdata_add( + label => "ProxyCount", + value => $proxycount, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_proxycount'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_proxycount'), - ); - $self->{output}->perfdata_add( - label => "ClientSessionCount", - value => $clientsessioncount, + ); + $self->{output}->perfdata_add( + label => "ClientSessionCount", + value => $clientsessioncount, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_clientsessioncount'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_clientsessioncount'), - ); - $self->{output}->perfdata_add( - label => "ServerSessionCount", - value => $serversessioncount, + ); + $self->{output}->perfdata_add( + label => "ServerSessionCount", + value => $serversessioncount, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_serversessioncount'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_serversessioncount'), - ); - $self->{output}->perfdata_add( - label => "InvokeCount /min", - value => $invokecountpermin, + ); + $self->{output}->perfdata_add( + label => "InvokeCount /min", + value => $invokecountpermin, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_invokecountpermin'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_invokecountpermin'), - ); - $self->{output}->perfdata_add( - label => "ServiceCount /min", - value => $servicecountpermin, + ); + $self->{output}->perfdata_add( + label => "ServiceCount /min", + value => $servicecountpermin, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_servicecountpermin'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_servicecountpermin'), - ); - $self->{output}->perfdata_add( - label => "c[InvokeCount]", - value => $invokecount, - ); - $self->{output}->perfdata_add( - label => "c[ServiceCount]", - value => $servicecount, - ); - - $self->{output}->display(); - $self->{output}->exit(); + ); + $self->{output}->perfdata_add( + label => "c[InvokeCount]", + value => $invokecount, + ); + $self->{output}->perfdata_add( + label => "c[ServiceCount]", + value => $servicecount, + ); + + $self->{output}->display(); + $self->{output}->exit(); } 1; diff --git a/apps/kingdee/eas/mode/transaction.pm b/apps/kingdee/eas/mode/transaction.pm index 6bb8ad3d7..d964714fb 100644 --- a/apps/kingdee/eas/mode/transaction.pm +++ b/apps/kingdee/eas/mode/transaction.pm @@ -48,9 +48,9 @@ sub check_options { $self->SUPER::init(%options); ($self->{warn_activecount}, $self->{warn_timeoutcount}) - = split /,/, $self->{option_results}->{"warning"}; + = split /,/, $self->{option_results}->{"warning"}; ($self->{crit_activecount}, $self->{crit_timeoutcount}) - = split /,/, $self->{option_results}->{"critical"}; + = split /,/, $self->{option_results}->{"critical"}; # warning if (($self->{perfdata}->threshold_validate(label => 'warn_activecount', value => $self->{warn_activecount})) == 0) { @@ -76,23 +76,23 @@ sub run { my ($self, %options) = @_; my $webcontent = $options{custom}->request(path => $self->{option_results}->{url_path}); - if ($webcontent !~ /TransactionCount=\d+/i) { - $self->{output}->output_add( - severity => 'UNKNOWN', - short_msg => "Cannot find transaction status." - ); - } + if ($webcontent !~ /TransactionCount=\d+/i) { + $self->{output}->output_add( + severity => 'UNKNOWN', + 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; - $totaltransactiontime = $1 if $webcontent =~ /TotalTransactionTime=(\d+)\s/i; - $committedcount = $1 if $webcontent =~ /CommittedCount=(\d+)\s/i; - $rolledbackcount = $1 if $webcontent =~ /RolledbackCount=(\d+)\s/i; - $activecount = $1 if $webcontent =~ /ActiveCount=(\d+)\s/i; - $maxtransactiontime = $1 if $webcontent =~ /MaxTransactionTime=(\d+)\s/i; - $defaulttimeout = $1 if $webcontent =~ /DefaultTimeout=(\d+)\s/i; - $timeoutcount = $1 if $webcontent =~ /TimedOutCount=(\d+)\s/i; + $transactioncount = $1 if $webcontent =~ /TransactionCount=(\d+)\s/i; + $totaltransactiontime = $1 if $webcontent =~ /TotalTransactionTime=(\d+)\s/i; + $committedcount = $1 if $webcontent =~ /CommittedCount=(\d+)\s/i; + $rolledbackcount = $1 if $webcontent =~ /RolledbackCount=(\d+)\s/i; + $activecount = $1 if $webcontent =~ /ActiveCount=(\d+)\s/i; + $maxtransactiontime = $1 if $webcontent =~ /MaxTransactionTime=(\d+)\s/i; + $defaulttimeout = $1 if $webcontent =~ /DefaultTimeout=(\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' }, { label => 'warn_activecount', exit_litteral => 'warning' } ]);