[pve-devel] [PATCH] Add new pvereport command

Dietmar Maurer dietmar at proxmox.com
Tue Oct 27 07:43:54 CET 2015


applied, comment inline:

> --- /dev/null
> +++ b/bin/pvereport
> @@ -0,0 +1,89 @@
> +#!/usr/bin/perl
> +
> +use strict;
> +use warnings;
> +use PVE::pvecfg;
> +
> +($> == 0 ) || die "please run as root\n";
> +
> +my @general = ('hostname', 'pveversion --verbose', 'cat /etc/hosts', 'top -b
> -n 1  | head -n 15',
> +  'pvesubscription get','lscpu', 'grep --max-count=1 "model name"
> /proc/cpuinfo' );

lscpu already includes model name, so why do we need that 'grep'?

> +
> +my @storage = ('cat /etc/pve/storage.cfg', 'pvesm status', 'cat /etc/fstab',
> 'mount', 'df --human');
> +
> +my @volumes = ('lvdisplay', 'vgdisplay', 'zpool status', 'zfs list');
> +
> +my @machines = ('qm list', 'grep . /etc/pve/qemu-server/*');

isn't there a better way to print VM configs?

> +
> +my @net = ('ifconfig', 'cat /etc/network/interfaces', 'grep .
> /etc/pve/firewall/*',
> +  'iptables-save');

Maybe it is worth write a perl method to nicely print all files inside a
directory?

> +
> +my @cluster = ('pvecm nodes', 'pvecm status');
> +
> +if (PVE::pvecfg::version() >= 4.0) {
> +    push @machines, 'grep . /etc/pve/lxc/*' ;

once again

> +    push @cluster, 'cat /etc/pve/corosync.conf' ;
> +} else {
> +    push @machines, 'grep . /etc/pve/openvz/*' ;

once again




More information about the pve-devel mailing list