-
Notifications
You must be signed in to change notification settings - Fork 397
-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include client summary (mloginfo --clients) #540
Comments
Agreed! How about a param import os
import sys
drivers = {}
check = True
file = sys.argv[1]
exists = os.path.isfile(file)
if exists:
with open(file, 'rt') as myfile:
for line in myfile:
if line.lower().find("driver:") != -1:
check = False
if "mgo" not in line:
value_ip = line.split('metadata from ')[1].split(':', 1)[0]
version = line.split('version: "')[1].split('" },', 1)[0]
name = line.split('name: "')[1].split('"', 1)[0]
key_name_version = "|" + name + "|" + version + "|"
if key_name_version not in drivers:
drivers[key_name_version] = [value_ip]
elif key_name_version in drivers:
if value_ip in drivers.get(key_name_version):
continue
else:
drivers[key_name_version].append(value_ip)
if "mgo" in line:
value_ip = line.split('metadata from ')[1].split(':', 1)[0]
key_name_version = "|mgo|globalsign|"
if key_name_version not in drivers:
drivers[key_name_version] = [value_ip]
elif key_name_version in drivers:
if value_ip in drivers.get(key_name_version):
continue
else:
drivers[key_name_version].append(value_ip)
if check == True:
print("No driver information found")
else:
print("|Driver|Version|Source IP|")
print("|------|-------|---------|")
for key, value in sorted(drivers.items()):
print(key, str(value).replace("]", "|").replace("'","").replace("[",""))
else:
print("File not found") |
I think a It probably makes sense to add it as a section file, similar to connection_section.py. Incidentally, that file also contains an example of how to use @niccottrell Would you be willing to open a PR for this? |
I have added a pull request: #690 |
Logs contain a line:
It would be good to have this OS and client information summarized as an option in mloginfo.
The text was updated successfully, but these errors were encountered: