-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathses
executable file
·101 lines (81 loc) · 3.14 KB
/
ses
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
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for SUSE Enterprise Storage
# Description: Gathers important troubleshooting information
# about SUSE Enterprise Storage
# License: GPLv2
# Author: Tim Serong <[email protected]>
# Modified: 2015-02-13
#############################################################
SVER=1.0.0
RCFILE="/usr/lib/supportconfig/resources/scplugin.rc"
LOG_LINES=5000 # 0 means include the entire file
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
# Helper functions liberated from Matt Barringer's supportutils-plugin-susecloud
validate_rpm_if_installed() {
thisrpm="$1"
echo "#==[ Validating RPM ]=================================#"
if rpm -q "$thisrpm" >/dev/null 2>&1; then
echo "# rpm -V $thisrpm"
if rpm -V "$thisrpm"; then
echo "Status: Passed"
else
echo "Status: WARNING"
fi
else
echo "package $thisrpm is not installed"
echo "Status: Skipped"
fi
echo
}
#############################################################
section_header "Supportconfig Plugin for SUSE Enterprise Storage, v${SVER}"
rpm_list=/usr/lib/supportconfig/resources/ses-rpm-list
for thisrpm in $(cat "$rpm_list"); do
validate_rpm_if_installed "$thisrpm"
done
#############################################################
section_header "Ceph cluster status"
if [ -x /usr/bin/ceph ]; then
# timeout status commands after 5 seconds
CT=5
plugin_command "ceph --connect-timeout=$CT -s"
plugin_command "ceph --connect-timeout=$CT mon dump"
plugin_command "ceph --connect-timeout=$CT osd tree"
# `ceph report` does actually include the above information, but
# in JSON format. Since adding `ceph report`, the above commands
# remain, because their output is easier to read in a hurry ;)
plugin_command "ceph --connect-timeout=$CT report"
plugin_command "timeout $CT rados df"
plugin_command "timeout $CT rbd ls"
fi
#############################################################
section_header "Ceph config"
if [ -d /etc/ceph ]; then
if files=$(find /etc/ceph -type f | egrep -v '.keyring$'); then
if [ -n "$files" ]; then
pconf_files $files
fi
fi
fi
#############################################################
section_header "Ceph log files"
plog_files $LOG_LINES /var/log/ceph/*.log
#############################################################
section_header "Radosgw log files"
plog_files $LOG_LINES /var/log/ceph-radosgw/*.log
#############################################################
section_header "Calamari log files"
plog_files $LOG_LINES /var/log/calamari/*.log
#############################################################
section_header "Salt config"
if [ -d /etc/salt ]; then
if files=$(find /etc/salt -type f | egrep -v '.pem$'); then
if [ -n "$files" ]; then
pconf_files $files
fi
fi
fi
#############################################################
section_header "Salt log files"
plog_files $LOG_LINES /var/log/salt/{master,minion}