Commit ead77ce46bbfa1b8ed010ad21564a882aacd2269
1 parent
4fbc1671
Exists in
master
and in
7 other branches
Adding the loganalyzer cookbook
Showing
4 changed files
with
452 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,182 @@ |
1 | +<?php | |
2 | +/* | |
3 | + ********************************************************************* | |
4 | + * LogAnalyzer - http://loganalyzer.adiscon.com | |
5 | + * ----------------------------------------------------------------- | |
6 | + * Main Configuration File | |
7 | + * | |
8 | + * -> Configuration need variables for the Database connection | |
9 | + * | |
10 | + * Copyright (C) 2008-2010 Adiscon GmbH. | |
11 | + * | |
12 | + * This file is part of LogAnalyzer. | |
13 | + * | |
14 | + * LogAnalyzer is free software: you can redistribute it and/or modify | |
15 | + * it under the terms of the GNU General Public License as published by | |
16 | + * the Free Software Foundation, either version 3 of the License, or | |
17 | + * (at your option) any later version. | |
18 | + * | |
19 | + * LogAnalyzer is distributed in the hope that it will be useful, | |
20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | + * GNU General Public License for more details. | |
23 | + * | |
24 | + * You should have received a copy of the GNU General Public License | |
25 | + * along with LogAnalyzer. If not, see <http://www.gnu.org/licenses/>. | |
26 | + * | |
27 | + * A copy of the GPL can be found in the file "COPYING" in this | |
28 | + * distribution. | |
29 | + * | |
30 | + * Adiscon LogAnalyzer is also available under a commercial license. | |
31 | + * For details, contact info@adiscon.com or visit | |
32 | + * http://loganalyzer.adiscon.com/commercial | |
33 | + ********************************************************************* | |
34 | +*/ | |
35 | + | |
36 | +// --- Avoid directly accessing this file! | |
37 | +if ( !defined('IN_PHPLOGCON') ) | |
38 | +{ | |
39 | + die('Hacking attempt'); | |
40 | + exit; | |
41 | +} | |
42 | +// --- | |
43 | + | |
44 | +// --- UserDB options | |
45 | +/* If UserDB is enabled, all options will and have to be configured in the database. | |
46 | +* All Options below the UserDB options here will not be used, unless a setting | |
47 | +* is missing in the database. | |
48 | +*/ | |
49 | +$CFG['UserDBEnabled'] = false; | |
50 | +$CFG['UserDBServer'] = 'localhost'; | |
51 | +$CFG['UserDBPort'] = 3306; | |
52 | +$CFG['UserDBName'] = 'loganalyzer'; | |
53 | +$CFG['UserDBPref'] = 'logcon_'; | |
54 | +$CFG['UserDBUser'] = 'root'; | |
55 | +$CFG['UserDBPass'] = ''; | |
56 | +$CFG['UserDBLoginRequired'] = false; | |
57 | +$CFG['UserDBAuthMode'] = 0; // USERDB_AUTH_INTERNAL means LogAnalyzer Internal Auth | |
58 | + // USERDB_AUTH_LDAP means Auth via LDAP Server | |
59 | + | |
60 | +// LDAP Auth options | |
61 | +$CFG['LDAPServer'] = '127.0.0.1'; // LDAP server hostname or IP | |
62 | +$CFG['LDAPPort'] = 389; // LDAP port, 389 or 636 for SSL | |
63 | +$CFG['LDAPBaseDN'] = 'CN=Users,DC=domain,DC=local'; // Base DN for LDAP Search, this is a typical ActiveDirectory sample | |
64 | +$CFG['LDAPSearchFilter'] = '(objectClass=user)'; // Basic Search filter | |
65 | +$CFG['LDAPUidAttribute'] = 'sAMAccountName'; // The LDAP attribute used in the search to find the user, example: uid, cn or sAMAccountName (Active Directory) | |
66 | + // DN of the privileged user for the search | |
67 | +$CFG['LDAPBindDN'] = 'CN=Searchuser,CN=Users,DC=domain,DC=local'; // "Searchuser" = the privilegied user used to query LDAP Directory | |
68 | +$CFG['LDAPBindPassword'] = 'Password'; // Password of the privilegied user | |
69 | +// --- | |
70 | + | |
71 | +// --- Misc Options | |
72 | +$CFG['MiscShowDebugMsg'] = 0; // if enabled, you will get additional output on certain places | |
73 | +$CFG['MiscDebugToSyslog'] = 0; // if enabled, debug messages from LogAnalyzer will be send to syslog on linux, and into the EventLog on Windows | |
74 | +$CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid! | |
75 | +$CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings | |
76 | +$CFG['MiscEnableGzipCompression'] = 1; // If enabled, LogAnalyzer will use gzip compression for output, we recommend | |
77 | + // to have this option enabled, it will highly reduce bandwith usage. | |
78 | +$CFG['MiscMaxExecutionTime'] = 30; // LogAnalyzer will try to overwrite the default script timeout with this value during runtime! | |
79 | + // This can of course only work if LogAnalyzer is allowed to changed the script timeout. | |
80 | +$CFG['DebugUserLogin'] = 0; // if enabled, you will see additional informations on failed logins | |
81 | +// --- | |
82 | + | |
83 | +// --- Default Frontend Options | |
84 | +$CFG['PrependTitle'] = ""; // If set, this text will be prepended withint the title tag | |
85 | +$CFG['ViewUseTodayYesterday'] = 1; // If enabled, the date from today and yesterday is displayed as "today" and "yesterday" | |
86 | +$CFG['ViewMessageCharacterLimit'] = 80; // Default character limit for the message gets trunscated! 0 means NO trunscation. | |
87 | +$CFG['ViewStringCharacterLimit'] = 30; // Default character limit for all other string type fields before they get trunscated! 0 means NO trunscation. | |
88 | +$CFG['ViewEntriesPerPage'] = 50; // Default number of syslog entries shown per page | |
89 | +$CFG['ViewEnableDetailPopups'] = 1; // If enabled, you will see additional Details for each syslog message on mouse over. | |
90 | +$CFG['ViewDefaultTheme'] = "default"; // This sets the default theme the user is going to see when he opens LogAnalyzer the first time. | |
91 | + // Currently only "default" and "dark" are available. | |
92 | +$CFG['ViewDefaultLanguage'] = "en"; // Sets the default display language | |
93 | +$CFG['ViewEnableAutoReloadSeconds'] = 0; // If "ViewEnableAutoReloadSeconds" is set to anything higher the 0 (which means disabled), this means auto reload is enabled by default. | |
94 | + | |
95 | +$CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button | |
96 | +$CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button | |
97 | + | |
98 | +$CFG['EnableContextLinks'] = 1; // if enabled, context links within the messages will automatically be created and added. Set this to 0 to disable all context links. | |
99 | +$CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address | |
100 | +$CFG['SuppressDuplicatedMessages'] = 0; // If enabled, duplicated messages will be suppressed in the main display. | |
101 | +$CFG['TreatNotFoundFiltersAsTrue'] = 0; // If you filter / search for messages, and the fields you are filtering for is not found, the filter result is treaten as TRUE! | |
102 | +$CFG['PopupMenuTimeout'] = 3000; // This variable defines the default timeout value for popup menus in milliseconds. (those menus which popup when you click on the value of a field. | |
103 | +$CFG['PhplogconLogoUrl'] = ""; // Put an Url to a custom toplogo you want to use. | |
104 | +$CFG['InlineOnlineSearchIcons'] = 1; // Show online search icons | |
105 | +$CFG['UseProxyServerForRemoteQueries'] = "";// If empty no proxy server will be used. If set to a proxy server url like 127.0.0.1:8080, LogAnalyzer will use this server for url queries like the updatecheck. | |
106 | +$CFG['HeaderDefaultEncoding'] = ENC_ISO_8859_1; // Set default character encoding | |
107 | +// --- | |
108 | + | |
109 | +// --- Custom HTML Code | |
110 | +$CFG['InjectHtmlHeader'] = ""; // Use this variable to inject custom html into the html <head> area! | |
111 | +$CFG['InjectBodyHeader'] = ""; // Use this variable to inject custom html into the begin of the <body> area! | |
112 | +$CFG['InjectBodyFooter'] = ""; // Use this variable to inject custom html into the end of the <body> area! | |
113 | +// --- | |
114 | + | |
115 | +// --- Define which fields you want to see | |
116 | +//$CFG['ShowMessage'] = true; // If enabled, the Message column will be appended to the columns list. | |
117 | +//Eventlog based fields: $CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, /*SYSLOG_EVENT_CATEGORY, */SYSLOG_EVENT_ID, SYSLOG_MESSAGE ); | |
118 | +//$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE ); | |
119 | +$CFG['DefaultViewsID'] = ""; | |
120 | +// --- | |
121 | + | |
122 | +// --- Predefined Searches! | |
123 | +$CFG['Search'][] = array ( "DisplayName" => "Syslog Warnings and Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3%2C4&search=Search" ); | |
124 | +$CFG['Search'][] = array ( "DisplayName" => "Syslog Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3&search=Search" ); | |
125 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from the last hour", "SearchQuery" => "filter=datelastx%3A1&search=Search" ); | |
126 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 12 hours", "SearchQuery" => "filter=datelastx%3A2&search=Search" ); | |
127 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 24 hours", "SearchQuery" => "filter=datelastx%3A3&search=Search" ); | |
128 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 7 days", "SearchQuery" => "filter=datelastx%3A4&search=Search" ); | |
129 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "SearchQuery" => "filter=datelastx%3A5&search=Search" ); | |
130 | +// $CFG['Search'][] = array ( "DisplayName" => "", "SearchQuery" => "" ); | |
131 | +// --- | |
132 | + | |
133 | +// --- Predefined Charts! | |
134 | +$CFG['Charts'][] = array ( "DisplayName" => "Top Hosts", "chart_type" => CHART_BARS_HORIZONTAL, "chart_width" => 400, "chart_field" => SYSLOG_HOST, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 ); | |
135 | +$CFG['Charts'][] = array ( "DisplayName" => "SyslogTags", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_SYSLOGTAG, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 ); | |
136 | +$CFG['Charts'][] = array ( "DisplayName" => "Severity Occurences", "chart_type" => CHART_BARS_VERTICAL, "chart_width" => 400, "chart_field" => SYSLOG_SEVERITY, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 ); | |
137 | +$CFG['Charts'][] = array ( "DisplayName" => "Usage by Day", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_DATE, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 ); | |
138 | +// --- | |
139 | + | |
140 | +// --- Configure allowed directories for File base logstream sources | |
141 | +$CFG['DiskAllowed'][] = "/var/log/"; | |
142 | +// --- | |
143 | + | |
144 | +// --- Source Options | |
145 | +/* Example for DiskType Source: | |
146 | + $CFG['Sources']['Source1']['ID'] = "Source1"; | |
147 | + $CFG['Sources']['Source1']['Name'] = "Syslog Disk File"; | |
148 | + $CFG['Sources']['Source1']['Description'] = "More details you want to see about this source"; | |
149 | + $CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK; | |
150 | + $CFG['Sources']['Source1']['LogLineType'] = "syslog"; | |
151 | + $CFG['Sources']['Source1']['MsgParserList'] = ""; | |
152 | + $CFG['Sources']['Source1']['MsgNormalize'] = 0; | |
153 | + $CFG['Sources']['Source1']['DiskFile'] = "/var/log/syslog"; | |
154 | + $CFG['Sources']['Source1']['ViewID'] = "SYSLOG"; | |
155 | + | |
156 | + $CFG['Sources']['Source2']['ID'] = "Source5"; | |
157 | + $CFG['Sources']['Source2']['Name'] = "WinSyslog DB"; | |
158 | + $CFG['Sources']['Source1']['Description'] = ""; | |
159 | + $CFG['Sources']['Source2']['SourceType'] = SOURCE_DB; | |
160 | + $CFG['Sources']['Source1']['MsgParserList'] = ""; | |
161 | + $CFG['Sources']['Source2']['DBTableType'] = "winsyslog"; | |
162 | + $CFG['Sources']['Source2']['DBType'] = DB_MYSQL; | |
163 | + $CFG['Sources']['Source2']['DBServer'] = "localhost"; | |
164 | + $CFG['Sources']['Source2']['DBName'] = "loganalyzer"; | |
165 | + $CFG['Sources']['Source2']['DBUser'] = "root"; | |
166 | + $CFG['Sources']['Source2']['DBPassword'] = ""; | |
167 | + $CFG['Sources']['Source2']['DBTableName'] = "systemevents"; | |
168 | + $CFG['Sources']['Source2']['ViewID'] = "SYSLOG"; | |
169 | +*/ | |
170 | + | |
171 | +$CFG['DefaultSourceID'] = 'Source1'; | |
172 | + | |
173 | +$CFG['Sources']['Source1']['ID'] = 'Source1'; | |
174 | +$CFG['Sources']['Source1']['Name'] = 'Softwarepublico'; | |
175 | +$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG'; | |
176 | +$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK; | |
177 | +$CFG['Sources']['Source1']['LogLineType'] = 'syslog'; | |
178 | +$CFG['Sources']['Source1']['DiskFile'] = '/var/log/spb.log'; | |
179 | + | |
180 | +// --- | |
181 | + | |
182 | +?> | ... | ... |
... | ... | @@ -0,0 +1,182 @@ |
1 | +<?php | |
2 | +/* | |
3 | + ********************************************************************* | |
4 | + * LogAnalyzer - http://loganalyzer.adiscon.com | |
5 | + * ----------------------------------------------------------------- | |
6 | + * Main Configuration File | |
7 | + * | |
8 | + * -> Configuration need variables for the Database connection | |
9 | + * | |
10 | + * Copyright (C) 2008-2010 Adiscon GmbH. | |
11 | + * | |
12 | + * This file is part of LogAnalyzer. | |
13 | + * | |
14 | + * LogAnalyzer is free software: you can redistribute it and/or modify | |
15 | + * it under the terms of the GNU General Public License as published by | |
16 | + * the Free Software Foundation, either version 3 of the License, or | |
17 | + * (at your option) any later version. | |
18 | + * | |
19 | + * LogAnalyzer is distributed in the hope that it will be useful, | |
20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | + * GNU General Public License for more details. | |
23 | + * | |
24 | + * You should have received a copy of the GNU General Public License | |
25 | + * along with LogAnalyzer. If not, see <http://www.gnu.org/licenses/>. | |
26 | + * | |
27 | + * A copy of the GPL can be found in the file "COPYING" in this | |
28 | + * distribution. | |
29 | + * | |
30 | + * Adiscon LogAnalyzer is also available under a commercial license. | |
31 | + * For details, contact info@adiscon.com or visit | |
32 | + * http://loganalyzer.adiscon.com/commercial | |
33 | + ********************************************************************* | |
34 | +*/ | |
35 | + | |
36 | +// --- Avoid directly accessing this file! | |
37 | +if ( !defined('IN_PHPLOGCON') ) | |
38 | +{ | |
39 | + die('Hacking attempt'); | |
40 | + exit; | |
41 | +} | |
42 | +// --- | |
43 | + | |
44 | +// --- UserDB options | |
45 | +/* If UserDB is enabled, all options will and have to be configured in the database. | |
46 | +* All Options below the UserDB options here will not be used, unless a setting | |
47 | +* is missing in the database. | |
48 | +*/ | |
49 | +$CFG['UserDBEnabled'] = false; | |
50 | +$CFG['UserDBServer'] = 'localhost'; | |
51 | +$CFG['UserDBPort'] = 3306; | |
52 | +$CFG['UserDBName'] = 'loganalyzer'; | |
53 | +$CFG['UserDBPref'] = 'logcon_'; | |
54 | +$CFG['UserDBUser'] = 'root'; | |
55 | +$CFG['UserDBPass'] = ''; | |
56 | +$CFG['UserDBLoginRequired'] = false; | |
57 | +$CFG['UserDBAuthMode'] = 0; // USERDB_AUTH_INTERNAL means LogAnalyzer Internal Auth | |
58 | + // USERDB_AUTH_LDAP means Auth via LDAP Server | |
59 | + | |
60 | +// LDAP Auth options | |
61 | +$CFG['LDAPServer'] = '127.0.0.1'; // LDAP server hostname or IP | |
62 | +$CFG['LDAPPort'] = 389; // LDAP port, 389 or 636 for SSL | |
63 | +$CFG['LDAPBaseDN'] = 'CN=Users,DC=domain,DC=local'; // Base DN for LDAP Search, this is a typical ActiveDirectory sample | |
64 | +$CFG['LDAPSearchFilter'] = '(objectClass=user)'; // Basic Search filter | |
65 | +$CFG['LDAPUidAttribute'] = 'sAMAccountName'; // The LDAP attribute used in the search to find the user, example: uid, cn or sAMAccountName (Active Directory) | |
66 | + // DN of the privileged user for the search | |
67 | +$CFG['LDAPBindDN'] = 'CN=Searchuser,CN=Users,DC=domain,DC=local'; // "Searchuser" = the privilegied user used to query LDAP Directory | |
68 | +$CFG['LDAPBindPassword'] = 'Password'; // Password of the privilegied user | |
69 | +// --- | |
70 | + | |
71 | +// --- Misc Options | |
72 | +$CFG['MiscShowDebugMsg'] = 0; // if enabled, you will get additional output on certain places | |
73 | +$CFG['MiscDebugToSyslog'] = 0; // if enabled, debug messages from LogAnalyzer will be send to syslog on linux, and into the EventLog on Windows | |
74 | +$CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid! | |
75 | +$CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings | |
76 | +$CFG['MiscEnableGzipCompression'] = 1; // If enabled, LogAnalyzer will use gzip compression for output, we recommend | |
77 | + // to have this option enabled, it will highly reduce bandwith usage. | |
78 | +$CFG['MiscMaxExecutionTime'] = 30; // LogAnalyzer will try to overwrite the default script timeout with this value during runtime! | |
79 | + // This can of course only work if LogAnalyzer is allowed to changed the script timeout. | |
80 | +$CFG['DebugUserLogin'] = 0; // if enabled, you will see additional informations on failed logins | |
81 | +// --- | |
82 | + | |
83 | +// --- Default Frontend Options | |
84 | +$CFG['PrependTitle'] = ""; // If set, this text will be prepended withint the title tag | |
85 | +$CFG['ViewUseTodayYesterday'] = 1; // If enabled, the date from today and yesterday is displayed as "today" and "yesterday" | |
86 | +$CFG['ViewMessageCharacterLimit'] = 80; // Default character limit for the message gets trunscated! 0 means NO trunscation. | |
87 | +$CFG['ViewStringCharacterLimit'] = 30; // Default character limit for all other string type fields before they get trunscated! 0 means NO trunscation. | |
88 | +$CFG['ViewEntriesPerPage'] = 50; // Default number of syslog entries shown per page | |
89 | +$CFG['ViewEnableDetailPopups'] = 1; // If enabled, you will see additional Details for each syslog message on mouse over. | |
90 | +$CFG['ViewDefaultTheme'] = "default"; // This sets the default theme the user is going to see when he opens LogAnalyzer the first time. | |
91 | + // Currently only "default" and "dark" are available. | |
92 | +$CFG['ViewDefaultLanguage'] = "en"; // Sets the default display language | |
93 | +$CFG['ViewEnableAutoReloadSeconds'] = 0; // If "ViewEnableAutoReloadSeconds" is set to anything higher the 0 (which means disabled), this means auto reload is enabled by default. | |
94 | + | |
95 | +$CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button | |
96 | +$CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button | |
97 | + | |
98 | +$CFG['EnableContextLinks'] = 1; // if enabled, context links within the messages will automatically be created and added. Set this to 0 to disable all context links. | |
99 | +$CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address | |
100 | +$CFG['SuppressDuplicatedMessages'] = 0; // If enabled, duplicated messages will be suppressed in the main display. | |
101 | +$CFG['TreatNotFoundFiltersAsTrue'] = 0; // If you filter / search for messages, and the fields you are filtering for is not found, the filter result is treaten as TRUE! | |
102 | +$CFG['PopupMenuTimeout'] = 3000; // This variable defines the default timeout value for popup menus in milliseconds. (those menus which popup when you click on the value of a field. | |
103 | +$CFG['PhplogconLogoUrl'] = ""; // Put an Url to a custom toplogo you want to use. | |
104 | +$CFG['InlineOnlineSearchIcons'] = 1; // Show online search icons | |
105 | +$CFG['UseProxyServerForRemoteQueries'] = "";// If empty no proxy server will be used. If set to a proxy server url like 127.0.0.1:8080, LogAnalyzer will use this server for url queries like the updatecheck. | |
106 | +$CFG['HeaderDefaultEncoding'] = ENC_ISO_8859_1; // Set default character encoding | |
107 | +// --- | |
108 | + | |
109 | +// --- Custom HTML Code | |
110 | +$CFG['InjectHtmlHeader'] = ""; // Use this variable to inject custom html into the html <head> area! | |
111 | +$CFG['InjectBodyHeader'] = ""; // Use this variable to inject custom html into the begin of the <body> area! | |
112 | +$CFG['InjectBodyFooter'] = ""; // Use this variable to inject custom html into the end of the <body> area! | |
113 | +// --- | |
114 | + | |
115 | +// --- Define which fields you want to see | |
116 | +//$CFG['ShowMessage'] = true; // If enabled, the Message column will be appended to the columns list. | |
117 | +//Eventlog based fields: $CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, /*SYSLOG_EVENT_CATEGORY, */SYSLOG_EVENT_ID, SYSLOG_MESSAGE ); | |
118 | +//$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE ); | |
119 | +$CFG['DefaultViewsID'] = ""; | |
120 | +// --- | |
121 | + | |
122 | +// --- Predefined Searches! | |
123 | +$CFG['Search'][] = array ( "DisplayName" => "Syslog Warnings and Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3%2C4&search=Search" ); | |
124 | +$CFG['Search'][] = array ( "DisplayName" => "Syslog Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3&search=Search" ); | |
125 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from the last hour", "SearchQuery" => "filter=datelastx%3A1&search=Search" ); | |
126 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 12 hours", "SearchQuery" => "filter=datelastx%3A2&search=Search" ); | |
127 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 24 hours", "SearchQuery" => "filter=datelastx%3A3&search=Search" ); | |
128 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 7 days", "SearchQuery" => "filter=datelastx%3A4&search=Search" ); | |
129 | +$CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "SearchQuery" => "filter=datelastx%3A5&search=Search" ); | |
130 | +// $CFG['Search'][] = array ( "DisplayName" => "", "SearchQuery" => "" ); | |
131 | +// --- | |
132 | + | |
133 | +// --- Predefined Charts! | |
134 | +$CFG['Charts'][] = array ( "DisplayName" => "Top Hosts", "chart_type" => CHART_BARS_HORIZONTAL, "chart_width" => 400, "chart_field" => SYSLOG_HOST, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 ); | |
135 | +$CFG['Charts'][] = array ( "DisplayName" => "SyslogTags", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_SYSLOGTAG, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 ); | |
136 | +$CFG['Charts'][] = array ( "DisplayName" => "Severity Occurences", "chart_type" => CHART_BARS_VERTICAL, "chart_width" => 400, "chart_field" => SYSLOG_SEVERITY, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 ); | |
137 | +$CFG['Charts'][] = array ( "DisplayName" => "Usage by Day", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_DATE, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 ); | |
138 | +// --- | |
139 | + | |
140 | +// --- Configure allowed directories for File base logstream sources | |
141 | +$CFG['DiskAllowed'][] = "/var/log/"; | |
142 | +// --- | |
143 | + | |
144 | +// --- Source Options | |
145 | +/* Example for DiskType Source: | |
146 | + $CFG['Sources']['Source1']['ID'] = "Source1"; | |
147 | + $CFG['Sources']['Source1']['Name'] = "Syslog Disk File"; | |
148 | + $CFG['Sources']['Source1']['Description'] = "More details you want to see about this source"; | |
149 | + $CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK; | |
150 | + $CFG['Sources']['Source1']['LogLineType'] = "syslog"; | |
151 | + $CFG['Sources']['Source1']['MsgParserList'] = ""; | |
152 | + $CFG['Sources']['Source1']['MsgNormalize'] = 0; | |
153 | + $CFG['Sources']['Source1']['DiskFile'] = "/var/log/syslog"; | |
154 | + $CFG['Sources']['Source1']['ViewID'] = "SYSLOG"; | |
155 | + | |
156 | + $CFG['Sources']['Source2']['ID'] = "Source5"; | |
157 | + $CFG['Sources']['Source2']['Name'] = "WinSyslog DB"; | |
158 | + $CFG['Sources']['Source1']['Description'] = ""; | |
159 | + $CFG['Sources']['Source2']['SourceType'] = SOURCE_DB; | |
160 | + $CFG['Sources']['Source1']['MsgParserList'] = ""; | |
161 | + $CFG['Sources']['Source2']['DBTableType'] = "winsyslog"; | |
162 | + $CFG['Sources']['Source2']['DBType'] = DB_MYSQL; | |
163 | + $CFG['Sources']['Source2']['DBServer'] = "localhost"; | |
164 | + $CFG['Sources']['Source2']['DBName'] = "loganalyzer"; | |
165 | + $CFG['Sources']['Source2']['DBUser'] = "root"; | |
166 | + $CFG['Sources']['Source2']['DBPassword'] = ""; | |
167 | + $CFG['Sources']['Source2']['DBTableName'] = "systemevents"; | |
168 | + $CFG['Sources']['Source2']['ViewID'] = "SYSLOG"; | |
169 | +*/ | |
170 | + | |
171 | +$CFG['DefaultSourceID'] = 'Source1'; | |
172 | + | |
173 | +$CFG['Sources']['Source1']['ID'] = 'Source1'; | |
174 | +$CFG['Sources']['Source1']['Name'] = 'My Syslog Source'; | |
175 | +$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG'; | |
176 | +$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK; | |
177 | +$CFG['Sources']['Source1']['LogLineType'] = 'syslog'; | |
178 | +$CFG['Sources']['Source1']['DiskFile'] = '/var/log/spb_compress.log'; | |
179 | + | |
180 | +// --- | |
181 | + | |
182 | +?> | ... | ... |
... | ... | @@ -0,0 +1,56 @@ |
1 | +LOGANALYZER_TAR='loganalyzer-3.6.5.tar.gz' | |
2 | +LOGANALYZER_TAR_PATH='/tmp/'+LOGANALYZER_TAR | |
3 | +LOGANALYZER_SRC='/usr/share/nginx/html/loganalyzer' | |
4 | + | |
5 | +package 'php' | |
6 | +package 'php-fpm' | |
7 | +package 'php-mysql' | |
8 | +package 'mariadb-server' | |
9 | +package 'nginx' | |
10 | + | |
11 | +service 'nginx' | |
12 | +service 'php-fpm' do | |
13 | + action [:enable, :start] | |
14 | +end | |
15 | +service 'mariadb' do | |
16 | + action [:enable,:start] | |
17 | +end | |
18 | + | |
19 | +template '/etc/nginx/conf.d/loganalyzer.conf' do | |
20 | + source 'nginx.conf.erb' | |
21 | + notifies :reload, 'service[nginx]' | |
22 | + notifies :reload, 'service[php-fpm]' | |
23 | +end | |
24 | + | |
25 | +execute 'getting-loganalizer' do | |
26 | + command 'wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.5.tar.gz' | |
27 | + cwd '/tmp' | |
28 | +end | |
29 | + | |
30 | +execute 'tar-extraction' do | |
31 | + command 'tar zxvf ' + LOGANALYZER_TAR | |
32 | + cwd '/tmp' | |
33 | + user 'root' | |
34 | +end | |
35 | + | |
36 | +execute 'cp-loganalyzer-files' do | |
37 | + command 'cp -r -n loganalyzer-3.6.5/src/ ' + LOGANALYZER_SRC | |
38 | + cwd '/tmp' | |
39 | + user 'root' | |
40 | +end | |
41 | + | |
42 | +file LOGANALYZER_SRC+'/config.php' do | |
43 | + owner 'root' | |
44 | + group 'root' | |
45 | + mode '0666' | |
46 | +end | |
47 | + | |
48 | +execute 'allowing-config-permission' do | |
49 | + command 'semanage fcontext -a -t httpd_sys_rw_content_t ' + LOGANALYZER_SRC + '/config.php' | |
50 | + user 'root' | |
51 | +end | |
52 | + | |
53 | +execute 'enable-config-permission' do | |
54 | + command 'restorecon -v ' + LOGANALYZER_SRC + '/config.php' | |
55 | + user 'root' | |
56 | +end | ... | ... |
... | ... | @@ -0,0 +1,32 @@ |
1 | +server { | |
2 | + listen 80; | |
3 | + | |
4 | + root /usr/share/nginx/html/; | |
5 | + index index.php index.html index.htm; | |
6 | + | |
7 | + server_name <%= node['config']['monitor_external_hostname'] %>; | |
8 | + | |
9 | + location /loganalyzer/images/ { | |
10 | + alias /usr/share/nginx/html/loganalyzer/images/; | |
11 | + } | |
12 | + | |
13 | + location /loganalyzer/js/ { | |
14 | + alias /usr/share/nginx/html/loganalyzer/js/; | |
15 | + } | |
16 | + | |
17 | + location /loganalyzer/css/ { | |
18 | + alias /usr/share/nginx/html/loganalyzer/css/; | |
19 | + } | |
20 | + | |
21 | + error_page 404 /404.html; | |
22 | + error_page 500 502 503 504 /50x.html; | |
23 | + | |
24 | + # Pass the PHP script to FastCGI server listening on the php-fpm socket | |
25 | + location ~ \.php$ { | |
26 | + fastcgi_pass 127.0.0.1:9000; | |
27 | + fastcgi_index index.php; | |
28 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
29 | + include fastcgi_params; | |
30 | + } | |
31 | +} | |
32 | + | ... | ... |