[pve-devel] [PATCH manager] Add Ceph, iscsi and more disk and zfs information to pvereport

Oguz Bektas o.bektas at proxmox.com
Fri Mar 29 15:35:14 CET 2019


hi,
some whitespace errors and comments inline.

On Thu, Mar 28, 2019 at 06:56:32PM +0000, 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)
> ---
>  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',
this all should be tabbed in, like the first entry.
>      ],
>      volumes => [
> -	'pvs',
> +       'pvs',
also tab.
>  	'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."...";
indentation looks wrong here.
also we don't get this in the report (since it's stderr only). might
be a good idea to combine stderr+stdout in the report.
>  	    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";
indentation
>  	    $report .= "\nERROR: $@\n" if $@;
>  	}
>      }
> -
>      return $report;
>  }
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list