Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
cd8f966e
Commit
cd8f966e
authored
Oct 22, 2015
by
Emmanuel Kasper
Committed by
Dietmar Maurer
Oct 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new pvereport command
parent
fdf6f375
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
2 deletions
+97
-2
Makefile
bin/Makefile
+8
-2
pvereport
bin/pvereport
+89
-0
No files found.
bin/Makefile
View file @
cd8f966e
...
...
@@ -15,7 +15,8 @@ SCRIPTS = \
pvemailforward.pl
\
pveupgrade
\
pveupdate
\
pveperf
pveperf
\
pvereport
SERVICE_MANS
=
$
(
addsuffix .8,
${
SERVICES
}
)
SERVICE_PODS
=
$
(
addsuffix .pod,
${
SERVICE_MANS
}
)
...
...
@@ -25,7 +26,8 @@ CLI_MANS = \
pveversion.1
\
pveupgrade.1
\
pveperf.1
\
pvesh.1
pvesh.1
\
pvereport.1
CLI_PODS
=
$
(
addsuffix .pod,
${
CLI_MANS
}
)
...
...
@@ -66,6 +68,10 @@ pvesh.1.pod: pvesh
podselect
$<
>
$@
.tmp
mv
$@
.tmp
$@
pvereport.1.pod
:
pvereport
podselect
$<
>
$@
.tmp
mv
$@
.tmp
$@
%.service-bash-completion
:
perl
-I
..
-T
-e
"use PVE::Service::
$*
; PVE::Service::
$*
->generate_bash_completions();"
>
$@
.tmp
mv
$@
.tmp
$@
...
...
bin/pvereport
0 → 100755
View file @
cd8f966e
#!/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
'
);
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/*
');
my
@net
=
('
ifconfig
',
'
cat /etc/network/interfaces
',
'
grep . /etc/pve/firewall/*
',
'
iptables-save
');
my
@cluster
=
('
pvecm nodes
',
'
pvecm status
');
if
(
PVE::pvecfg::
version
()
>=
4.0
)
{
push
@machines
,
'
grep . /etc/pve/lxc/*
'
;
push
@cluster
,
'
cat /etc/pve/corosync.conf
'
;
}
else
{
push
@machines
,
'
grep . /etc/pve/openvz/*
'
;
push
@cluster
,
'
clustat
',
'
cat /etc/cluster.conf
'
;
}
my
$general_report
=
{
title
=>
'
general system info
',
commands
=>
\
@general
,
};
my
$storage_report
=
{
title
=>
'
info about storage (lvm and zfs)
',
commands
=>
\
@storage
,
};
my
$volume_report
=
{
title
=>
'
info about virtual machines
',
commands
=>
\
@machines
,
};
my
$net_report
=
{
title
=>
'
info about network and firewall
',
commands
=>
\
@net
,
};
my
$cluster_report
=
{
title
=>
'
info about clustering
',
commands
=>
\
@cluster
,
};
my
@global_report
=
(
$general_report
,
$storage_report
,
$volume_report
,
$net_report
,
$cluster_report
);
# execute commands and display their output as if they've been done on a interactive shell
# so the local sysadmin can reproduce what we're doing
sub
do_execute
{
my
(
$shell_command
)
=
@_
;
print
"
$shell_command
\n
";
system
$shell_command
;
print
"
\n
";
}
foreach
my
$subreport
(
@global_report
)
{
my
$title
=
$subreport
->
{'
title
'};
my
@commands
=
@
{
$subreport
->
{'
commands
'}};
print
"
====
"
.
$title
.
"
====
\n
";
foreach
my
$shell_command
(
@commands
)
{
do_execute
(
$shell_command
);
}
}
__END__
=head1 NAME
pvereport - Proxmox VE Report tool
=head1 SYNOPSIS
pvereport
=head1 DESCRIPTION
Display various information related to a Proxmox VE system
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment