Subversion Repositories computer_asset_manager_v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 rodolico 1
<?php
2
global $DATABASE_DEFINITION;
3
   $DATABASE_DEFINITION['unknown_entry'] = array(
4
      'table name' => 'unknown_entry',
5
      'key field' => 'unknown_entry_id',
6
      'display name' => 'Unknown Entries',
7
      'display columns' => array('processed_date','report_date','device_name','unknown_entry_id','processed_by','client_name'),
8
      'display query' => 'select processed_date,report_date,device_name,unknown_entry_id,processed_by,client_name from unknown_entry',
9
      'field info' => array(
10
         /* When set the entry has been taken care of by a user */
11
         'processed_date' => array('type' => 'datetime'),
12
         /* The date of the report that found this entry */
13
         'report_date' => array('required' => true , 'type' => 'datetime'),
14
         /* Name of a device from the report */
15
         'device_name' => array('required' => true , 'type' => 'string' , 'width' => 64),
16
         'unknown_entry_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
17
         'processed_by' => array('type' => 'lookup', 'table' => 'login', 'keyfield' => 'login_id', 'display_field' => 'name'),
18
         /* Name of the client from the report */
19
         'client_name' => array('required' => true , 'type' => 'string' , 'width' => 64)
20
      )
21
   );
22
   $DATABASE_DEFINITION['device_alias'] = array(
23
      'table name' => 'device_alias',
24
      'key field' => 'device_alias_id',
25
      'display name' => 'Device Aliases',
26
      'display columns' => array('Device','Alias'),
27
      'display query' => 'select device.name Device,device_alias_id,alias Alias from device_alias join device using (device_id) order by device.name,alias',
28
      'field info' => array(
29
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
30
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
31
         'device_alias_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
32
         'added_date' => array('required' => true , 'type' => 'datetime'),
33
         /* Name found on report */
34
         'alias' => array('keyfield' => true , 'type' => 'string' , 'width' => 64)
35
      )
36
   );
37
   $DATABASE_DEFINITION['client_alias'] = array(
38
      'table name' => 'client_alias',
39
      'key field' => 'client_alias_id',
40
      'display name' => 'Client Aliases',
41
      'display columns' => array('Client','Alias'),
42
      'display query' => 'select client_alias_id,client.name Client,alias Alias from client_alias join client using (client_id)',
43
      'field info' => array(
44
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
45
         'client_alias_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
46
         'client_id' => array('type' => 'lookup', 'table' => 'client', 'keyfield' => 'client_id', 'display_field' => 'name'),
47
         'added_date' => array('required' => true , 'type' => 'datetime'),
48
         /* Name found on report */
49
         'alias' => array('keyfield' => true , 'type' => 'string' , 'width' => 64)
50
      )
51
   );
52
 
53
   $DATABASE_DEFINITION['computer_uptime'] = array(
54
      'table name' => 'computer_uptime',
55
      'key field' => 'computer_uptime_id',
56
      'display name' => 'Computer Uptimes',
57
      'display columns' => array('Device','Rebooted'),
58
      'display query' => 'select device.name Device,last_reboot Rebooted,computer_uptime_id from computer_uptime join device using (device_id) order by device.name,last_reboot desc',
59
      'field info' => array(
60
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
61
         /* date record was deleted/supserceded */
62
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
63
         /* date record was added */
64
         'added_date' => array('type' => 'datetime'),
65
         /* date and time of last reboot */
66
         'last_reboot' => array('type' => 'datetime'),
67
         'computer_uptime_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
68
      )
69
   );
70
   $DATABASE_DEFINITION['device_operating_system'] = array(
71
      'table name' => 'device_operating_system',
72
      'key field' => array('device_id','operating_system_id','removed_date'),
73
      'display name' => 'Operating Systems on a Device',
74
      'display columns' => array('device_id','removed_date','operating_system_id','added_date'),
75
      'display query' => 'select device_id,removed_date,operating_system_id,added_date from device_operating_system',
76
      'field info' => array(
77
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
78
         /* date record was deleted/supserceded */
79
         'removed_date' => array('keyfield' => true , 'type' => 'datetime', 'default' => 'null', 'required' => false ),
80
         /* a link to the operating_system table */
81
         'operating_system_id' => array('keyfield' => true , 'required' => true , 'type' => 'int' , 'width' => 10),
82
         /* date record was added */
83
         'added_date' => array('type' => 'datetime')
84
      )
85
   );
