Satellite MongoDB Commands

Parsers included in this module are:

MongoDBStorageEngine - command mongo pulp_database --eval 'db.serverStatus().storageEngine'

MongoDBNonYumTypeRepos - command mongo pulp_database --eval 'db.repo_importers.find({"importer_type_id": { $ne: "yum_importer"}}).count()'

class insights.parsers.satellite_mongodb.MongoDBNonYumTypeRepos(context, extra_bad_lines=None)[source]

Bases: CommandParser

Read the mongo pulp_database --eval 'db.repo_importers.find({"importer_type_id": { $ne: "yum_importer"}}).count()' command and save the count to attribute named count.

Sample Output:

MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/pulp_database
MongoDB server version: 3.4.9
0

Examples:

>>> type(satellite_non_yum_type_repos)
<class 'insights.parsers.satellite_mongodb.MongoDBNonYumTypeRepos'>
>>> satellite_non_yum_type_repos.count
0

Attributes:

count (int): The count of non-yum type repos in pulp_database

Raises:

SkipComponent: When the output isn't in exptected format
parse_content(content)[source]

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

class insights.parsers.satellite_mongodb.MongoDBStorageEngine(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Read the mongo pulp_database --eval 'db.serverStatus().storageEngine' command and save the storage engine attributes to a dict.

Sample Output:

MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/pulp_database
MongoDB server version: 3.4.9
{
        "name" : "wiredTiger",
        "supportsCommittedReads" : true,
        "readOnly" : false,
        "persistent" : true
}

Examples:

>>> type(satellite_storage_engine)
<class 'insights.parsers.satellite_mongodb.MongoDBStorageEngine'>
>>> satellite_storage_engine['name']
'wiredTiger'

Raises:

SkipComponent: When there is no attribute in the output
ParseException: When the storage engine attributes aren't in expected format
parse_content(content)[source]

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