-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_stats_collector.conf
48 lines (43 loc) · 2.76 KB
/
server_stats_collector.conf
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
# Number of seconds the script should pause collecting data
update-interval: 15
# The data-model is a list of key-command pairs, the key is any name and the
# command is a shell command that returns a specific value or the entire
# contents of a file.
data-model:
# MEMORY STATISTICS
Mem_Info = cat /proc/meminfo
Mem_Total = grep 'MemTotal:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Free = grep 'MemFree:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Available = grep 'MemAvailable:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Buffers = grep 'Buffers:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Cached = grep 'Cached:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_SwapCached = grep 'SwapCached:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Active = grep 'Active:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Inactive = grep 'Inactive:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_SwapFree = grep 'SwapFree:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Dirty = grep 'Dirty:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Writeback = grep 'Writeback:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_AnonPages = grep 'AnonPages:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
Mem_Mapped = grep 'Mapped:' /proc/meminfo | grep -o -E "[0-9]*\s[a-zA-Z]*$"
# CPU STATISTICS
Total_UsermodeProcesses = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +3 | head -n 1
Total_UsermodePrioritized = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +4 | head -n 1
Total_KernelmodeProcesses = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +5 | head -n 1
Total_IdleProcesses = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +6 | head -n 1
Total_IOWaitingProcesses = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +7 | head -n 1
Total_HardIRQInterrupts = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +8 | head -n 1
Total_SoftIRQInterrupts = cat /proc/stat | head -n 1 | tr " " "\n" | tail -n +9 | head -n 1
Current_RunningProcesess = grep 'procs_running' /proc/stat | tail -c +14
Current_WaitingProcesses = grep 'procs_blocked' /proc/stat | tail -c +14
Total_ContextSwitches = grep 'ctxt' /proc/stat | tail -c +4
# AVERAGE LOAD STATISTICS
LoadAvg_Per1Minute = cat /proc/loadavg | tr " " "\n" | head -n 1
LoadAvg_Per5Minutes = cat /proc/loadavg | tr " " "\n" | head -n +2 | tail -n 1
LoadAvg_Per15Minutes = cat /proc/loadavg | tr " " "\n" | head -n +3 | tail -n 1
Current_KernelSchedulingEntities = cat /proc/loadavg | grep -o -E '[0-9]*\/' | tr -d '/'
Total_KernelSchedulingEntities = cat /proc/loadavg | grep -o -E '\/[0-9]*' | tr -d '/'
# SECURITY INFO
ACL_RootDir = getfacl -R /root/*
ACL_HomeDir = getfacl -R /home/*
PasswdFile = lsattr /etc/passwd && getfacl /etc/passwd
GroupFile = lsattr /etc/group && getfacl /etc/group