(1.0.D003) Design documentation
[gnucomo.git] / doc / design.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE doc SYSTEM "/usr/local/xslt/doc.dtd">
3 <?xml-stylesheet type="text/xsl" href="/usr/local/xslt/html.xsl"?>
4 <doc style="main.css">
5
6 <!--
7       XML documentation system
8       Original author :  Arjen Baart - arjen@andromeda.nl
9       Version         : $Revision: 1.1 $
10
11       This document is prepared for XMLDoc. Transform to HTML,
12       LaTeX, Postscript or plain text with XMLDoc utilities and
13       XSLT sheets from http://www.andromeda.nl/projects/xmldoc/
14 -->
15
16 <book>
17 <titlepage>
18    <title>Gnucomo - Computer Monitoring</title>
19    <author>Arjen Baart <code>&lt;arjen@andromeda.nl&gt;</code></author>
20    <author>Brenno de Winter<code>&lt;brenno@dewinter.com&gt;</code></author>
21    <date>July 12, 2002</date>
22    <docinfo>
23       <infoitem label="Version">0.1</infoitem>
24       <infoitem label="Organization">Andromeda Technology &amp; Automation</infoitem>
25       <infoitem label="Organization">De Winter Information Solutions</infoitem>
26    </docinfo>
27    <abstract>
28    </abstract>
29 </titlepage>
30
31 <toc/>
32
33 <chapter>
34 <heading>Introduction</heading>
35
36 <para>
37 <strong>Gnucomo</strong> is a system to monitor computer systems.
38 This document describes the design of the <strong>Gnucomo</strong> applications
39 and is based upon the development manifest.
40 </para>
41
42 </chapter>
43
44 <chapter>
45 <heading>Architecture</heading>
46
47 <para>
48 The architecture of <strong>gnucomo</strong> is shown in the
49 dataflow diagram below:
50 </para>
51
52 <para>
53    <picture src='dataflow.png' eps='dataflow.eps'/>
54 </para>
55
56 <para>
57 Architectural items to consider:
58 <itemize>
59 <item>Active and passive data aquisition</item>
60 <item>Monitoring static and dynamic system parameters</item>
61 <item>Upper and lower limits for system parameters</item>
62 </itemize>
63 </para>
64
65 <para>
66 Existing log analysis tools: logwatch, analog.
67 </para>
68 </chapter>
69
70 <chapter>
71 <heading>System design</heading>
72
73 <para>
74 <strong>Gnucomo</strong> is a collection of different application programs,
75 rather than a single application.
76 All these application programs revolve around the <strong>Gnucomo</strong>
77 database as described in the manifest.
78 </para>
79
80 <section>
81 <heading>Database design</heading>
82
83 <para>
84 Log entries are stored in a database with at least the following fields:
85 <itemize>
86 <item>hostname</item>
87 <item>timestamp</item>
88 <item>service (kernel, daemon, ...)</item>
89 <item>Log message</item>
90 </itemize>
91 </para>
92 </section>
93
94 <section>
95 <heading>Configuration</heading>
96
97 <para>
98 Configurational parameters are stored in a XML formatted configuration file.
99 The config file contains a two-level hierarchy.
100 The first level denotes the section for which the parameter is used
101 and the second level is the parameter itself.
102 Both sections and parameters are elements in XML terminology.
103 The top-level (root) element is the configuration tree itself.
104 The root element must have the same name as the application's name
105 for which the configuration is intended.
106 The level-1 elements are sections of the configuration tree.
107 Within these section elements, the configuration has several parameter elements.
108 Each parameter is an element by itself.
109 The element's name is the name of the parameter, just as a section
110 element's name is the name of the section.
111 The content of the parameter element is the value of the parameter.
112 Attributes in either section elements or parameter elements are not used.
113 </para>
114 <para>
115 The configuration file is located in two places.
116 The is a system wide configuration in
117 <code>/usr/local/etc/gnucomo.conf</code> and each user may
118 have his or her own configuration in <code>~/.gnucomo.conf</code>.
119 The value of a user-specific configuration parameter overrides
120 the system-wide value.
121 </para>
122 <para>
123 At the moment, the gnucomo configuration has one section, holding
124 four parameters which define how to access the gnucomo database:
125 <itemize>
126 <item>type</item>
127 <item>name</item>
128 <item>user</item>
129 <item>password</item>
130 </itemize>
131
132 The <emph>type</emph> parameter must have the content <code>PostgreSQL</code>.
133 Other database systems are not supported yet.
134 </para>
135
136 <subsection>
137 <heading>gnucomo_config class</heading>
138
139 <para>
140 Each Gnucomo application should have exectly one object of the
141 <strong>gnucomo_config</strong> to obtain its configurational
142 parameters.
143 The following methods are supported in this class:
144
145 <itemize>
146
147 <item>
148   read(String name)
149   <para>
150   Reads the XML formatted configuration files from
151   <code>/usr/local/etc/&lt;name&gt;.conf</code> and
152   <code>~/.&lt;name&gt;.conf</code>.
153   </para>
154 </item>
155
156 <item>
157   String find_parameter(String section, String param)
158   <para>
159   Return the value of the parameter <emph>param</emph> in
160   section <emph>section</emph>.
161   </para>
162 </item>
163
164 <item>
165   String Database()
166   <para>
167   Return the database access string to be used for the PgDatabase constructor.
168   </para>
169 </item>
170
171 </itemize>
172 </para>
173
174 </subsection>
175 </section>
176
177 <section>
178 <heading>Design ideas</heading>
179
180 <para>
181 Use of a neural network to analyse system logs:
182 <itemize>
183 <item>Classify words</item>
184 <item>Classify message based on word classification</item>
185 </itemize>
186 </para>
187
188 </section>
189
190 </chapter>
191
192 </book>
193 </doc>