--- smeserver-sme9admin-1.5/root/etc/e-smith/web/functions/sme9admin.errolog 2016-12-20 06:44:10.000000000 +0100 +++ smeserver-sme9admin-1.5/root/etc/e-smith/web/functions/sme9admin 2017-01-02 02:04:27.000000000 +0100 @@ -298,12 +298,12 @@ my $dev = $1; my @array = split(/ /); - for $_ (@array) { + for $_ (@array) {warn $_; next if ! /(\w+)\[\d+\](\(.\))*/; - if ($2 eq "(F)") { + if (defined $2 && $2 eq "(F)") { $failed_devs{$dev} .= "$1,"; } - elsif ($2 eq "(S)") { + elsif (defined $2 && $2 eq "(S)") { $spare_devs{$dev} .= "$1,"; } else { @@ -369,10 +369,10 @@ my @services = ("#".gettext("Web services"),"httpd-e-smith","httpd-admin","squid", "#".gettext("Administrative services"), "sshd", "sme9admind", "#".gettext("Network services"),"wan","dhcpd","pptpd","ippp", - "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp","proftpd", - "#".gettext("E-mail services"),"pop3","pop3s","imaps","imap","dovecot","qmail","qpsmtpd","sqpsmtpd", "clamd", "freshclam","spamd",#mail + "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp", + "#".gettext("E-mail services"),"pop3","pop3s","dovecot","imaps","imap","qmail","qpsmtpd","sqpsmtpd", "clamd", "freshclam","spamd",#mail "#".gettext("DNS services"),"tinydns","dnscache", #dns - "#".gettext("Authentication services"),"oidentd","identd","ldap","smtp-auth-proxy","radiusd", #auth + "#".gettext("Authentication services"),"oidentd","ldap","smtp-auth-proxy","radiusd", #auth "#".gettext("Misc. services"),"mysqld","ntpd","lpd", #misc "#".gettext("System services"),"crond","rsyslog","ulogd","acpid","raidmonitor"); #sys et materiel @@ -401,8 +401,9 @@ else { #si c'est un service pour lequel on a des infos complementaires... - if($svc=~/^(httpd-e-smith|httpd-admin|smb|smbd|nmbd|atalk|squid|pptpd|dhcpd|sshd|proftpd|ftp|pppoe|pppd|wan|qmail|qpsmtpd|sqpsmtpd)$/) {$details=1;} - if ( -d "/service/$svc") {$cmd = "/usr/bin/sv s $svc";} # was -d /var/service or -d /service/ + if($svc=~/^(httpd-e-smith|httpd-admin|smb|smbd|nmbd|squid|pptpd|dhcpd|sshd|ftp|pppoe|pppd|wan|qmail|qpsmtpd|sqpsmtpd)$/) {$details=1;} + if ( -d "/service/$svc") {$cmd = "/usr/bin/sv s $svc";} # was -d /var/service or -d /service/ + elsif ($svc=~/^(imaps|imap)$/) { $cmd = "/usr/bin/sv s dovecot"; } else {$cmd = "/sbin/e-smith/service $svc status|/bin/grep $svc";} my @res=`$cmd`; foreach (@res) @@ -423,8 +424,15 @@ #Warning !! Only on sme6 #proftpd est arrete + if ($svc=~/^(imaps|imap)$/) + { + print $q->Tr((($details==1)? $q->td($q->a({href=>"$progname?state=service_detail&service=$svc"},"$svc")) : $q->td("$svc")), + $q->td(""),$q->td( "dovecot" ) ,$q->td("$dbstatus"), $q->td( ( ("$dbstatus" ne "") ? (("$dbstatus" eq "enabled" )? $q->submit(-name=>"disabled_$svc",-value=>'disable'): $q->submit(-name=>"enabled_$svc",-value=>'enable')) : " ") ) ); + + + } #si le service est arrete^:il ya down ou il n'y a pas de () pour le pid et ca ne fini pas par ... - if(/^down:/ || /^([a-zA-Z0-9]*) [^(^)]*([^.]{3})$/) + elsif(/^down:/ || /^([a-zA-Z0-9]*) [^(^)]*([^.]{3})$/) { #on fait une conditionnelle pour savoir si on met le nom du service en lien ou pas print $q->Tr((($details==1)? $q->td($q->a({href=>"$progname?state=service_detail&service=$svc"},"$svc")) : $q->td("$svc")), @@ -441,7 +449,7 @@ #sme6admind (pid 14320) en cours d'execution #si le service tourne - if (/^run:(.*)\(pid ([\d\s]+)\)/ || /^([a-zA-Z0-9]*) \(pid ([\d\s]+)\).*\.\.\.$/ ) + elsif (/^run:(.*)\(pid ([\d\s]+)\)/ || /^([a-zA-Z0-9]*) \(pid ([\d\s]+)\).*\.\.\.$/ ) { #$2=liste pids my @pids=split(/ /,$2);