db2 - db2 database information

Parsers included in this module are:

Db2ls - command db2ls -a -c

Db2DatabaseConfiguration - Command /usr/sbin/runuser -l  <user name>  -c 'db2 get database configuration for %s'

Db2DatabaseManager - Command /usr/sbin/runuser -l  <user name>  -c 'db2 get dbm cfg'

class insights.parsers.db2.Db2DatabaseConfiguration(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Parse the output of the /usr/sbin/runuser -l  <user name>  -c 'db2 get database configuration for %s' command.

default

the database configuration details

Type:

dict

Sample Input:

       Database Configuration for Database TESTD1

Database configuration release level                    = 0x1500
Database release level                                  = 0x1500

Update to database level pending                        = NO (0x0)
Database territory                                      = US
Database code page                                      = 1208

Examples

>>> db2databaseconfiguration["Database configuration release level"]
'0x1500'
>>> db2databaseconfiguration["user"]
'dbp'
parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.db2.Db2DatabaseManager(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Parse the output of the /usr/sbin/runuser -l  <user name>  -c 'db2 get dbm cfg' command.

default

the database management details

Type:

dict

Sample Input:

      Database Manager Configuration

Node type = Enterprise Server Edition with local and remote clients

Database manager configuration release level            = 0x1500

CPU speed (millisec/instruction)             (CPUSPEED) = 3.306409e-07
Communications bandwidth (MB/sec)      (COMM_BANDWIDTH) = 1.000000e+02

Max number of concurrently active databases     (NUMDB) = 32
Federated Database System Support           (FEDERATED) = NO

Examples

>>> db2databasemanager["Max number of concurrently active databases     (NUMDB)"]
'32'
>>> db2databasemanager["user"]
'dbp'
parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.db2.Db2ls(context, extra_bad_lines=None)[source]

Bases: CommandParser, list

Parse the output of db2ls -a -c into a list of dictionaries.

Typical output of this command:

#PATH:VRMF:FIXPACK:SPECIAL:INSTALLTIME:INSTALLERUID
/opt/ibm/db2/V11.5:11.5.6.0:0 ::Fri Jan 14 20:20:07 2022 CST :0
/opt/ibm/db2/V11.5_01:11.5.7.0:0 ::Fri Feb 11 10:34:51 2022 CST :0

Examples

>>> type(db2ls)
<class 'insights.parsers.db2.Db2ls'>
>>> len(db2ls)
2
>>> db2ls[0]['PATH']
'/opt/ibm/db2/V11.5'
>>> db2ls[1]['PATH']
'/opt/ibm/db2/V11.5_01'
>>> db2ls[1]['VRMF']
'11.5.7.0'
>>> db2ls[1]['INSTALLERUID']
'0'
parse_content(content)[source]

This method must be implemented by classes based on this class.