Added T-COM, Skytel, Vodaphone and several more as a carriers for SMS.
---- Changes since 1.400 ----
Email, SMS and SNMP messages sent by Webmin can be customized, with multiple message templates defined and a different one selected for each monitor.
+---- Changes since 1.410 ----
+The process check monitor can now be limited to a particular user.
proc_ecmd=Missing command
proc_thresh=Number of process that must exist for<br>monitor to consider them running
proc_ethresh=Missing or invalid number of processes
+proc_asuser=Running as user
+proc_anyuser=Any user
+proc_easuser=User for process to run as does not exist
exec_cmd=Command to check exit status of
exec_ecmd=Missing command
return { 'up' => -1 } if (!&foreign_check("proc"));
&foreign_require("proc", "proc-lib.pl");
foreach $p (&foreign_call("proc", "list_processes")) {
- if ($p->{'args'} =~ /$_[0]->{'cmd'}/i) {
+ if ($p->{'args'} =~ /$_[0]->{'cmd'}/i &&
+ (!$_[0]->{'asuser'} || $_[0]->{'asuser'} eq $p->{'user'})) {
push(@found, $p->{'pid'});
$count++;
}
print &ui_table_row($text{'proc_thresh'},
&ui_textbox("thresh", $_[0]->{'thresh'} || 1, 5));
+
+print &ui_table_row($text{'proc_asuser'},
+ &ui_opt_textbox("asuser", $_[0]->{'asuser'}, 13,
+ $text{'proc_anyuser'})." ".
+ &user_chooser_button("asuser"));
}
sub parse_proc_dialog
$_[0]->{'not'} = $in{'not'};
$in{'thresh'} =~ /^\d+$/ || &error($text{'proc_ethresh'});
$_[0]->{'thresh'} = $in{'thresh'};
+if ($in{'asuser_def'}) {
+ delete($_[0]->{'asuser'});
+ }
+else {
+ defined(getpwnam($in{'asuser'})) || &error($text{'proc_easuser'});
+ $_[0]->{'asuser'} = $in{'asuser'};
+ }
}
1;