I upgraded check_mk from 1.6.p24 to 2.0.0p6. One of our own plugins check_jboss6 crash with message: Exception: IndexError (list index out of range)
Crash-ID: ae16745a-ed14-11eb-8fcb-0050569f9548
The same plugin is working fine with 1.6.p24 version. Please assist. Please find below the check plugin and the agent output:
#------------------------------------------------------------------------------
THIS MODULE IS MAINTAINED BY PUPPET !!
#------------------------------------------------------------------------------
factory_settings[âcheck_jboss6_default_levelsâ] = {
âavailconnâ: (80.0, 95.0), # percentage connections in use
}
#------------------------------------------------------------------------------
Inventory function
#------------------------------------------------------------------------------
def inventory_jboss6 (info):
inventory = []
for line in info:
instance = line[0]
port = line[1]
app = line[2]
ds = line[2]
stat = line[2]
metric = line[3]
queue = line[3]
if âserverStateâ in stat:
my_inventory = instance + â serverStateâ
inventory.append( (my_inventory, None) )
if âhttpConnectorStatâ in stat:
my_inventory = instance + â httpConnectorâ
inventory.append( (my_inventory, None) )
if âajpConnectorStatâ in stat:
my_inventory = instance + â ajpConnectorâ
inventory.append( (my_inventory, None) )
if âactiveSessionsâ in metric:
my_inventory = instance + â Sessions â + app
inventory.append( (my_inventory, None) )
if âeJBâ in metric:
my_inventory = instance + â EnterpriseJavaBean â + app
inventory.append( (my_inventory, None) )
if âDataSourceâ in metric:
my_inventory = instance + â DataSource â + ds
inventory.append( (my_inventory, None) )
if âJMSâ in stat:
my_inventory = instance + â JMS â + queue
inventory.append( (my_inventory, None) )
return inventory
#------------------------------------------------------------------------------
Check function
#------------------------------------------------------------------------------
def check_jboss6 (item, params, info):
for line in info:
instance = line[0]
port = line[1]
app = line[2]
ds = line[2]
stat = line[2]
metric = line[3]
queue = line[3]
rc = 0
if 'serverState' in item and instance in item:
if not 'running' in metric:
return (1, metric)
else:
return (0, metric)
if 'EnterpriseJavaBean' in item and metric == 'eJB' and instance in item:
rc = 0
peakConcurrentInvocations = int(line[4])
waitTimewaitTime = int(line[5])
executionTime = int(line[6])
invocations = int(line[7])
message = str(peakConcurrentInvocations) + " peakConcurrentInvocations, " + \
str(waitTimewaitTime) + " waitTimewaitTime, " + \
str(executionTime) + " executionTime, " + \
str(invocations) + " invocations"
return (rc, message, [
( "peakConcurrentInvocations", peakConcurrentInvocations ),
( "waitTimewaitTime", waitTimewaitTime ),
( "executionTime", executionTime ),
( "invocations", invocations ),
])
elif 'Sessions' in item and metric == 'activeSessions' and app in item and instance in item:
activeSessions = int(line[4])
maxActiveSessions = int(line[5])
expiredSessions = int(line[6])
rejectedSessions = int(line[7])
message = str(activeSessions) + " activeSessions, " + \
str(maxActiveSessions) + " maxActiveSessions, " + \
str(expiredSessions) + " expiredSessions, " + \
str(rejectedSessions) + " rejectedSessions"
return (rc, message, [
( "activeSessions", activeSessions ),
( "maxActiveSessions", maxActiveSessions ),
( "expiredSessions", expiredSessions ),
( "rejectedSessions", rejectedSessions ),
])
elif 'DataSource' in item and metric == 'DataSourceStats' and ds in item and instance in item:
ActiveCount = int(line[4])
AvailableCount = int(line[5])
AverageBlockingTime = int(line[6])
AverageCreationTime = int(line[7])
CreatedCount = int(line[8])
DestroyedCount = int(line[9])
InUseCount = int(line[10])
MaxCreationTime = int(line[11])
MaxUsedCount = int(line[12])
MaxWaitCount = int(line[13])
MaxWaitTime = int(line[14])
TimedOut = int(line[15])
TotalBlockingTime = int(line[16])
TotalCreationTime = int(line[17])
ds_thresh = params.get("availconn")
if ds_thresh == None: # no levels
warn, crit = 80.0, 95.0
else:
warn, crit = ds_thresh
inUsePercent = 1;
alertMessage = ''
if AvailableCount == 0 and InUseCount == 0:
rc = 0
elif AvailableCount == 0 and InUseCount > 0:
rc = 2
alertMessage = ' (Alert for no available datasource connections)'
else:
rc = 0
if TimedOut == 999:
rc = 2
lertMessage = ' (Alert for unavailable datasource)'
message = "ActiveCount: " + str(ActiveCount) + \
" AvailableCount: " + str(AvailableCount) + \
" AverageBlockingTime: " + str(AverageBlockingTime) + \
" AverageCreationTime: " + str(AverageCreationTime) + \
" CreatedCount: " + str(CreatedCount) + \
" DestroyedCount: " + str(DestroyedCount) + \
" InUseCount: " + str(InUseCount) + \
" MaxCreationTime: " + str(MaxCreationTime) + \
" MaxUsedCount: " + str(MaxUsedCount) + \
" TimedOut: " + str(TimedOut) + \
" TotalBlockingTime: " + str(TotalBlockingTime) + \
" TotalCreationTime: " + str(TotalCreationTime) + \
" " + alertMessage
return (rc, message, [
( "ActiveCount", ActiveCount ),
( "AvailableCount", AvailableCount ),
( "AverageBlockingTime", AverageBlockingTime ),
( "AverageCreationTime", AverageCreationTime ),
( "CreatedCount", CreatedCount ),
( "DestroyedCount", DestroyedCount ),
( "InUseCount", InUseCount ),
( "MaxCreationTime", MaxCreationTime ),
( "MaxUsedCount", MaxUsedCount ),
( "TimedOut", TimedOut ),
( "TotalBlockingTime", TotalBlockingTime ),
( "TotalCreationTime", TotalCreationTime ),
])
elif 'httpConnector' in item and stat == 'httpConnectorStat' and instance in item:
BytesReceived = int(line[3])
BytesSent = int(line[4])
message = str(BytesReceived) + " BytesReceived, " + \
str(BytesSent) + " BytesSent"
return (rc, message, [
( "BytesReceived", BytesReceived ),
( "BytesSent", BytesSent ),
])
elif 'ajpConnector' in item and stat == 'ajpConnectorStat' and instance in item:
BytesReceived = int(line[3])
BytesSent = int(line[4])
message = str(BytesReceived) + " BytesReceived, " + \
str(BytesSent) + " BytesSent"
return (rc, message, [
( "BytesReceived", BytesReceived ),
( "BytesSent", BytesSent ),
])
elif 'JMS' in item and 'DLQ' in item:
dlq_messageCount = int(line[5])
consumerCount = int(line[6])
messagesAdded = int(line[7])
scheduledCount = int(line[8])
message = str(dlq_messageCount) + " Messages in DLQ"
if dlq_messageCount > 0:
rc = 1
else:
rc = 0
return (rc, message, [
( "DLQ Message Count", dlq_messageCount ),
( "Consumer Count", consumerCount ),
( "Messages Added", messagesAdded ),
( "Scheduled Count", scheduledCount ),
])
elif 'JMS' in item and 'ExpiryQueue' in item:
ExpiryQueue_messageCount = int(line[5])
consumerCount = int(line[6])
messagesAdded = int(line[7])
scheduledCount = int(line[8])
message = str(ExpiryQueue_messageCount) + " Messages in Queue"
if ExpiryQueue_messageCount > 0:
rc = 1
else:
rc = 0
return (rc, message, [
( "ExpiryQueue Message Count", ExpiryQueue_messageCount ),
( "Consumer Count", consumerCount ),
( "Messages Added", messagesAdded ),
( "Scheduled Count", scheduledCount ),
])
#------------------------------------------------------------------------------
Check parameters
#------------------------------------------------------------------------------
check_info[âcheck_jboss6â] = {
âcheck_functionâ : check_jboss6,
âinventory_functionâ : inventory_jboss6,
âservice_descriptionâ : âJVM %sâ,
âhas_perfdataâ : True,
âgroupâ : âcheck_jboss6â,
âdefault_levels_variableâ : 'check
############################################################################
<<<check_jboss6>>>
jboss 8080 serverState running
jboss 8080 JMS ExpiryQueue message-count 0 0 0 0
jboss 8080 JMS DLQ message-count 0 0 0 0
jboss 8080 is-bhrg-v2-ear.ear/wus/isbhrg-v2.0 activeSessions -1 0 0 0
jboss 8080 is-bhrg-v2-ear.ear/BhrgLogicBean eJB 0 0 0 0
jboss 8080 is-gar-ear.ear/wus/isgar-v1.0 activeSessions -1 0 0 0
jboss 8080 is-gar-ear.ear/GarLogicBean eJB 0 0 0 0
jboss 8080 is-bhrg-v2-validation-ear.ear/validation/bhrg-v2.0 activeSessions -1 0 0 0
jboss 8080 is-bhrg-v2-validation-ear.ear/BhrgValidationBean eJB 0 0 0 0
jboss 8080 is-gar-validation-ear.ear/validation/gar activeSessions -1 0 0 0
jboss 8080 is-gar-validation-ear.ear/GarValidationBean eJB 0 0 0 0
jboss 8080 is-bhrgt-v1-ear.ear/wus/isbhrgt-v1.0 activeSessions -1 0 0 0
jboss 8080 is-bhrgt-v1-ear.ear/BhrGtLogicBean eJB 0 0 0 0
jboss 8080 is-gld-ear.ear/wus/isgld-v1.0 activeSessions -1 0 0 0
jboss 8080 is-gld-ear.ear/GldLogicBean eJB 0 0 0 0
jboss 8080 is-bhrgt-v1-validation-ear.ear/validation/bhrgt activeSessions -1 0 0 0
jboss 8080 is-bhrgt-v1-validation-ear.ear/BhrGtValidationBean eJB 0 0 0 0
jboss 8080 is-gld-validation-ear.ear/validation/gld activeSessions -1 0 0 0
jboss 8080 is-gld-validation-ear.ear/GldValidationBean eJB 0 0 0 0
jboss 8080 is-bhrgt-v2-1-ear.ear/wus/isbhrgt-v2.1 activeSessions -1 0 0 0
jboss 8080 is-bhrgt-v2-1-ear.ear/BhrGtLogicBean eJB 0 0 0 0
jboss 8080 is-gmn-ear.ear/wus/isgmn-v1.0 activeSessions -1 0 0 0
jboss 8080 is-gmn-ear.ear/GmnLogicBean eJB 0 0 0 0
jboss 8080 is-bhrgt-v2-1-validation-ear.ear/validation/bhrgt-v2.1 activeSessions -1 0 0 0
jboss 8080 is-bhrgt-v2-1-validation-ear.ear/BhrGtValidationBean eJB 0 0 0 0
jboss 8080 is-gmn-validation-ear.ear/validation/gmn activeSessions -1 0 0 0
jboss 8080 is-gmn-validation-ear.ear/GmnValidationBean eJB 0 0 0 0
jboss 8080 is-bhrp-v2-ear.ear/wus/isbhrp-v2.0 activeSessions -1 0 0 0
jboss 8080 is-bhrp-v2-ear.ear/BhrLogicBean eJB 0 0 0 0
jboss 8080 is-gmw-ear.ear/wus/isgmw-v1.1 activeSessions -1 0 0 0
jboss 8080 is-gmw-ear.ear/GmwLogicBean eJB 0 0 0 0
jboss 8080 is-bhrp-v2-validation-ear.ear/validation/bhrp-v2.0 activeSessions -1 0 0 0
jboss 8080 is-bhrp-v2-validation-ear.ear/BhrValidationBean eJB 0 0 0 0
jboss 8080 is-gmw-validation-ear.ear/validation/gmw activeSessions -1 0 0 0
jboss 8080 is-gmw-validation-ear.ear/GmwValidationBean eJB 0 0 0 0
jboss 8080 is-cpt-ear.ear/wus/iscpt-v1.1 activeSessions -1 0 0 0
jboss 8080 is-cpt-ear.ear/CptLogicBean eJB 0 0 0 0
jboss 8080 is-sfr-v2-ear.ear/wus/issfr-v2.0 activeSessions -1 0 0 0
jboss 8080 is-sfr-v2-ear.ear/SfrLogicBean eJB 0 0 0 0
jboss 8080 is-cpt-validation-ear.ear/validation/cpt activeSessions -1 0 0 0
jboss 8080 is-cpt-validation-ear.ear/CptValidationBean eJB 0 0 0 0
jboss 8080 is-sfr-v2-validation-ear.ear/validation/sfr-v2 activeSessions -1 0 0 0
jboss 8080 is-sfr-v2-validation-ear.ear/SfrValidationBean eJB 0 0 0 0
jboss 8080 BroRealmDS DataSourceStats 0 20 0 80 2 2 0 98 1 0 0 2 0 161
jboss 8080 ExampleDS DataSourceStats 0 0 0 0 0 0 0 0 0 0 0 0 0 0
jboss 8080 BroDS DataSourceStats 0 50 1 79 27 27 0 197 5 0 1 27 4 2134