ACIL FM
Dark
Refresh
Current DIR:
/lib/python3.9/site-packages/sos/collector/clusters
/
lib
python3.9
site-packages
sos
collector
clusters
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
ceph.py
2.35 MB
chmod
View
DL
Edit
Rename
Delete
jbon.py
1.14 MB
chmod
View
DL
Edit
Rename
Delete
juju.py
8.44 MB
chmod
View
DL
Edit
Rename
Delete
kubernetes.py
1.81 MB
chmod
View
DL
Edit
Rename
Delete
ocp.py
16.04 MB
chmod
View
DL
Edit
Rename
Delete
openstack.py
2.77 MB
chmod
View
DL
Edit
Rename
Delete
ovirt.py
7.99 MB
chmod
View
DL
Edit
Rename
Delete
pacemaker.py
3.81 MB
chmod
View
DL
Edit
Rename
Delete
saltstack.py
3.11 MB
chmod
View
DL
Edit
Rename
Delete
satellite.py
1.6 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
15.7 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /lib/python3.9/site-packages/sos/collector/clusters/ceph.py
# Copyright (C) 2022 Red Hat Inc., Jake Hunsaker <jhunsake@redhat.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution for further information. import json from sos.collector.clusters import Cluster class ceph(Cluster): """ This cluster profile is for Ceph Storage clusters, and is primarily built around Red Hat Ceph Storage 5. Nodes are enumerated via `cephadm`; if your Ceph deployment uses cephadm but is not RHCS 5, this profile may work as intended, but it is not currently guaranteed to do so. If you are using such an environment and this profile does not work for you, please file a bug report detailing what is failing. By default, all nodes in the cluster will be returned for collection. This may not be desirable, so users are encouraged to use the `labels` option to specify a colon-delimited set of ceph node labels to restrict the list of nodes to. For example, using `-c ceph.labels=osd:mgr` will return only nodes labeled with *either* `osd` or `mgr`. """ cluster_name = 'Ceph Storage Cluster' sos_plugins = [ 'ceph_common', ] sos_options = {'log-size': 50} packages = ('cephadm',) option_list = [ ('labels', '', 'Colon delimited list of labels to select nodes with') ] def get_nodes(self): self.nodes = [] ceph_out = self.exec_primary_cmd( 'cephadm shell -- ceph orch host ls --format json', need_root=True ) if not ceph_out['status'] == 0: self.log_error( f"Could not enumerate nodes via cephadm: {ceph_out['output']}" ) return self.nodes nodes = json.loads(ceph_out['output'].splitlines()[-1]) _labels = [lab for lab in self.get_option('labels').split(':') if lab] for node in nodes: if _labels and not any(_l in node['labels'] for _l in _labels): self.log_debug(f"{node} filtered from list due to labels") continue self.nodes.append(node['hostname']) return self.nodes # vim: set et ts=4 sw=4 :
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply