pve-reporting/get_vminfo_clu1.pl aktualisiert
This commit is contained in:
@@ -47,26 +47,22 @@ for $server (@servers) {
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
#print Dumper(%vms);
|
|
||||||
|
|
||||||
open HTML, ">output1.html";
|
open HTML, ">output1.html";
|
||||||
printf HTML "<html>\n<head>\n<!-- conetadm\@conlxobs1:/scripts/conetadm/pve-reporting/get_vminfo_clu1.pl -->\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'/>
|
printf HTML '<meta name=viewport content=width=device-width,initial-scale=1/>
|
||||||
<link rel='stylesheet' type='text/css' href='jquery.dataTables.min.css'>
|
<link rel=stylesheet type=text/css href=jquery/jquery.dataTables.min.css>
|
||||||
|
|
||||||
<script type='text/javascript' language='javascript' src='jquery-3.5.1.js'></script>
|
<script type=text/javascript language=javascript src=jquery/jquery-3.5.1.js></script>
|
||||||
<script type='text/javascript' language='javascript' src='jquery.dataTables.min.js'></script>
|
<script type=text/javascript language=javascript src=jquery/jquery.dataTables.min.js></script>
|
||||||
<script type='text/javascript' class='init'>
|
<script type=text/javascript class=init>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('#example').DataTable( {
|
$(\'#example\').DataTable( {
|
||||||
'pageLength': 20,
|
\'pageLength\': 20,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
.par {
|
.par {
|
||||||
background-color:#00ff00;
|
background-color:#00ff00;
|
||||||
color:#666666;
|
color:#666666;
|
||||||
@@ -76,13 +72,16 @@ printf HTML "<meta name='viewport' content='width=device-width,initial-scale=1'/
|
|||||||
color:#666666;
|
color:#666666;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
";
|
';
|
||||||
printf HTML "<head>\n<body>\n";
|
printf HTML "<head>\n<body>\n";
|
||||||
|
|
||||||
open OUTPUT, ">output1.txt";
|
open OUTPUT, ">output1.txt";
|
||||||
|
open EUREGON, ">output_euregon.txt";
|
||||||
print "-- print vm information to console and in file output1.txt\n";
|
print "-- print vm information to console and in file output1.txt\n";
|
||||||
$str = sprintf "VMID|NAME|OS|DISKSIZE(S)|DISKUSAGE(S)|SOCKETS|CORES|MEMORY(MB)|BOOTDISK(GB)|DESCRIPTION|TAGS|STATUS|HOST|PID|CDROM\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 $str;
|
||||||
printf OUTPUT $str;
|
printf OUTPUT $str;
|
||||||
|
printf EUREGON $str;
|
||||||
|
|
||||||
$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";
|
$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;
|
printf HTML $str;
|
||||||
@@ -105,6 +104,13 @@ foreach $vm (sort keys %vms) {
|
|||||||
$vms{$vm}{'cdrom'}
|
$vms{$vm}{'cdrom'}
|
||||||
);
|
);
|
||||||
printf $str;
|
printf $str;
|
||||||
|
|
||||||
|
# if tag = euregon : extra datei
|
||||||
|
printf EUREGON $str if ($vms{$vm}{'tags'} =~ /euregon/i);
|
||||||
|
|
||||||
|
# if disksize < 1072623616 : ignorieren
|
||||||
|
|
||||||
|
# ausgabe
|
||||||
printf OUTPUT $str;
|
printf OUTPUT $str;
|
||||||
|
|
||||||
$vms{$vm}{'disksizes'} =~ s/,/<br>/g;
|
$vms{$vm}{'disksizes'} =~ s/,/<br>/g;
|
||||||
@@ -130,12 +136,14 @@ foreach $vm (sort keys %vms) {
|
|||||||
printf HTML $str;
|
printf HTML $str;
|
||||||
}
|
}
|
||||||
close OUTPUT;
|
close OUTPUT;
|
||||||
|
close EUREGON;
|
||||||
printf HTML "\n</table>\n</body></html>";
|
printf HTML "\n</table>\n</body></html>";
|
||||||
close HTML;
|
close HTML;
|
||||||
|
|
||||||
|
|
||||||
print "-- send output1.txt as attachement via email\n";
|
print "-- send output1.txt as attachement via email\n";
|
||||||
|
|
||||||
|
# mail
|
||||||
open MAIL, ">mail1.tmp";
|
open MAIL, ">mail1.tmp";
|
||||||
printf MAIL "TO: $ARGV[0]\n";
|
printf MAIL "TO: $ARGV[0]\n";
|
||||||
printf MAIL "FROM: CONET Services Monitoring Reporter <help\@conet.de\n";
|
printf MAIL "FROM: CONET Services Monitoring Reporter <help\@conet.de\n";
|
||||||
@@ -145,3 +153,12 @@ printf MAIL "\n\n";
|
|||||||
`echo "" | mutt -H mail1.tmp -a output1.txt -- $ARGV[0]`;
|
`echo "" | mutt -H mail1.tmp -a output1.txt -- $ARGV[0]`;
|
||||||
unlink "mail1.tmp";
|
unlink "mail1.tmp";
|
||||||
|
|
||||||
|
# euregon
|
||||||
|
open MAIL, ">mail1.tmp";
|
||||||
|
printf MAIL "TO: $ARGV[0]\n";
|
||||||
|
printf MAIL "FROM: CONET Services Monitoring Reporter <help\@conet.de\n";
|
||||||
|
printf MAIL "SUBJECT: Proxmox VE Report Euregon\n";
|
||||||
|
printf MAIL "X-CONET-SRC: conetadm\@conlxobs1:/scripts/conetadm/pve-reporting/get_vminfo_clu1.pl\n";
|
||||||
|
printf MAIL "\n\n";
|
||||||
|
`echo "" | mutt -H mail1.tmp -a output_euregon.txt -- $ARGV[0]`;
|
||||||
|
unlink "mail1.tmp";
|
||||||
|
|||||||
Reference in New Issue
Block a user