Skip to content

Commit

Permalink
Merge pull request #17 from watchdogcloud/dev
Browse files Browse the repository at this point in the history
feat: mail RFT success
  • Loading branch information
zakhaev26 authored Jul 16, 2024
2 parents aa6d7ab + 297b717 commit 5baae8b
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 69 deletions.
2 changes: 1 addition & 1 deletion alert.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cpu":{"spiked":true,"averagingAt":93.30524570755037,"thresholdSet":70,"time":"2024-07-16T16:52:44.083Z"},"mem":{"spiked":false,"averagingAt":58.24963651548677,"thresholdSet":80,"time":"2024-07-16T16:52:44.083Z"},"disk":{"spiked":false,"averagingAt":46.47777947406973,"thresholdSet":90,"time":"2024-07-16T16:52:44.083Z"}}
{"cpu":{"spiked":true,"averagingAt":93.30524570755037,"thresholdSet":70,"time":"2024-07-16T21:16:19.060Z"},"mem":{"spiked":false,"averagingAt":58.24963651548677,"thresholdSet":80,"time":"2024-07-16T21:16:19.060Z"},"disk":{"spiked":false,"averagingAt":46.47777947406973,"thresholdSet":90,"time":"2024-07-16T21:16:19.060Z"}}
File renamed without changes.
35 changes: 35 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.8'

services:
zookeeper:
image: zookeeper:latest
ports:
- "2181:2181"

kafka:
image: confluentinc/cp-kafka:latest
ports:
- "9092:9092"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://172.30.144.1:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
depends_on:
- zookeeper

kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
- kafka
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
KAFKA_CLUSTERS_0_NAME: wizard_test
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092

redis:
image: redis/redis-stack-server:latest
ports:
- "6379:6379"
12 changes: 12 additions & 0 deletions docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,15 @@ services:
image: redis/redis-stack-server:latest
ports:
- "6379:6379"

terrier:
build:
context: .
dockerfile: Dockerfile

ports:
- 3030:3030
depends_on:
- zookeeper
- kafka
- redis
1 change: 1 addition & 0 deletions documents/alert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cpu":{"spiked":true,"averagingAt":93.30524570755037,"thresholdSet":70,"time":"2024-07-16T16:52:44.083Z"},"mem":{"spiked":false,"averagingAt":58.24963651548677,"thresholdSet":80,"time":"2024-07-16T16:52:44.083Z"},"disk":{"spiked":false,"averagingAt":46.47777947406973,"thresholdSet":90,"time":"2024-07-16T16:52:44.083Z"}}
1 change: 1 addition & 0 deletions documents/deleteme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"system.metrics.processor"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"system.metrics.processor"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"system.metrics.processor"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"critical.alerts.handler"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"critical.alerts.handler"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"critical.alerts.handler"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"database.inserter"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"database.inserter"}],[{"consumer":{"events":{"HEARTBEAT":"consumer.heartbeat","COMMIT_OFFSETS":"consumer.commit_offsets","GROUP_JOIN":"consumer.group_join","FETCH":"consumer.fetch","FETCH_START":"consumer.fetch_start","START_BATCH_PROCESS":"consumer.start_batch_process","END_BATCH_PROCESS":"consumer.end_batch_process","CONNECT":"consumer.connect","DISCONNECT":"consumer.disconnect","STOP":"consumer.stop","CRASH":"consumer.crash","REBALANCING":"consumer.rebalancing","RECEIVED_UNSUBSCRIBED_TOPICS":"consumer.received_unsubscribed_topics","REQUEST":"consumer.network.request","REQUEST_TIMEOUT":"consumer.network.request_timeout","REQUEST_QUEUE_SIZE":"consumer.network.request_queue_size"}},"groupId":"database.inserter"}]]
1 change: 1 addition & 0 deletions documents/met.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cpu":"6696a55ceee2824c1a4eb621","disk":"6696a55ceee2824c1a4eb622","mem":"6696a55ceee2824c1a4eb623","network":["6696a55ceee2824c1a4eb624","6696a55ceee2824c1a4eb625","6696a55ceee2824c1a4eb626","6696a55ceee2824c1a4eb627","6696a55ceee2824c1a4eb628","6696a55ceee2824c1a4eb629","6696a55ceee2824c1a4eb62a","6696a55ceee2824c1a4eb62b","6696a55ceee2824c1a4eb62c","6696a55ceee2824c1a4eb62d","6696a55ceee2824c1a4eb62e","6696a55ceee2824c1a4eb62f","6696a55ceee2824c1a4eb630","6696a55ceee2824c1a4eb631"],"user":"66943b0ea2f63e2dd189f8fd","project":"6694c578785da7f95346d185","callNumber":117}
2 changes: 1 addition & 1 deletion met.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cpu":"6696a55ceee2824c1a4eb621","disk":"6696a55ceee2824c1a4eb622","mem":"6696a55ceee2824c1a4eb623","network":["6696a55ceee2824c1a4eb624","6696a55ceee2824c1a4eb625","6696a55ceee2824c1a4eb626","6696a55ceee2824c1a4eb627","6696a55ceee2824c1a4eb628","6696a55ceee2824c1a4eb629","6696a55ceee2824c1a4eb62a","6696a55ceee2824c1a4eb62b","6696a55ceee2824c1a4eb62c","6696a55ceee2824c1a4eb62d","6696a55ceee2824c1a4eb62e","6696a55ceee2824c1a4eb62f","6696a55ceee2824c1a4eb630","6696a55ceee2824c1a4eb631"],"user":"66943b0ea2f63e2dd189f8fd","project":"6694c578785da7f95346d185","callNumber":117}
{"cpu":"6696e323d509637b002dec76","disk":"6696e323d509637b002dec77","mem":"6696e323d509637b002dec78","network":["6696e323d509637b002dec79","6696e323d509637b002dec7a","6696e323d509637b002dec7b","6696e323d509637b002dec7c","6696e323d509637b002dec7d","6696e323d509637b002dec7e","6696e323d509637b002dec7f","6696e323d509637b002dec80","6696e323d509637b002dec81","6696e323d509637b002dec82","6696e323d509637b002dec83","6696e323d509637b002dec84","6696e323d509637b002dec85","6696e323d509637b002dec86"],"user":"66943b0ea2f63e2dd189f8fd","project":"6694c578785da7f95346d185","callNumber":122}
135 changes: 68 additions & 67 deletions src/templ-generator/alerts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,78 +15,79 @@ import LocaleEnum from '../../constants/locales-support';
*/

