
Hi Hans,
Could you post the script that you are using (remove thecredentials), maybe we can help you extend the script to export the additional fields?
Joon
Hi
Today I have a Python script for exporting devices in to a csv-file with the following fields:
device_name,device_ips,device_groups,log_collection_policies,distributed_collector,confidentiality,integrity,availability,timezone
Does a script exist that also extract the additional fiels:
uses_proxy , proxy_ip , hostname
This will make moving devices from LogPoint 5 to LogPoint 6 considerably more easy.
Regards
Hans
Share This Post:
Hi Hans,
Could you post the script that you are using (remove thecredentials), maybe we can help you extend the script to export the additional fields?
Joon
Hi Joon
It is a scrip created by LogPoint, and requires cli access to the LogPoint server.
It is executed using:
/opt/immune/bin/envdo python "file_name"
Regards
Hans
Hello @HansHenrikMoerkholt ,
I upgraded your script to be python3 compatible and added the proxy config to the CSV:
Thanks for the input.
apparently something goes wrong.
Errors generated when running script attached with some info anonymized.
Regards
Hans
Hello @HansHenrikMoerkholt , which logpoint version are you using?
I’ve tested it on 6.11.2.
This is used on LogPoint 5.6.4, where we are using it for extracting infomation to prepare for migrating to most current LogPoint version.
Regards
Hans
Hello @HansHenrikMoerkholt ,
okay, this version is old :)
Try to add this line in the import section at the top of the file:
from mongokit import ObjectId
This actually did the trick - Thank you very much for the help!!!
Export file generated with desired info.
Regards
Hans
Hi,
this is older but I have a question regarding the following three lines/statements from the script:
device_groups = str(';'.join([db.dereference(device_group)["name"]
for device_group in device["device_groups"]])) log_collection_policies = str(';'.join([db.dereference(lcp)["name"] for lcp in device["log_policies"]]))
distributed_collector =
str(';'.join([db.dereference(DBRef('distributedcollector', ObjectId(dc), MONGODB_DATABASE))["name"]
for dc in device["distributed_collector"]]))
The first to “lines” just use “db.dereference()” for getting the related data, the third “line” uses a more complex way. Is this necessary or would it be sufficient to also just use “db.dereference()” (I have no dsitributed collector in my test environment, otherwise I would have tested it myself ;-) ).
Best regards, Reinhard
(unfortunately I couldn’t manage it to display just one indented code block here)
Please sign in to leave a comment.
9 comments