my $ceph_status = eval { PVE::API2::Ceph->status({ node => $nodename }); };
my $osd_flags = eval { PVE::API2::Ceph->get_flags({ node => $nodename }); };
my $noout_wanted = 1;
- my $noout = $osd_flags =~ m/noout/ if $osd_flags;
+ my $noout = $osd_flags && $osd_flags =~ m/noout/;
if (!$ceph_status || !$ceph_status->{health}) {
log_fail("unable to determine Ceph status!");
my $service_exists = $type->{$name}->{service};
if ($service_exists) {
- eval {
- PVE::Ceph::Services::ceph_service_cmd('disable', "$service.$name");
- PVE::Ceph::Services::ceph_service_cmd('stop', "$service.$name");
- };
- my $err = $@ if $@;
- warn "Could not disable/stop ceph-$service\@$name, error: $err\n"
- if $err;
+ eval { PVE::Ceph::Services::ceph_service_cmd('disable', "$service.$name") };
+ warn "Could not disable ceph-$service\@$name, error: $@\n" if $@;
+
+ eval { PVE::Ceph::Services::ceph_service_cmd('stop', "$service.$name") };
+ warn "Could not stop ceph-$service\@$name, error: $@\n" if $@;
}
}
}
push @{$report_def->{volumes}}, 'zpool status', 'zpool list -v', 'zfs list' if cmd_exists('zfs');
if (-e '/etc/ceph/ceph.conf') {
- my $crbd = eval "`ceph osd pool ls | sed -e 's/^/echo /' | sed 'p;s/echo/rbd ls/g'`";
- push @{$report_def->{volumes}}, 'ceph status', 'ceph osd status', 'ceph df', 'pveceph status', 'pveceph lspools', $crbd;
+ # TODO: add (now working) rdb ls over all pools? really needed?
+ push @{$report_def->{volumes}}, 'ceph status', 'ceph osd status', 'ceph df', 'pveceph status', 'pveceph pool ls';
}
push @{$report_def->{disk}}, 'multipath -ll', 'multipath -v3' if cmd_exists('multipath');