jmx4perl/it/check_jmx4perl/checks.cfg
2017-10-31 14:38:28 +01:00

195 lines
4.3 KiB
INI

# Include base configuration
include base.cfg
# ==================================================================
# Various parameterized checks
<Check outer_arg>
Use = memory_heap
Critical = 90
Label = $0 $BASE (Warning: %.2y, Critical: %.2z)
</Check>
# ==================================================================
# Predefined Checks
# Heap Memory
<Check memory_heap>
Use = base_memory_relative
Value = java.lang:type=Memory/HeapMemoryUsage/used
Base = java.lang:type=Memory/HeapMemoryUsage/max
Name = Heap Memory ${0:default_name}
Label = Heap-Memory: $BASE
</Check>
<Check memory_heap2>
Use = base_memory_relative
MBean = java.lang:type=Memory
Attribute = HeapMemoryUsage
Path = used
BaseMBean = java.lang:type=Memory
BaseAttribute = HeapMemoryUsage
BasePath = max
Name = Heap Memory ${0:default_name}
Label = Heap-Memory: $BASE
</Check>
<Check memory_heap_with_label>
Value = java.lang:type=Memory/HeapMemoryUsage/used
Name = $1
Label = $0
Critical = 1:
</Check>
# Perm Gen Memory (used for class definitions)
<Check memory_non_heap>
Use = base_memory_relative($0,$1)
Value = java.lang:type=Memory/NonHeapMemoryUsage/used
Base = java.lang:type=Memory/HeapMemoryUsage/max
Label = NonHeap Memory: $BASE
</Check>
# ===============================================
# Thread count
<Check thread_count>
Value = java.lang:type=Threading/ThreadCount
Name = ${0} $1 $2
Label = "thread_count: $0 $1 $2 : Value %f in range"
Critical = ${0}
Warning = $1
Method = POST
</Check>
<Check invalid_method>
Value = java.lang:type=Threading/ThreadCount
Name = $0 $1 $2
Critical = $0
Warning = $1
Method = Bla
</Check>
# Child
<Check def_placeholder_1>
Use thread_count(,2)
</Check>
<Check def_placeholder_2>
Use thread_count(${0},2)
</Check>
<Check def_placeholder_3>
Use thread_count
</Check>
# =========================================================
# Operation checks
<Check overloaded_operation>
MBean = jolokia.it:type=operation
Operation = overloadedMethod(java.lang.String)
Argument = ${0}
Critical = 5
Warning = :1
</Check>
# =========================================================
# Bug specific checks
# MBean with '#'
<Check hash_check>
MBean = jolokia/it:pid=[ServiceRegistryProvider\#(null)],type=ParticipantMonitor,id=*
Attribute = Ok
String = 1
Label = ServiceRegistryProvider is running
Name = Running
Critical = !OK
</Check>
# Scripting check
<Check script_check>
Script <<EOT
my $pools = $j4p->search("java.lang:type=MemoryPool,*");
my @matched_pools;
my $pattern = "${0}";
for my $pool (@$pools) {
push @matched_pools,$pool if $pool =~ /$pattern/;
}
return $j4p->get_attribute($matched_pools[0],"Usage","used");
EOT
Name script_check $0
Critical ${1:10}
Unit B
</Check>
<MultiCheck script_multi_check>
Check memory_heap(90,80)
Check script_check('Eden|Java',1000000000)
Check memory_non_heap(90,80)
Check script_check($0,1000000000)
Check thread_count(1000,2000,3000)
</MultiCheck>
# Double values below a threshold
<Check double_min>
Name = double_min
MBean = jolokia.it:type=attribute
Attribute = DoubleValueMin
Critical = 1
Warning = 2
</Check>
<Check double_max>
Name = double_max
MBean = jolokia.it:type=attribute
Attribute = DoubleValueMax
Critical = 1
Warning = 2
</Check>
<Check with_name>
Use = thread_count
Critical = $1
Name = $0
</Check>
<Check without_threshold>
Use = thread_count
</Check>
# =================================
# #81699
# Find deadlocked Threads
<Check thread_deadlock>
MBean = java.lang:type=Threading
Operation = findDeadlockedThreads
Null = no deadlock
Name = Thread-Deadlock
String = 1
Critical = !no deadlock
</Check>
<Check counter_operation>
MBean jolokia.it:type=operation
Operation fetchNumber
Argument ${0:inc}
Critical 3
Warning 2
</Check>
# 75062
<Check memory_without_perfdata>
Use = base_memory_relative($0,$1)
Value = java.lang:type=Memory/HeapMemoryUsage/used
Base = java.lang:type=Memory/HeapMemoryUsage/max
Name = Heap Memory ${0:default_name}
Label = Heap-Memory: $BASE
PerfData = ${2:No}
</Check>
<Check memory_with_perfdata>
Use = memory_without_perfdata(90,80,'yes')
</Check>