Handle hostnames with upper-case letters
[webmin.git] / raid / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'raid-lib.pl';
5
6 # parse_webmin_log(user, script, action, type, object, &params)
7 # Converts logged information from this module into human-readable form
8 sub parse_webmin_log
9 {
10 local ($user, $script, $action, $type, $object, $p) = @_;
11 $object = &html_escape($object);
12 if ($action eq 'create') {
13         return &text('log_create', $p->{'level'} eq 'linear' ? $text{$p->{'level'}} : $text{'raid'.$p->{'level'}}, "<tt>$object</tt>");
14         }
15 elsif ($action eq 'stop') {
16         return &text('log_stop', "<tt>$object</tt>");
17         }
18 elsif ($action eq 'start') {
19         return &text('log_start', "<tt>$object</tt>");
20         }
21 elsif ($action eq 'delete') {
22         return &text('log_delete', "<tt>$object</tt>");
23         }
24 elsif ($action eq 'mkfs') {
25         return &text('log_mkfs', "<tt>$p->{'fs'}</tt>", "<tt>$object</tt>");
26         }
27 elsif ($action eq 'add') {
28         return &text('log_add', "<tt>$object</tt>", "<tt>$p->{'disk'}</tt>");
29         }
30 elsif ($action eq 'remove') {
31         return &text('log_remove', "<tt>$object</tt>", "<tt>$p->{'disk'}</tt>");
32         }
33 elsif ($action eq 'grow') {
34         return &text('log_grow', "<tt>$object</tt>", "<tt>$p->{'disk'}</tt>");
35         }
36 elsif ($action eq 'convert_to_raid6') {
37         return &text('log_convert_to_raid6', "<tt>$object</tt>", "<tt>$p->{'disk'}</tt>");
38         }
39 elsif ($action eq 'convert_to_raid5') {
40         return &text('log_convert_to_raid5', "<tt>$object</tt>", "<tt>$p->{'disk'}</tt>");
41         }
42 else {
43         return undef;
44         }
45 }
46