forked from virtualmin/virtualmin-gpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
collectinfo.pl
executable file
·38 lines (32 loc) · 955 Bytes
/
collectinfo.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/local/bin/perl
# Collect various pieces of general system information, for display by themes
# on their status pages. Run every 5 mins from Cron.
package virtual_server;
$main::no_acl_check++;
require './virtual-server-lib.pl';
$start = time();
# Make sure we are not already running
if (&test_lock($collected_info_file)) {
print "Already running\n";
exit(0);
}
# Don't diff collected file
$gconfig{'logfiles'} = 0;
$gconfig{'logfullfiles'} = 0;
$WebminCore::gconfig{'logfiles'} = 0;
$WebminCore::gconfig{'logfullfiles'} = 0;
$no_log_file_changes = 1;
&lock_file($collected_info_file);
$info = &collect_system_info();
if ($info) {
if ($config{'collect_restart'}) {
&restart_collected_services($info);
}
&save_collected_info($info);
&add_historic_collected_info($info, $start);
}
&unlock_file($collected_info_file);
# Update IP list cache
&build_local_ip_list();
# Update DB of per-user last login times
&update_last_login_times();