Leser: 1
|< 1 2 3 4 ... 7 >| | 63 Einträge, 7 Seiten |
1
2
3
4
5
6
7
8
9
10
11
Default-Monitor = yes
Default-Description = Datawarehouse Server
Default-OS-Name = SuSE Linux Enterprise Server
Default-OS-Release = 2.6.4
Default-Service = 43610
Default-Mail-Group = dba
Threshold-ProcStats-Total = 95
Threshold-ProcStats-New = 200
Threshold-MemStats-SwapUsedPer = 50
Threshold-PgSwStats-SwapOut = 1
Threshold-LoadAVG-RunQueue = 20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sub read_config {
my $file = shift;
my $conf = {};
my $line = 0;
sysopen my $fh, $file, O_RDONLY or die "cannot open $file - $!";
flock($fh,LOCK_SH);
while (<$fh>) {
$line++;
next if /^\s*(#|$)/;
chomp;
s/\s*#.*$//;
unless (/^\s*([a-zA-Z0-9-]+)\s*=\s*(.*)$/) {
warn "errors in config file $file line $line detected";
next;
}
my ($name,$value) = ($1,$2);
# Verarbeitung des Parameters
my @keys = split /-/, $name; # Parameter nach Keys splitten
my $last = pop @keys; # den letzten Key festhalten
my $href = $conf; # temporaere Referenz
for (@keys) {
$href->{$_} = {} unless exists $href->{$_};
$href = $href->{$_};
}
$href->{$last} = $value;
}
close $fh;
return $conf;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Default:
Description: Datawarehouse Server
Mail:
Group: dba
Monitor: yes
OS:
Name: SuSE Linux Enterprise Server
Release: 2.6.4
Service: 43610
Threshold:
LoadAvg:
RunQueue: 20
MemStats:
SwapUsedPer: 50
PgSwStats:
SwapOut: 1
ProcStats:
New: 200
Total: 95
|< 1 2 3 4 ... 7 >| | 63 Einträge, 7 Seiten |