]>
git.proxmox.com Git - pve-manager.git/blob - PVE/Report.pm
10 my @general = ('hostname', 'pveversion --verbose', 'cat /etc/hosts', 'top -b -n 1 | head -n 15',
11 'pvesubscription get', 'lscpu');
13 my @storage = ('cat /etc/pve/storage.cfg', 'pvesm status', 'cat /etc/fstab', 'mount', 'df --human');
15 my @volumes = ('lvdisplay', 'vgdisplay', 'zpool status', 'zfs list');
17 my @machines = ('qm list', sub { dir2text
('/etc/pve/qemu-server/', '\d.*conf') });
19 my @net = ('ifconfig', 'cat /etc/network/interfaces', sub { dir2text
('/etc/pve/firewall/', '.*fw') },
22 my @cluster = ('pvecm nodes', 'pvecm status');
24 my @bios = ('dmidecode -t bios');
26 if (PVE
::pvecfg
::version
() >= 4.0) {
27 push @cluster, 'cat /etc/pve/corosync.conf 2> /dev/null' ;
28 push @machines, sub { dir2text
('/etc/pve/lxc/', '\d.*conf') };
30 push @general, 'grep --max-count=1 "model name" /proc/cpuinfo';
31 push @machines, sub { dir2text
('/etc/pve/openvz/', '\d.*conf') };
32 push @cluster, 'clustat', 'cat /etc/cluster.conf 2> /dev/null';
35 my $general_report = {
36 title
=> 'general system info',
37 commands
=> \
@general,
40 my $storage_report = {
41 title
=> 'info about storage (lvm and zfs)',
42 commands
=> \
@storage,
46 title
=> 'info about virtual machines',
47 commands
=> \
@machines,
51 title
=> 'info about network and firewall',
55 my $cluster_report = {
56 title
=> 'info about clustering',
57 commands
=> \
@cluster,
61 title
=> 'info about bios',
65 my @global_report = ($general_report, $storage_report, $volume_report, $net_report, $cluster_report, $bios_report);
67 # output the content of all the files of a directory
69 my ($target_dir, $regexp) = @_;
71 PVE
::Tools
::dir_glob_foreach
($target_dir, $regexp, sub {
73 $report .= "# cat $target_dir$file\n";
74 $report .= PVE
::Tools
::file_get_contents
($target_dir.$file)."\n";
78 # execute commands and display their output as if they've been done on a interactive shell
79 # so the local sysadmin can reproduce what we're doing
82 $report .= "# $command \n";
83 open (COMMAND
, "$command 2>&1 |");
90 foreach my $subreport (@global_report) {
91 my $title = $subreport->{'title'};
92 my @commands = @{$subreport->{'commands'}};
94 $report .= "\n==== $title ====\n";
95 foreach my $command (@commands) {
96 if (ref $command eq 'CODE') {