Fill in template hash properly
authorJamie Cameron <jcameron@webmin.com>
Tue, 15 Apr 2008 06:48:57 +0000 (06:48 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 15 Apr 2008 06:48:57 +0000 (06:48 +0000)
status/monitor.pl
status/status-lib.pl

index db11a30..2446b11 100755 (executable)
@@ -460,6 +460,9 @@ if ($tmpl && $tmpl->{$type}) {
                        'STATUS' => $text{'mon_'.$suffix},
                        uc($suffix) => 1,
                      );
+       foreach my $s (@monitor_statuses) {
+               $hash{uc($s)} ||= 0;
+               }
        foreach my $k (keys %$serv) {
                $hash{'SERVICE_'.uc($k)} = $serv->{$k};
                }
index 87f8852..d77d75a 100644 (file)
@@ -17,6 +17,8 @@ $templates_dir = "$module_config_directory/templates";
 %monitor_os_support = ( 'traffic' => { 'os_support' => '*-linux freebsd' },
                      );
 
+@monitor_statuses = ( 'up', 'down', 'un', 'webmin', 'timed', 'isdown' );
+
 # list_services()
 # Returns a list of all services this module knows how to get status on.
 # If this is the first time the function is called a default set of services