forked from happycodinguk/telegram-system-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem-inst.txt
90 lines (53 loc) · 2.44 KB
/
system-inst.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
read -e -p "
----------------------------------------
## System Service Failure Installer! ###
----------------------------------------
Which SYSTEMD services do you want to monitor (space separated)?
If you receive incorrect service failure messages...
Check your service names are correct and those services are actually installed on your system! System service names vary on different OS's
You can edit services later in: $inspath/system-warnings.sh
Samples services below by OS:
Debian:
apache2 php7.3-fpm php7.4-fpm php8.0-fpm bind9 postfix dovecot mariadb proftpd spamassassin ssh
CentOS:
httpd named postfix dovecot mariadb proftpd spamassassin sshd
Which do you want to monitor?:" services_to_monitor
echo "
Thank You!
I've stored: $services_to_monitor
- This can be altered in the script files in your installation directory"
read -e -p "
-------------------------------------------------------
After receiving alert message for SYSTEMD WARNING how long do you want to wait before receiving another systemd alarm?
Enter your amount in seconds.
DEFAULT 600 (600 is 5 mins)
You can re re-enter later in the script stystem-warning.sh
How many seconds?:" sys_reset_timing
: ${sys_reset_timing:=600}
echo "
Thank You!
I've stored: $sys_reset_timing seconds
----------------------------------------
#### Installed service status below ####
----------------------------------------"
# Inserts install choices into files!
# Inserts service choices into the monitor system-warnings.sh
sed -i 's|"SERVICES_TO_MONITOR"|'"$services_to_monitor"'|g' system-warnings.sh
# Insert your timings
sed -i 's|"YOUR_RESET_TIMING"|'"$sys_reset_timing"'|g' system-warnings.sh
# Inserts chosen install directory into sytemd service
sed -i 's|"YOUR_INSTALL_DIR"|'"$inspath"'|g' system-warn-tgm.service
sed -i 's|"YOUR_INSTALL_DIR"|'"$inspath"'|g' system-warnings.sh
### Move downloaded files to your chosen directory ##################
mv -i system-warnings.sh /$inspath
### Move Systemd files into system folder ##########################
mv -i system-warn-tgm.service /etc/systemd/system/
### Setting file permissions ########################################
chmod 700 /$inspath/system-warnings.sh
chmod 644 /etc/systemd/system/system-warn-tgm.service
# Setting Up SYSTEMD Job for system alarms!
systemctl enable system-warn-tgm.service
# Reload systemd
systemctl daemon-reload
systemctl start system-warn-tgm.service
systemctl status --no-pager system-warn-tgm.service