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

Emmanuel Kasper e.kasper at proxmox.com
Tue Oct 27 12:44:16 CET 2015


On 10/27/2015 07:43 AM, Dietmar Maurer wrote:
> 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'?

The older lscpu from Debian Wheezy do not display the CPU model.
I will move the grep command to the pve < 4 commands list

>> +
>> +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?

Yes, makes sense



More information about the pve-devel mailing list