Skip to content

Commit 5fb68e0

Browse files
committed
update with remote connection
1 parent ef5330b commit 5fb68e0

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,14 @@ from nodescraper.plugins.inband.bios.bios_plugin import BiosPlugin
393393
from nodescraper.plugins.inband.bios.analyzer_args import BiosAnalyzerArgs
394394
from nodescraper.plugins.inband.kernel.kernel_plugin import KernelPlugin
395395
from nodescraper.plugins.inband.kernel.analyzer_args import KernelAnalyzerArgs
396+
from nodescraper.plugins.inband.os.os_plugin import OsPlugin
397+
from nodescraper.plugins.inband.os.analyzer_args import OsAnalyzerArgs
396398
from nodescraper.pluginregistry import PluginRegistry
397399
from nodescraper.models.systeminfo import SystemInfo, OSFamily
398-
from nodescraper.enums import EventPriority
400+
from nodescraper.enums import EventPriority, SystemLocation
399401
from nodescraper.resultcollators.tablesummary import TableSummary
402+
from nodescraper.connection.inband.inbandmanager import InBandConnectionManager
403+
from nodescraper.connection.inband.sshparams import SSHConnectionParams
400404

401405
def main():
402406

@@ -446,6 +450,18 @@ def main():
446450
table_summary = TableSummary()
447451
table_summary.collate_results(all_res, None)
448452

453+
#remote connection
454+
system_info.location=SystemLocation.REMOTE
455+
ssh_params = SSHConnectionParams(hostname="my_system",
456+
port=22,
457+
username="my_username",
458+
key_filename="/home/user/.ssh/ssh_key")
459+
conn_manager = InBandConnectionManager(system_info=system_info, connection_args=ssh_params)
460+
os_plugin = OsPlugin(system_info=system_info, logger=logger, connection_manager=conn_manager)
461+
os_plugin.run(analysis_args=OsAnalyzerArgs(exp_os="DEF"))
462+
463+
464+
449465
if __name__ == "__main__":
450466
main()
451467
```

nodescraper/connection/inband/inbandmanager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def connect(
120120
return self.result
121121

122122
try:
123-
self.logger.info("Initializing SSH connection to system")
123+
self.logger.info(
124+
"Initializing SSH connection to system '%s'", self.connection_args.hostname
125+
)
124126
self.connection = RemoteShell(self.connection_args)
125127
self.connection.connect_ssh()
126128
self._check_os_family()

0 commit comments

Comments
 (0)