86
   $DATABASE_DEFINITION['disk_info'] = array(
87
      'table name' => 'disk_info',
88
      'key field' => 'disk_info_id',
89
      'display name' => 'Disk Information',
90
      'display columns' => array('Device','Partition','Mount'),
91
      'display query' => 'select disk_device Partition,disk_info_id,capacity,device.name Device,mount_point Mount from disk_info join device using (device_id) order by device.name, disk_device',
92
      'field info' => array(
93
         /* actual device name generally partition name */
94
         'disk_device' => array('type' => 'string' , 'width' => 64),
95
         'disk_info_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
96
         /* date record was deleted/supserceded */
97
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
98
         /* size in kilobytes of partition */
99
         'capacity' => array('type' => 'decimal'),
100
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
101
         /* the file system ext3 ntfs with which this if formatted */
102
         'filesystem' => array('type' => 'string' , 'width' => 32),
103
         /* date record was added */
104
         'added_date' => array('type' => 'datetime'),
105
         /* place on file system where this is mounted or drive letter for Windows */
106
         'mount_point' => array('type' => 'string' , 'width' => 64)
107
      )
108
   );
109
   $DATABASE_DEFINITION['disk_space'] = array(
110
      'table name' => 'disk_space',
111
      'key field' => 'disk_space_id',
112
      'display name' => 'Disk Space (HUGE TABLE)',
113
      'display columns' => array('Device','Partition','Mounted','Used'),
114
      'display query' => 'select disk_space_id, device.name Device, disk_info.disk_device Partition, disk_info.mount_point Mounted, space_used Used from disk_space join disk_info using (disk_info_id) join device using (device_id) where disk_space.removed_date is null',
115
      'field info' => array(
116
         /* link into disk_info table */
117
         'disk_info_id' => array('type' => 'lookup', 'table' => 'disk_info', 'keyfield' => 'disk_info_id', 'display_field' => 'disk_device'),
118
         /* date record was deleted/supserceded */
119
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
120
         'disk_space_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
121
         /* space used in kilobytes */
122
         'default' => array('type' => 'NULL'),
123
         'space_used' => array('type' => 'decimal'),
124
         /* date record was added */
125
         'added_date' => array('type' => 'datetime')
126
      )
127
   );
128
   $DATABASE_DEFINITION['installed_packages'] = array(
129
      'table name' => 'installed_packages',
130
      'key field' => 'installed_packages_id',
131
      'display name' => 'Installed Packages',
132
      'display columns' => array('Device','Package','Version'),
133
      'display query' => 'select software.package_name Package, software_version.version Version, device.name Device, installed_packages_id from installed_packages join device using (device_id) join software using (software_id) join software_version using (software_version_id) limit 100',
134
      'field info' => array(
135
         /* date record was deleted/supserceded */
136
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
137
         /* link into software_version table */
138
         'software_version_id' => array('required' => true , 'type' => 'int' , 'width' => 10),
139
         'installed_packages_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
140
         /* link into software table */
141
         'software_id' => array('required' => true , 'type' => 'int' , 'width' => 10),
142
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
143
         /* date record was added */
144
         'added_date' => array('type' => 'datetime')
145
      )
146
   );
147
   $DATABASE_DEFINITION['network'] = array(
148
      'table name' => 'network',
149
      'key field' => 'network_id',
150
      'display name' => 'Networking',
151
      'display columns' => array('Device','Interface','Address'),
152
      'display query' => 'select device.name Device, network_id,interface Interface,address Address from network join device using (device_id) order by device.name,interface',
153
      'field info' => array(
154
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
155
         /* If provided the IP6 address */
156
         'ip6' => array('type' => 'string' , 'width' => 32),
157
         'network_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
158
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
159
         /* If provided the IP6 subnet mask */
160
         'ip6net' => array('type' => 'int' , 'width' => 10),
161
         /* the interface. eth0 whatever used. Note that some interface names can be long */
162
         'interface' => array('type' => 'string' , 'width' => 32),
163
         'added_date' => array('type' => 'datetime'),
164
         /* The subnet netmask */
165
         'netmask' => array('type' => 'string' , 'width' => 15),
166
         /* The IP4 Address associated here */
167
         'address' => array('type' => 'string' , 'width' => 15),
168
         /* MAC hardware address */
169
         'mac' => array('type' => 'string' , 'width' => 20),
170
         /* MTU value */
171
         'mtu' => array('type' => 'int' , 'width' => 10)
172
      )
173
   );
