[! use strict; use Proxmox::License; use Proxmox::HTMLTable; use Proxmox::HTMLDropDown; use Proxmox::Form; use Proxmox::Utils; use Proxmox::License; use Proxmox::Statistic; use Proxmox::proxcfg; use Sys::Syslog; use HTML::Entities; use Proxmox::Config::System; use Proxmox::ConfigServer; !] [$ if (!$fdat{__validlic}) $] [- Execute("license/index.htm"); -] [$ else $] [- my $system_cfg = $fdat{__system_config}; my $lic = $system_cfg->{license}; my $cluster = $system_cfg->get ('administration', 'cluster'); my @cellwidth = ('250px', '490px'); my @header = ('3', '200px', __('License Information')); my @header_cl = ('1', '100px', __('Cluster Status'), '1', '100px', __('IP Address'), '1', '50px', __('Role'), '1', '50px', __('State'), '1', '100px', __('Uptime'), '1', '60px', 'Load', '1', '60px', 'Mem', '1', '60px', 'Disk', ); my $wmsg = __("For more information please visit our homepage at") . " www.proxmox.com."; my $table = Proxmox::HTMLTable->new (\@cellwidth); my $table_cl = Proxmox::HTMLTable->new ([]); $table->add_headline (\@header); $table_cl->add_headline (\@header_cl); if ($lic->valid()) { $table->add_row ('', __("License Nr."), $lic->{data}->{licensenr}); $table->add_row ('', __("Company"), encode_entities ($lic->{data}->{company})); $table->add_row ('', __("Name"), encode_entities ($lic->{data}->{firstname} . " " . $lic->{data}->{lastname})); $table->add_row ('', __("Product"), $lic->product_name); $table->add_row ('', __("Expires"), $lic->expiration_text); $table->add_row ('', __("License MAC Address"), $lic->{data}->{hwaddress}) if $lic->{data}->{hwaddress}; my $kavlic = $system_cfg->{kavlicense}; if ($kavlic->file_exists) { my $msg = $kavlic->status_text; if ($msg) { $table->add_row ('', "Kaspersky", ""); } else { $table->add_row ('', "Kaspersky", sprintf (__("License valid") . ' (' . __("%d users") . ')', $kavlic->{data}->{maxusers})); } } else { $table->add_row ('', "Kaspersky", __("Kaspersky Antivirus not enabled (no License)")); } } if (my $msg = $lic->status_text) { $table->add_row ('', __("Attention"), ""); $table->add_row ('', __("Host MAC Address"), Proxmox::Utils::get_hwaddress); } if (my $msg = $lic->demo_msg) { $wmsg = $msg; } if ($cluster) { my $cinfo = $system_cfg->clusterinfo (); if ($lic->valid() && $lic->can_cluster()) { foreach my $ni (@{$cinfo->{nodes}}) { my $status; my $role = $ni->{role}; $role = 'Master' if $role eq 'M'; $role = 'Node' if $role eq 'N'; eval { my $conn = Proxmox::ConfigClient::connect ($ni->{configport}); $status = $conn->ping()->result; }; my $err = $@; if (!$err && $status) { my $state = $status->{insync} ? 'active' : ''; if ($status->{licwarning} || $status->{kavlicwarning}) { $state = '' } $table_cl->set_row_link ("/cluster/index.htm?cid=$ni->{cid}"); $table_cl->add_row ('', $ni->{cid} eq $cinfo->{local}->{cid} ? 'localhost' : $ni->{name}, $ni->{ip}, $role, $state, $status->{uptime}->{uptimestrshort}, $status->{uptime}->{avg1}, int (0.5 + ($status->{meminfo}->{mbmemused}*100/$status->{meminfo}->{mbmemtotal})) . '%', int (0.5 + ($status->{hdinfo}->{used}*100/$status->{hdinfo}->{avail})) . '%'); } else { $table_cl->set_col_span ([1,1,1,5]); my $msg = __("Host not reachable"); $table_cl->add_row ('', $ni->{name}, $ni->{ip}, $role, ""); syslog ('info', $err) if $err; } } } else { $table_cl->set_col_span ([8]); my $msg = Proxmox::Utils::msg ('noclusterlic'); $table_cl->add_row ('', ""); } } my $out = ''; $out .= "
";
$out .= __("Welcome to the Proxmox Mail Gateway!");
$out .= "
";
$out .= $wmsg;
$out .= "