Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
docker_health_check
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
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jithu.tagore
docker_health_check
Commits
ede74353
Commit
ede74353
authored
Nov 15, 2022
by
jithu.tagore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update infra_as_service_monitor.py
parent
77d2d32d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
infra_as_service_monitor.py
infra_as_service_monitor.py
+8
-20
No files found.
infra_as_service_monitor.py
View file @
ede74353
...
...
@@ -369,24 +369,24 @@ def mail_send():
except
Exception
as
e
:
print
(
f
"Unable to connect to that broker {str(e)}"
)
if
len
(
service_table
)
>
0
and
len
(
disk_table
)
>
0
and
len
(
ram_table
)
>
0
:
html
=
html_top_section
+
service_section
+
disk_section
+
ram_section
+
html_end
if
len
(
service_table
)
>
0
and
len
(
disk_table
)
>
0
and
len
(
ram_table
)
>
0
and
len
(
container_restart
)
>
0
:
html
=
html_top_section
+
service_section
+
d
ocker_container
+
d
isk_section
+
ram_section
+
html_end
if
mqtt
==
"True"
:
client1
.
publish
(
mqtt_topic
,
"{}"
)
if
telegram
==
"True"
:
telegram_bot_sendtext
(
f
"<b>{env} {config['user_info']['subject']} </b>
\n
Last Restarted at : {restart_time}({count_of_restart})
\n
IP:{ip_address}
\n
Environment:{env}
\n\n
<b>Service Status</b>
\n
<pre>{tabular_table}</pre>
\n
<b>Disk Usage</b>
\n
<pre>{Disk_usage_table}</pre>
\n
<b>Ram Usage</b>
\n
<pre>{Ram_usage_table}</pre>"
)
elif
len
(
service_table
)
>
0
and
len
(
disk_table
)
>
0
:
html
=
html_top_section
+
service_section
+
disk_section
+
html_end
elif
len
(
service_table
)
>
0
and
len
(
disk_table
)
>
0
and
len
(
container_restart
)
>
0
:
html
=
html_top_section
+
service_section
+
d
ocker_container
+
d
isk_section
+
html_end
if
mqtt
==
"True"
:
client1
.
publish
(
mqtt_topic
,
"{}"
)
if
telegram
==
"True"
:
telegram_bot_sendtext
(
f
"<b>{env} {config['user_info']['subject']} </b>
\n
Last Restarted at : {restart_time}({count_of_restart})
\n
IP:{ip_address}
\n
Environment:{env}
\n\n
<b>Service Status</b>
\n
<pre>{tabular_table}</pre>
\n
<b>Disk Usage</b>
\n
<pre>{Disk_usage_table}</pre>"
)
elif
len
(
service_table
)
>
0
and
len
(
ram_table
)
>
0
:
html
=
html_top_section
+
service_section
+
ram_section
+
html_end
elif
len
(
service_table
)
>
0
and
len
(
ram_table
)
>
0
and
len
(
container_restart
)
>
0
:
html
=
html_top_section
+
service_section
+
docker_container
+
ram_section
+
html_end
if
mqtt
==
"True"
:
client1
.
publish
(
mqtt_topic
,
"{}"
)
if
telegram
==
"True"
:
...
...
@@ -401,25 +401,13 @@ def mail_send():
telegram_bot_sendtext
(
f
"<b>{env} {config['user_info']['subject']} </b>
\n
Last Restarted at : {restart_time}({count_of_restart})
\n
IP:{ip_address}
\n
Environment:{env}
\n\n
<b>Disk Usage</b>
\n
<pre>{Disk_usage_table}</pre>
\n
<b>Ram Usage</b>
\n
<pre>{Ram_usage_table}</pre>"
)
elif
len
(
service_table
)
>
0
:
elif
len
(
service_table
)
>
0
and
and
len
(
container_restart
)
>
0
:
if
mqtt
==
"True"
:
client1
.
publish
(
mqtt_topic
,
"{}"
)
if
telegram
==
"True"
:
telegram_bot_sendtext
(
f
"<b>{env} {config['user_info']['subject']}</b>
\n
Last Restarted at : {restart_time}({count_of_restart})
\n
IP:{ip_address}
\n
Environment:{env}
\n\n
<b>Ram Usage</b>
\n
<pre>{tabular_table}</pre>"
)
html
=
html_top_section
+
service_section
+
html_end
elif
len
(
container_restart
)
>
0
and
len
(
disk_table
)
>
0
and
len
(
ram_table
)
>
0
:
print
(
"container_restart,ram_table and disk_table"
)
html
=
html_top_section
+
docker_container
+
disk_section
+
ram_section
+
html_end
elif
len
(
container_restart
)
>
0
and
len
(
disk_table
)
>
0
:
print
(
"container_restart and disk_table"
)
html
=
html_top_section
+
docker_container
+
disk_section
+
html_end
elif
len
(
container_restart
)
>
0
and
len
(
ram_table
)
>
0
:
print
(
"container_restart and ram_table"
)
html
=
html_top_section
+
docker_container
+
ram_section
+
html_end
elif
len
(
container_restart
)
>
0
:
print
(
"container_restart"
)
html
=
html_top_section
+
docker_container
+
html_end
html
=
html_top_section
+
service_section
+
docker_container
+
html_end
elif
len
(
disk_table
)
>
0
:
print
(
"disk html"
)
if
mqtt
==
"True"
:
...
...
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