Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compose.libre.sh
Manage
Activity
Members
Labels
Plan
Issues
18
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libre.sh
compose.libre.sh
Commits
51dcdcda
Commit
51dcdcda
authored
4 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
Adds a basic mail monitoring.
parent
f10a5ead
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
unit-files/mail-mon.service
+3
-0
3 additions, 0 deletions
unit-files/mail-mon.service
unit-files/mail-mon.timer
+9
-0
9 additions, 0 deletions
unit-files/mail-mon.timer
utils/mail-mon.sh
+3
-0
3 additions, 0 deletions
utils/mail-mon.sh
with
15 additions
and
0 deletions
unit-files/mail-mon.service
0 → 100644
+
3
−
0
View file @
51dcdcda
[Service]
Type
=
oneshot
ExecStart
=
/libre.sh/utils/mail-mon.sh
This diff is collapsed.
Click to expand it.
unit-files/mail-mon.timer
0 → 100644
+
9
−
0
View file @
51dcdcda
[Unit]
Description=Run mail mon hourly and on boot
[Timer]
OnBootSec=15min
OnUnitActiveSec=1h
[Install]
WantedBy=timers.target
This diff is collapsed.
Click to expand it.
utils/mail-mon.sh
0 → 100644
+
3
−
0
View file @
51dcdcda
#!/bin/bash -eux
/usr/bin/journalctl
--since
'1 hour ago'
|
grep
postfix/cleanup |
grep
"from="
|
sed
-n
's/.*from=<\(.*\)> to=<\(.*\)> pro.*/\1/p'
|
sort
|uniq
-c
|
sort
|
awk
'BEGIN {FS=" ";} {printf "mail_sent{domain_name=\"%s\"} %s\n", $2, $1}'
>
/system/metrics-collection/textfiles/mail.prom
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment