diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi
index 64fdbba05..26ab4f314 100644
--- a/html/cgi-bin/services.cgi
+++ b/html/cgi-bin/services.cgi
@@ -56,6 +56,7 @@ my %servicenames =(
$Lang::tr{'secure shell server'} => 'sshd',
$Lang::tr{'vpn'} => 'charon',
$Lang::tr{'web proxy'} => 'squid',
+ $Lang::tr{'intrusion detection system'} => 'suricata',
'OpenVPN' => 'openvpn'
);
@@ -71,31 +72,16 @@ my %link =(
$Lang::tr{'vpn'} => "$Lang::tr{'vpn'}",
$Lang::tr{'web proxy'} => "$Lang::tr{'web proxy'}",
'OpenVPN' => "OpenVPN",
- "$Lang::tr{'intrusion detection system'} (GREEN)" => "$Lang::tr{'intrusion detection system'} (GREEN)",
- "$Lang::tr{'intrusion detection system'} (RED)" => "$Lang::tr{'intrusion detection system'} (RED)",
- "$Lang::tr{'intrusion detection system'} (ORANGE)" => "$Lang::tr{'intrusion detection system'} (ORANGE)",
- "$Lang::tr{'intrusion detection system'} (BLUE)" => "$Lang::tr{'intrusion detection system'} (BLUE)"
+ "$Lang::tr{'intrusion detection system'}" => "$Lang::tr{'intrusion detection system'}",
+);
+
+# Hash to overwrite the process name of a process if it differs fromt the launch command.
+my %overwrite_exename_hash = (
+ "suricata" => "Suricata-Main"
);
my $lines=0; # Used to count the outputlines to make different bgcolor
-my $iface = '';
-if (open(FILE, "${General::swroot}/red/iface")){
- $iface = ;
- close FILE;
- chomp $iface;
-}
-
-$servicenames{"$Lang::tr{'intrusion detection system'} (RED)"} = "snort_${iface}";
-$servicenames{"$Lang::tr{'intrusion detection system'} (GREEN)"} = "snort_$netsettings{'GREEN_DEV'}";
-
-if ($netsettings{'ORANGE_DEV'} ne ''){
- $servicenames{"$Lang::tr{'intrusion detection system'} (ORANGE)"} = "snort_$netsettings{'ORANGE_DEV'}";
-}
-if ($netsettings{'BLUE_DEV'} ne ''){
- $servicenames{"$Lang::tr{'intrusion detection system'} (BLUE)"} = "snort_$netsettings{'BLUE_DEV'}";
-}
-
my @querry = split(/\?/,$ENV{'QUERY_STRING'});
$querry[0] = '' unless defined $querry[0];
$querry[1] = 'hour' unless defined $querry[1];
@@ -258,7 +244,20 @@ sub isrunning{
my $memory;
$cmd =~ /(^[a-z]+)/;
- $exename = $1;
+
+ # Check if the exename needs to be overwritten.
+ # This happens if the expected process name string
+ # differs from the real one. This may happened if
+ # a service uses multiple processes or threads.
+ if (exists($overwrite_exename_hash{$1})) {
+ # Grab the string which will be reported by
+ # the process from the corresponding hash.
+ $exename = $overwrite_exename_hash{$1};
+ } else {
+ # Directly expect the launched command as
+ # process name.
+ $exename = $1;
+ }
if (open(FILE, "/var/run/${cmd}.pid")){
$pid = ; chomp $pid;