[pve-devel] [PATCH manager] Add Ceph, iscsi and more disk and zfs information to pvereport
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Mar 29 18:29:36 CET 2019
On 3/28/19 7:56 PM, Friedrich Ramberger wrote:
> Following items added to pvereport:
>
> * more details about disks
> * iscsi information
> * more zfs information
> * ceph information (only when ceph.conf exists)
>
> When running from command line now report progress is shown at the console (STDERR)
changes look really OK, thanks for this one! But Oguz is correct,
there are a few whitespace errors in the patch, could you please address
them, else I can also do it when applying if it's a big hassle for you.
> ---
> PVE/Report.pm | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/Report.pm b/PVE/Report.pm
> index a7c77050..044923c7 100644
> --- a/PVE/Report.pm
> +++ b/PVE/Report.pm
> @@ -60,9 +60,12 @@ my $report_def = {
> ],
> disks => [
> 'lsblk --ascii',
> + 'ls -l /dev/disk/by-*/',
> + 'iscsiadm -m node',
> + 'iscsiadm -m session',
> ],
> volumes => [
> - 'pvs',
> + 'pvs',
> 'lvs',
> 'vgs',
> ],
> @@ -71,7 +74,14 @@ my $report_def = {
> my @report_order = ('general', 'storage', 'virtual guests', 'network',
> 'firewall', 'cluster', 'bios', 'pci', 'disks', 'volumes');
>
> -push @{$report_def->{volumes}}, 'zpool status', 'zfs list' if cmd_exists('zfs');
> +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;
> +}
>
> push @{$report_def->{disk}}, 'multipath -ll', 'multipath -v3' if cmd_exists('multipath');
>
> @@ -119,6 +129,7 @@ sub generate {
>
> $report .= "\n==== $title ====\n";
> foreach my $command (@$commands) {
> + print STDERR "Process ".$command."...";
> eval {
> if (ref $command eq 'CODE') {
> PVE::Tools::run_with_timeout($cmd_timeout, $command);
> @@ -126,11 +137,12 @@ sub generate {
> $report .= "\n# $command\n";
> PVE::Tools::run_command($command, %$run_cmd_params);
> }
> + print STDERR "OK";
> };
> + print STDERR "\n";
> $report .= "\nERROR: $@\n" if $@;
> }
> }
> -
> return $report;
> }
>
>
More information about the pve-devel
mailing list