mirror of
https://github.com/webmin/webmin.git
synced 2026-06-19 19:00:22 +01:00
More status collect / package updates integration
This commit is contained in:
@@ -1 +1 @@
|
||||
cache_time=1
|
||||
cache_time=6
|
||||
|
||||
14
package-updates/install_check.pl
Executable file
14
package-updates/install_check.pl
Executable file
@@ -0,0 +1,14 @@
|
||||
# install_check.pl
|
||||
|
||||
do 'package-updates-lib.pl';
|
||||
|
||||
# is_installed(mode)
|
||||
# For mode 1, returns 2 if the server is installed and configured for use by
|
||||
# Webmin, 1 if installed but not configured, or 0 otherwise.
|
||||
# For mode 0, returns 1 if installed, 0 if not
|
||||
sub is_installed
|
||||
{
|
||||
return 0 if (!&foreign_installed("software"));
|
||||
return $software::update_system ? $_[0]+1 : 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
desc=Software Package Updates
|
||||
longdesc=Displays available package updates from YUM, APT or other update systems
|
||||
category=system
|
||||
depends=software cron mailboxes 1.420
|
||||
depends=software cron mailboxes
|
||||
os_support=redhat-linux debian-linux mandrake-linux/10.2-* solaris
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# Functions for checking for updates to packages from YUM, APT or some other
|
||||
# update system.
|
||||
#
|
||||
# XXX cron job to collect .. actually use webmin module collector
|
||||
# XXX re-check after package update
|
||||
# XXX show on system information page?
|
||||
|
||||
BEGIN { push(@INC, ".."); };
|
||||
eval "use WebminCore;";
|
||||
|
||||
@@ -98,7 +98,10 @@ else {
|
||||
}
|
||||
|
||||
# Refresh collected package info
|
||||
# XXX call webmin
|
||||
if (&foreign_checked("system-status")) {
|
||||
&foreign_require("system-status");
|
||||
&system_status::refresh_possible_packages(\@got));
|
||||
}
|
||||
|
||||
&webmin_log("update", "packages", scalar(@got),
|
||||
{ 'got' => \@got });
|
||||
|
||||
2
system-status/CHANGELOG
Normal file
2
system-status/CHANGELOG
Normal file
@@ -0,0 +1,2 @@
|
||||
---- Changes since 1.490 ----
|
||||
First version of this module, for collecting system information using a background Cron job.
|
||||
11
system-status/enable-collection.pl
Executable file
11
system-status/enable-collection.pl
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Command-line script to enable status collection
|
||||
|
||||
$no_acl_check++;
|
||||
require 'system-status-lib.pl';
|
||||
$ARGV[0] eq 'none' || $ARGV[0] =~ /^[1-9][0-9]*$/ && $ARGV[0] <= 60 ||
|
||||
die "usage: enable-collection.pl none|<mins>";
|
||||
|
||||
$config{'collect_interval'} = $ARGV[0];
|
||||
&save_module_config();
|
||||
&setup_collectinfo_job();
|
||||
13
system-status/postinstall.pl
Executable file
13
system-status/postinstall.pl
Executable file
@@ -0,0 +1,13 @@
|
||||
|
||||
require 'system-status-lib.pl';
|
||||
|
||||
sub module_install
|
||||
{
|
||||
# Create wrapper for system status setup script
|
||||
if (&foreign_check("cron")) {
|
||||
&foreign_require("cron");
|
||||
&cron::create_wrapper("$module_config_directory/enable-collection.pl",
|
||||
$module_name, "enable-collection.pl");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Functions for collecting general system info
|
||||
#
|
||||
# XXX Use on main page of blue theme
|
||||
# XXX Show package updates on blue theme main page
|
||||
# XXX Collect from Cloudmin
|
||||
# XXX Cloudmin should enable background collection
|
||||
# XXX Check new Webmin version and module updates too?
|
||||
# XXX Cloudmin should install using YUM
|
||||
|
||||
BEGIN { push(@INC, ".."); };
|
||||
eval "use WebminCore;";
|
||||
@@ -54,7 +52,7 @@ if (&foreign_check("mount")) {
|
||||
}
|
||||
|
||||
# Available package updates
|
||||
if (&foreign_check("package-updates") && $config{'collect_pkgs'}) {
|
||||
if (&foreign_installed("package-updates") && $config{'collect_pkgs'}) {
|
||||
&foreign_require("package-updates");
|
||||
my @poss = &package_updates::list_possible_updates(2, 1);
|
||||
$info->{'poss'} = \@poss;
|
||||
@@ -94,15 +92,6 @@ my ($info) = @_;
|
||||
&close_tempfile(INFO);
|
||||
}
|
||||
|
||||
# refresh_startstop_status()
|
||||
# Refresh regularly collected info on status of services
|
||||
sub refresh_startstop_status
|
||||
{
|
||||
my $info = &get_collected_info();
|
||||
$info->{'startstop'} = [ &get_startstop_links() ];
|
||||
&save_collected_info($info);
|
||||
}
|
||||
|
||||
# refresh_possible_packages(&newpackages)
|
||||
# Refresh regularly collected info on available packages
|
||||
sub refresh_possible_packages
|
||||
@@ -110,7 +99,7 @@ sub refresh_possible_packages
|
||||
my ($pkgs) = @_;
|
||||
my %pkgs = map { $_, 1 } @$pkgs;
|
||||
my $info = &get_collected_info();
|
||||
if ($info->{'poss'} && &foreign_check("package-updates")) {
|
||||
if ($info->{'poss'} && &foreign_installed("package-updates")) {
|
||||
&foreign_require("package-updates");
|
||||
my @poss = &package_updates::list_possible_updates(2);
|
||||
$info->{'poss'} = \@poss;
|
||||
|
||||
Reference in New Issue
Block a user