This section provides example configuration for collecting datasource statistics.
Edit your commands.cfg and add the following
define command { command_name check_jboss_datasource command_line $USER1$/nagios-plugin-jbossas7/check_jbossas7.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$ -s $ARG6$ -W $ARG7$ -C $ARG8$ }
(add -D to the command if you want to add perfdata to the output) Then you can reference it like the following.
Provides active connections used by applications or available in the pool.
define service { use generic-service hostgroup_name JBossAS Servers service_description JBossAS Server Datasource active connection count check_command check_jboss_datasource!datasource!9990!admin!password123!ds_name!ActiveCount }
If you want to override the default thresholds for WARNING and CRITICAL; configure as follows; where 10 is WARNING threshold while 20 is CRITICAL threshold.
define service { use generic-service hostgroup_name JBossAS Servers service_description JBossAS Server Datasource active connection count check_command check_jboss_datasource!datasource!9990!admin!password123!ds_name!ActiveCount!10!20 }
The average time spent blocking for a connection.
define service { use generic-service hostgroup_name JBossAS Servers service_description JBossAS Server Datasource average blocking time check_command check_jboss_datasource!datasource!9990!admin!password123!ds_name!AverageBlockingTime }
define service { use generic-service hostgroup_name JBossAS Servers service_description JBossAS Server Datasource active connection count check_command check_jboss_datasource!xa_datasource!9990!admin!password123!ds_name!ActiveCount }
In addition to above examples; following statistics are also supported for both xa and non-xa datasources:
Metric Type | Description | Unit |
---|---|---|
ActiveCount |
The number of active connections. Each of the connections is either in use by an application or available in the pool. |
- |
AvailableCount |
TThe number of available connections in the pool |
- |
AverageBlockingTime |
The average time spent blocking on obtaining an exclusive lock on the pool. |
milliseconds |
AverageCreationTime |
The average time spent creating a connection. |
milliseconds |
CreatedCount |
The number of connections created |
- |
DestroyedCount |
The number of connections destroyed |
- |
MaxCreationTime |
The maximum time it took to create a connection. |
milliseconds |
MaxUsedCount |
The maximum number of connections used |
- |
MaxWaitTime |
The maximum time spent waiting for an exclusive lock on the pool |
milliseconds |
TimedOut |
The number of timed out connections |
milliseconds |
TotalBlockingTime |
The total time spent waiting for an exclusive lock on the pool. |
milliseconds |
TotalCreationTime |
The total time spent creating connections. |
milliseconds |