print_event_repository_status.py
The
print_event_repository_status.py script displays the statuses
of the
mongod
servers in the
Event Repository
replica set and displays the available data storage sizes.
Syntax
print_event_repository_status.py --host serverName|ipAddress --port portNumber [-u username] [[interval] [count]] [--version] [-v] [--uri=full_MongoDB_uri] [--srv] [--eventDatabase TenantDatabaseName] [--authDatabase AuthenticationDatabaseName] [-h]
Options
The print_event_repository_status.py script has the following options:
- interval
- The interval to wait before running the script (repeating the command) again. The interval is a number in seconds. The full interval is the number in seconds (specified) plus the command runtime.
- count
- The number of times to run the script (repeat the command) in succession. If you specify an interval without specifying a count, the script repeats the command indefinitely.
- -u username, --user=username
- Specify the MongoDB user to log in as.
- -v, --verbose
- Runs the script in verbose mode and returns more details as standard output.
- --uri
- The full URI for the MongoDB or MongoDB Atlas database. If the username or password
has any special characters, they must be URI-encoded, for example, if the password has
an @ character, it must be in the URI as %40. If the URI has an ampersand (&), the
& must be escaped (preceded by a backslash (\&)) or the full URI must be inside
quotes, for
example:
uri=mongodb+srv://cluster0.8n9ep.mongodb.net/MtxEventDatabase?retryWrites=true\&option=value uri="http://host/path?var1=val1&var2=val2"
- --srv
- If this parameter is specified, an SRV-based URI is generated for a MongoDB Atlas database. If this parameter is not specified, a regular MongoDB database URI is generated.
- --version
- Show the program version number.
- --host=serverName|ipAddress
- The MongoDB server to connect to. This option specifies the host name or IP address of a
machine on which one of the
mongod
instances in your replica set is running. Connecting to a machine on which your primarymongod
is running is recommended. - --port
- The MongoDB server port to connect to. Specify this option only if the port is not the default (27017).
- --eventDatabase
- (Optional) The name of the tenant database. Specify this option as needed for tenant repository queries. The default value is
MtxEventDatabase
. If you specify a URI, and the event database is notMtxEventDatabase
, you must specify the--eventDatabase
option. - --authDatabase
- (Optional) The name of the database to be used for the authentication in the MongoDB URI. The default value is
admin
. - -h, --help
- Show help about the script options.
Examples
This example displays the statuses of the mongod
servers in the replica set and the available data storage sizes every 5 seconds (interval option value). The
example does this three times (count option value). This example output is for a sharded MongoDB deployment:
print_event_repository_status.py --user MtxAdmin 5 3
=======================================================================
print_event_repository_status.py started on 2016-03-17 17:17:39
=======================================================================
The config server replica set is named 'MtxConfigReplSet':
- mongod server on 192.168.1.1:27019 is PRIMARY
Last started 2016-06-02T23:04:39+00:00. Last optime 2016-06-13T22:46:45. Storage available 284G(82%).
- mongod server on 192.168.1.2:27019 is SECONDARY
Last started 2016-06-02T22:47:05+00:00. Replication delay 0:00:00. Storage available 301G(87%).
- mongod server on 192.168.1.3:27019 is SECONDARY
Last started 2016-06-02T23:14:49+00:00. Replication delay 0:00:00. Storage available 309G(90%).
This database has 3 shards.
Shard 1 replica set is named 'MtxEventReplSet_1':
- mongod server on 192.168.1.11:27018 is PRIMARY
Last started 2016-06-02T22:19:41+00:00. Last optime 2016-06-13T22:46:25. Storage available 301G(87%).
- mongod server on 192.168.1.12:27018 is SECONDARY
Last started 2016-06-02T22:19:41+00:00. Replication delay 0:00:00. Storage available 301G(87%).
- mongod server on 192.168.1.13:27018 is SECONDARY
Last started 2016-06-02T23:13:30+00:00. Replication delay 0:00:00. Storage available 309G(90%).
Shard 2 replica set is named 'MtxEventReplSet_2':
- mongod server on 192.168.1.21:27018 is PRIMARY
Last started 2016-06-02T22:19:41+00:00. Last optime 2016-06-13T22:46:25. Storage available 301G(87%).
- mongod server on 192.168.1.22:27018 is SECONDARY
Last started 2016-06-02T23:13:30+00:00. Replication delay 0:00:00. Storage available 309G(90%).
- mongod server on 192.168.1.23:27018 is SECONDARY
Last started 2016-06-02T23:13:30+00:00. Replication delay 0:00:00. Storage available 309G(90%).
Shard 3 replica set is named 'MtxEventReplSet_3':
- mongod server on 192.168.1.31:27018 is PRIMARY
Last started 2016-06-02T23:13:30+00:00. Last optime 2016-06-13T22:46:25. Storage available 309G(90%).
- mongod server on 192.168.1.32:27018 is SECONDARY
Last started 2016-06-02T23:13:30+00:00. Replication delay 0:00:00. Storage available 309G(90%).
- mongod server on 192.168.1.33:27018 is SECONDARY
Last started 2016-06-02T23:13:30+00:00. Replication delay 0:00:00. Storage available 309G(90%).