const en = `<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Reset Your Password on Fiole</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: 0 auto;
background-color: #ffffff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header {
text-align: center;
padding-bottom: 20px;
}
.header img {
max-width: 100px;
}
.content {
text-align: center;
}
.otp {
font-size: 24px;
font-weight: bold;
margin: 20px 0;
}
.footer {
text-align: center;
color: #888;
font-size: 12px;
margin-top: 20px;
}
</style>
<meta charset="UTF-8">
<title>Alert Notification</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: #111;
margin: 0;
padding: 0;
color: #fff;
}
.container {
max-width: 600px;
margin: 20px auto;
background-color: #1a1a1a;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.header {
background-color: #000;
color: #fff;
padding: 10px;
text-align: center;
border-radius: 8px 8px 0 0;
}
.content {
padding: 20px;
}
.content p {
margin: 0 0 15px;
}
.footer {
text-align: center;
padding: 10px;
font-size: 12px;
color: #888;
}
.button {
background-color: #007bff;
color: #fff;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
border-radius: 5px;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Reset Your Password</h1>
</div>
<div class="content">
<p>Hi {{username }},</p>
<p>We received a request to reset your password for your Fiole account. Please use the following OTP to reset your
password:</p>
<div class="otp">{{otp}}</div>
<p>This OTP is valid for the next {{ expiration }} minutes. Please do not share this OTP with anyone.</p>
<p>If you did not request a password reset, please ignore this email or contact our support team for assistance.
</p>
<div class="container">
<div class="header">
<h1>WatchdogCloud Alert</h1>
</div>
<div class="content">
<p>Dear recipient,</p>
<p>This is to notify you that the <strong>{{ component }}</strong> has exceeded the defined threshold.</p>
<p><strong>Alert Type:</strong> {{ alertType }}</p>
<p><strong>Component:</strong> {{ component }}</p>
<p><strong>Value:</strong> {{ cumulativeOrSpikeVal }}</p>
<p><strong>Threshold:</strong> {{ threshold }}</p>
<p><strong>Incident Time:</strong> {{ incidentTime }}</p>
<p>Please take the necessary actions to resolve this issue.</p>
<p>Sent from WatchdogCloud.</p>
<a href="https://your-action-link.com" class="button">Take Action</a>
</div>
<div class="footer">
<p>&copy; {{ "now"|date("Y") }} WatchdogCloud - A Free Software.</p>
</div>
</div>
<div class="footer">
<p>Thanks,<br>The Fiole Team</p>
<p>Note: This is an automated email. Please do not reply to this email.</p>
</div>
</div>
</body>
</html>`;


Expand Down

0 comments on commit 5baae8b

Please sign in to comment.