174
   $DATABASE_DEFINITION['operating_system'] = array(
175
      'table name' => 'operating_system',
176
      'key field' => 'operating_system_id',
177
      'display name' => 'Operating Systems',
178
      'display columns' => array('Distro','Name','Codename','Release','Kernel'),
179
      'display query' => 'select distro Distro,name Name,distro_codename Codename,distro_release "Release",kernel Kernel,operating_system_id from operating_system order by distro, distro_release desc',
180
      'field info' => array(
181
         /* date record was closed */
182
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
183
         /* For Linux the distribution name */
184
         'distro' => array('type' => 'string' , 'width' => 255),
185
         /* Version. Note this is a very large field in some cases */
186
         'version' => array('type' => 'text'),
187
         /* Name of the OS */
188
         'name' => array('type' => 'string' , 'width' => 255),
189
         /* For Linux the distribution code name */
190
         'distro_codename' => array('type' => 'string' , 'width' => 255),
191
         /* For Linux the distribution release */
192
         'distro_release' => array('type' => 'string' , 'width' => 255),
193
         /* kernel information */
194
         'kernel' => array('type' => 'string' , 'width' => 255),
195
         /* For Linux the distribution description */
196
         'distro_description' => array('type' => 'string' , 'width' => 255),
197
         'operating_system_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
198
         /* date record was added */
199
         'added_date' => array('type' => 'datetime')
200
      )
201
   );
202
   $DATABASE_DEFINITION['software'] = array(
203
      'table name' => 'software',
204
      'key field' => 'software_id',
205
      'display name' => 'Software Packages',
206
      'display columns' => array('Name'),
207
      'display query' => 'select software_id,package_name Name from software order by package_name',
208
      'field info' => array(
209
         /* date record was deleted/supserceded */
210
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
211
         'software_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
212
         /* actual name of software package */
213
         'package_name' => array('type' => 'string' , 'width' => 64),
214
         /* any additional description */
215
         'description' => array('type' => 'string' , 'width' => 64),
216
         /* date record was added */
217
         'added_date' => array('type' => 'datetime')
218
      )
219
   );
220
   $DATABASE_DEFINITION['software_version'] = array(
221
      'table name' => 'software_version',
222
      'key field' => 'software_version_id',
223
      'display name' => 'Software Versions',
224
      'display columns' => array('removed_date','software_version_id','version','added_date'),
225
      'display query' => 'select removed_date,software_version_id,version,added_date from software_version',
226
      'field info' => array(
227
         /* date record was deleted/supserceded */
228
         'removed_date' => array('type' => 'datetime', 'default' => 'null', 'required' => false ),
229
         'software_version_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
230
         /* version number */
231
         'version' => array('keyfield' => true , 'type' => 'string' , 'width' => 64),
232
         /* date record was added */
233
         'added_date' => array('type' => 'datetime')
234
      )
235
   );
236
   $DATABASE_DEFINITION['sysinfo_report'] = array(
237
      'table name' => 'sysinfo_report',
238
      'key field' => 'sysinfo_report_id',
239
      'display name' => 'Sysinfo Reports',
240
      'display columns' => array('Date','Device','Version'),
241
      'display query' => 'select report_date Date,version Version,device.name Device,sysinfo_report_id from sysinfo_report join device using (device_id)',
242
      'field info' => array(
243
         'report_date' => array('type' => 'datetime'),
244
         /* The version of the client */
245
         'version' => array('required' => true , 'default' => '1.0' , 'type' => 'string' , 'width' => 5),
246
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
247
         'added_date' => array('type' => 'datetime'),
248
         'sysinfo_report_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
249
      )
250
   )
251
?>