pve-reporting/get_vminfo_clu2.pl aktualisiert

This commit is contained in:
ageissler
2025-03-03 11:43:26 +01:00
parent 85ce850729
commit e107e90123

View File

@@ -47,17 +47,41 @@ for $server (@servers) {
print "\n";
}
#print Dumper(%vms);
open HTML, ">output2.html";
printf HTML "<html><head><!-- conetadm\@conlxobs1:/scripts/conetadm/pve-reporting/get_vminfo_clu2.pl --></head>\n<body>\n";
printf HTML "<html>\n<head>\n<!-- conetadm\@conlxobs1:/scripts/conetadm/pve-reporting/get_vminfo_clu1.pl -->\n";
printf HTML '<meta name=viewport content=width=device-width,initial-scale=1/>
<link rel=stylesheet type=text/css href=jquery/jquery.dataTables.min.css>
<script type=text/javascript language=javascript src=jquery/jquery-3.5.1.js></script>
<script type=text/javascript language=javascript src=jquery/jquery.dataTables.min.js></script>
<script type=text/javascript class=init>
$(document).ready(function () {
$(\'#example\').DataTable( {
\'pageLength\': 20,
} );
});
</script>
<style>
.par {
background-color:#00ff00;
color:#666666;
}
.unpar {
background-color:#ff0000;
color:#666666;
}
</style>
';
printf HTML "<head>\n<body>\n";
open OUTPUT, ">output2.txt";
print "-- print vm information to console and in file output2.txt\n";
$str = sprintf "VMID|NAME|OS|DISKSIZE(S)|DISKUSAGE(S)|SOCKETS|CORES|MEMORY(MB)|BOOTDISK(GB)|DESCRIPTION|TAGS|STATUS|HOST|PID|CDROM\n";
printf $str;
printf OUTPUT $str;
$str = sprintf "<table border='1'>\n<tr><td>VMID</td><td>NAME</td><td>OS</td><td>DISKSIZE(S)</td><td>DISKUSAGE(S)</td><td>SOCKETS</td><td>CORES</td><td>MEMORY(MB)</td><td>BOOTDISK(GB)</td><td>DESCRIPTION</td><td>TAGS</td><td>STATUS</td><td>HOST</td><td>PID</td><td>CDROM</td></tr>\n";
$str = sprintf "<table border='1' id='example' class='display compact' width='100%'>\n<thead><tr><th>VMID</th><th>NAME</th><th>OS</th><th>DISKSIZE(S)</th><th>DISKUSAGE(S)</th><th>SOCKETS</th><th>CORES</th><th>MEMORY(MB)</th><th>BOOTDISK(GB)</th><th>DESCRIPTION</th><th>TAGS</th><th>STATUS</th><th>HOST</th><th>PID</th><th>CDROM</th></tr></thead>\n";
printf HTML $str;
foreach $vm (sort keys %vms) {
$str = sprintf ("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\n",