Project

General

Profile

« Previous | Next » 

Revision fe3801bf

Added by Seth Mos over 14 years ago

Hopefully improve the useless ipsec logs with highlighting

View differences:

usr/local/www/diag_logs_ipsec.php
56 56
		$gateway = ipsec_get_phase1_dst($ph1ent);
57 57
		if(!is_ipaddr($gateway))
58 58
			continue;
59
		$search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
59
		$search[] = "/(racoon: )(INFO[:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
60
		$search[] = "/(racoon: )(\[{$gateway}\]|{$gateway})(.*)/i";
61
		$replace[] = "$1<strong>[{$ph1ent['descr']}]</strong>: $2$3$4";
60 62
		$replace[] = "$1<strong>[{$ph1ent['descr']}]</strong>: $2$3$4";
61 63
	}
62 64
/* collect all our own ip addresses */
63 65
exec("/sbin/ifconfig | /usr/bin/awk '/inet / {print $2}'", $ip_address_list);
64 66
foreach($ip_address_list as $address) {
65
	$search[] = "/(racoon: )([A-Z:].*?)({$address}\[[0-9].+\])(.*isakmp.*)/i";
67
	$search[] = "/(racoon: )(INFO[:].*?)({$address}\[[0-9].+\])/i";
68
	$search[] = "/(racoon: )(\[{$address}\]|{$address})(.*)/i";
69
	$replace[] = "$1<strong>[Self]</strong>: $2$3$4";
66 70
	$replace[] = "$1<strong>[Self]</strong>: $2$3$4";
67 71
}
68 72

  
73
$search[] = "/(time up waiting for phase1)/i";
74
$search[] = "/(failed to pre-process ph1 packet)/i";
75
$search[] = "/(failed to pre-process ph2 packet)/i";
76
$search[] = "/(no proposal chosen)/i";
77
$replace[] = "$1 <strong>[Remote Side not responding]</strong>";
78
$replace[] = "$1 <strong>[Check Phase 1 settings, lifetime, algorithm]</strong>";
79
$replace[] = "$1 <strong>[Check Phase 2 settings, networks]</strong>";
80
$replace[] = "$1 <strong>[Check Phase 2 settings, algorithm]</strong>";
81

  
82

  
69 83
$nentries = $config['syslog']['nentries'];
70 84
if (!$nentries)
71 85
	$nentries = 50;

Also available in: Unified diff