Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshtool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
awing-public
sshtool
Commits
812a7175
Commit
812a7175
authored
Jun 23, 2022
by
Mr Phong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add error log
parent
8f02e3ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
app.py
app.py
+5
-4
No files found.
app.py
View file @
812a7175
...
@@ -50,11 +50,12 @@ with open(log_file, 'a') as file_output:
...
@@ -50,11 +50,12 @@ with open(log_file, 'a') as file_output:
sys
.
stdout
=
file_output
sys
.
stdout
=
file_output
for
index
,
row
in
df_host
.
iterrows
():
for
index
,
row
in
df_host
.
iterrows
():
logger
.
info
(
"Connect to site "
+
str
(
row
[
'name'
])
+
" with host "
+
str
(
row
[
'host'
]))
site_name
=
str
(
row
[
'name'
])
if
(
str
(
row
[
'name'
])
==
''
):
logger
.
info
(
"Connect to site "
+
site_name
+
" with host "
+
str
(
row
[
'host'
]))
if
(
site_name
==
''
):
row
[
"session_log"
]
=
output_dir
+
str
(
index
)
+
'.txt'
row
[
"session_log"
]
=
output_dir
+
str
(
index
)
+
'.txt'
else
:
else
:
row
[
"session_log"
]
=
output_dir
+
s
tr
(
row
[
'name'
])
+
'.txt'
row
[
"session_log"
]
=
output_dir
+
s
ite_name
+
'.txt'
row
=
row
.
drop
(
labels
=
[
'name'
])
row
=
row
.
drop
(
labels
=
[
'name'
])
if
(
str
(
row
[
"device_type"
]).
strip
()
==
"autodetect"
):
if
(
str
(
row
[
"device_type"
]).
strip
()
==
"autodetect"
):
guesser
=
SSHDetect
(
**
row
)
guesser
=
SSHDetect
(
**
row
)
...
@@ -66,7 +67,7 @@ with open(log_file, 'a') as file_output:
...
@@ -66,7 +67,7 @@ with open(log_file, 'a') as file_output:
logger
.
info
(
"Connect to host : "
+
str
(
row
[
'host'
])
+
" success !"
)
logger
.
info
(
"Connect to host : "
+
str
(
row
[
'host'
])
+
" success !"
)
run_commands
(
device_connect
,
df_command
)
run_commands
(
device_connect
,
df_command
)
except
Exception
as
ex
:
except
Exception
as
ex
:
logger
.
error
(
"ERROR when execute command with device "
+
str
(
row
[
"host"
]))
logger
.
error
(
"ERROR when execute command
in site "
+
site_name
+
"
with device "
+
str
(
row
[
"host"
]))
logger
.
error
(
ex
)
logger
.
error
(
ex
)
sys
.
stdout
.
close
()
sys
.
stdout
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment