-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path03.alarma.txt
More file actions
46 lines (35 loc) · 767 Bytes
/
03.alarma.txt
File metadata and controls
46 lines (35 loc) · 767 Bytes
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
#!/bin/sh
set -e
MAILTO="root"
MAILFROM="check"
UNIT=$1
ps_output=$(/bin/ps -ewwo vsz,user,uid,tt,start,s,ruser,ruid,rsz,psr,pri,ppid,pid,pcpu,ni,min_flt,maj_flt,cmd)
df_output=$(df)
df_i_output=$(df -i)
vmstat_output=$(/usr/bin/vmstat)
vmstat_s_output=$(/usr/bin/vmstat -s)
vmstat_d_output=$(/usr/bin/vmstat -d)
vmstat_D_output=$(/usr/bin/vmstat -D)
netstat_output=$(/bin/netstat -putana)
/usr/bin/mail -s "Alarm for unit: $UNIT" $MAILTO <<SEFINI
From:$MAILFROM
To:$MAILTO
Alarm for unit: $UNIT
PS Output:
$ps_output
DF Output:
$df_output
DF -i Output:
$df_i_output
VMSTAT Output:
$vmstat_output
VMSTAT -s Output:
$vmstat_s_output
VMSTAT -d Output:
$vmstat_d_output
VMSTAT -D Output:
$vmstat_D_output
NETSTAT -putana Output:
$netstat_output
SEFINI
exit 0