-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrucksack.yml.example
52 lines (51 loc) · 1.45 KB
/
rucksack.yml.example
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
---
rucksack-config:
log-level: debug
log-file: .rucksack.log
system:
get-uptime:
command: uptime
performance:
get-basic-info:
command: "uptime && echo && free -h && echo && df -h"
tail-log:
command: "tail {{ log_file }}"
args:
- num_lines:
arg_string: -n {{ num_lines }}
- log_file:
mandatory: True
default: /var/log/syslog
values:
- /var/log/syslog
- /var/log/kern.log
- /var/log/auth.log
disk-usage:
get-largest-files:
command: du -h -d {{ depth }} {{ directory }} 2>/dev/null | sort -hr | head -n 10
args:
- depth:
mandatory: True
- directory:
mandatory: True
values:
- /
- /home
- /var
nginx:
check-config:
command: nginx -t 2>&1
reload:
command: 'sudo kill -HUP $(sudo pidof nginx)'
get-top-5-ips:
command: "sudo cat {{ log_file }} 2>/dev/null | cut -f 1 -d ' ' | sort | uniq -c | sort -hr | head -n 5"
args:
- log_file:
mandatory: True
from_command: "sudo find /var/log/nginx -name '*access.log*' | grep -v '.gz'"
get-top-5-verbs:
command: cat {{ log_file }} | grep -o '].*' | cut -f 2 -d ' ' | tr -d '"' | sort | uniq -c | sort -hr | head -n 5
args:
- log_file:
mandatory: True
from_command: "sudo find /var/log/nginx -name '*access.log*' | grep -v '.gz'"