Skip to content

Commit 2def517

Browse files
authored
chore: additional ceph collector commands (#1450)
* Collect text representations of the ceph data which are easier to read * Collect ceph df command output
1 parent fe6b1c7 commit 2def517

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

pkg/collect/ceph.go

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,25 @@ var CephCommands = []CephCommand{
3535
Format: "json",
3636
DefaultTimeout: "30s",
3737
},
38+
{
39+
ID: "status-txt",
40+
Command: []string{"ceph", "status"},
41+
Format: "txt",
42+
DefaultTimeout: "30s",
43+
},
3844
{
3945
ID: "fs",
4046
Command: []string{"ceph", "fs", "status"},
4147
Args: []string{"-f", "json-pretty"},
4248
Format: "json",
4349
DefaultTimeout: "30s",
4450
},
51+
{
52+
ID: "fs-txt",
53+
Command: []string{"ceph", "fs", "status"},
54+
Format: "txt",
55+
DefaultTimeout: "30s",
56+
},
4557
{
4658
ID: "fs-ls",
4759
Command: []string{"ceph", "fs", "ls"},
@@ -53,7 +65,7 @@ var CephCommands = []CephCommand{
5365
ID: "osd-status",
5466
Command: []string{"ceph", "osd", "status"},
5567
Args: []string{"-f", "json-pretty"},
56-
Format: "txt",
68+
Format: "json",
5769
DefaultTimeout: "30s",
5870
},
5971
{
@@ -88,15 +100,17 @@ var CephCommands = []CephCommand{
88100
ID: "rgw-stats", // the disk usage (and other stats) of each object store bucket
89101
Command: []string{"radosgw-admin", "bucket", "stats"},
90102
Args: []string{"--rgw-cache-enabled=false"},
91-
Format: "txt",
103+
Format: "json",
92104
DefaultTimeout: "30s", // include a default timeout because this command will hang if the RGW daemon isn't running/is unhealthy
93105
},
94106
{
95-
ID: "rbd-du", // the disk usage of each PVC
96-
Command: []string{"rbd", "du"},
97-
Args: []string{"--pool=replicapool"},
98-
Format: "txt",
99-
DefaultTimeout: "30s",
107+
ID: "rbd-du-txt", // the disk usage of each PVC
108+
Command: []string{"rbd", "du"},
109+
Args: []string{"--pool=replicapool"},
110+
Format: "txt",
111+
// On ceph clusters with a lot of data, this command can take a long time to run
112+
// especially if fast-diff rbd_default_features is disabled
113+
DefaultTimeout: "60s",
100114
},
101115
{
102116
ID: "df", // the disk usage of each pool
@@ -105,13 +119,25 @@ var CephCommands = []CephCommand{
105119
Format: "json",
106120
DefaultTimeout: "30s",
107121
},
122+
{
123+
ID: "df-txt", // the disk usage of each pool
124+
Command: []string{"ceph", "df"},
125+
Format: "txt",
126+
DefaultTimeout: "30s",
127+
},
108128
{
109129
ID: "osd-df",
110130
Command: []string{"ceph", "osd", "df"},
111131
Args: []string{"-f", "json-pretty"},
112132
Format: "json",
113133
DefaultTimeout: "30s",
114134
},
135+
{
136+
ID: "osd-df-txt",
137+
Command: []string{"ceph", "osd", "df"},
138+
Format: "txt",
139+
DefaultTimeout: "30s",
140+
},
115141
}
116142

117143
type CollectCeph struct {

0 commit comments

Comments
 (0)