Thread Schaubild hat nicht volle Größe (12 answers)
Opened by sde42dn at 2006-11-28 12:28

sde42dn
 2006-11-28 14:18
#9118 #9118
User since
2006-10-26
11 Artikel
BenutzerIn
[default_avatar]
hier ein Teil der Textdatei, die ausgelesen und dargestellt wird:

Dateiname: CPU-Daten

#######################################
Code: (dl )
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
0 1 0 7 5 12 00:00:24
1 0 0 0 2 2 00:05:33
0 4 0 6 2 8 00:10:43
0 0 0 6 2 8 00:15:52
0 3 0 3 5 8 00:21:01
0 0 0 8 2 10 00:26:10
0 2 0 46 7 53 00:31:19
0 6 0 32 7 39 00:36:28
0 0 0 41 7 48 00:41:37
0 0 0 35 6 41 00:46:46
0 0 0 29 5 34 00:51:55
0 0 0 20 3 23 00:57:04
0 1 0 27 7 34 01:02:14
0 0 0 15 2 17 01:07:23
0 0 0 6 2 8 01:12:32
0 0 0 6 3 9 01:17:41
0 0 0 12 2 14 01:22:50
0 0 0 12 3 15 01:27:59
0 0 0 5 3 8 01:33:08
0 0 0 7 2 9 01:38:17
0 0 0 6 1 7 01:43:26
0 0 0 0 0 0 01:48:35
0 0 0 1 2 3 01:53:44
0 0 0 10 2 12 01:58:54
0 0 0 34 2 36 02:04:03
0 1 0 20 2 22 02:09:12
0 0 0 25 8 33 02:14:21
0 3 0 20 5 25 02:19:30
0 0 0 12 7 19 02:24:39
0 0 0 0 6 6 02:29:48
0 0 0 9 4 13 02:34:57
0 0 0 6 6 12 02:40:06
0 0 0 0 3 3 02:45:15
0 1 0 6 1 7 02:50:25
0 0 0 6 0 6 02:55:34
0 1 0 19 1 20 03:00:43
0 0 0 0 7 7 03:05:52
0 0 0 7 4 11 03:11:01
0 0 0 6 0 6 03:16:10
0 0 0 0 0 0 03:21:19
0 0 0 6 1 7 03:26:28
0 0 0 6 0 6 03:31:37
0 0 0 7 1 8 03:36:46
0 0 0 0 0 0 03:41:55
0 0 0 6 0 6 03:47:05
0 0 0 6 0 6 03:52:14
0 0 0 0 0 0 03:57:23
0 0 0 0 1 1 04:02:32
0 0 0 6 0 6 04:07:41
0 0 0 8 1 9 04:12:50
0 0 0 2 0 2 04:17:59
0 0 0 6 0 6 04:23:08
0 0 0 6 0 6 04:28:17
0 1 0 15 13 28 04:33:26
0 0 0 15 13 28 04:38:36
0 0 0 28 14 42 04:43:45
0 0 0 22 14 36 04:48:54
0 0 0 11 10 21 04:54:03
0 0 0 6 4 10 04:59:12
0 0 0 7 2 9 05:04:21
0 0 0 0 0 0 05:09:30
0 0 0 0 1 1 05:14:39
0 0 0 6 0 6 05:19:48
0 0 0 6 0 6 05:24:57

##############################################

hier ein kleiner Tel des CGIs: Dateiname: CPU_auswerten.cgi

################################################
Code: (dl )
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Chart::Composite;


sub graph_cpu_taeglich {

$im = Chart::Composite->new (2000,1000);



$im->set (title => 'CPU-Auslastung des Servers ' .
'in Abhaengigkeit der Tageszeit ' ,
legend => "bottom",
legend_labels => ['Run-Queue','Block-Queue','Wait-Queue','Useranteil','Systemanteil','Gesamt'],
precision => '1',
brush_size => '1',
pt_size => '1',
grid_lines => "true",
grey_background => "true",
x_ticks => "vertical",
skip_x_ticks => '4',
#pt_size => '14',
x_label => 'Zeit',
y_label2 => 'Anzahl Prozesse in Queue',
y_label => 'CPU-Auslastung in [%]');


$im->set (composite_info =>
[['Lines', [4,5,6]],['LinesPoints', [1,2,3]]],
min_y_ticks => '10',
max_val1 => '100',
max_val2 => '30',
#min_val2 => '0',

);


$im->set('colors' => {
background => [255,255,255],
y_grid_lines => [255,155,0],
y2_grid_lines => [50,0,255],
y_label => [255,155,0],
y_label2 => [50,0,255],
dataset4 => [100,50,50],
dataset5 => [255,55,130],
});


my $Counter=7; # jede 7. Zeile wird auf X-Achse mit Zeit angezeigt
$Datname="CPU-Daten";

if (! -e "$Datname") {
&fehler5;
}

open(DAT,"<$Datname") or die "Fehler: $!";
while(<DAT>){
chomp;
my @zeile = split(/\s+/,$_);
my $spalte1 = $zeile[0];
my $spalte2 = $zeile[1];
my $spalte3 = $zeile[2];
my $spalte4 = $zeile[3];
my $spalte5 = $zeile[4];
my $spalte6 = $zeile[5];
if ($Counter == 7) {
$spalte7 = $zeile[6];
$Counter=0;
}
else {
$spalte7 = undef;
$Counter++;
}

$im->add_pt ($spalte7, $spalte1, $spalte2, $spalte3, $spalte4, $spalte5, $spalte6);

}

close(DAT);

print "Content-type: image/png\n\n";
binmode STDOUT;
$im->png(*STDOUT);




exit;

}


sub fehler5 {
print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "Datensatz nicht vorhanden!\n\n";
print "Mit dem Zurueck-Button Ihres Browsers kommen\n";
print "Sie wieder zurueck zur vorigen Seite.\n";
print "</body></html>";
exit;
}



&graph_cpu_taeglich;


#################################################

hier der relevante Teil des HTML-Codes zum aufrufen des CGIs:

##################################################
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!-- HTML-Startseite  -->


<html>


<head>

<title>STEPS - Startseite </title>


</head>


<body bgcolor="E4FFAE" text="#000000">

<input type="button" value="CPU" method="post" onclick="document.Formular.action='cgi-bin/CPU_auswerten.cgi';document.Formular.submit()">

</body>
</html>

##############################################


hoffentlich habe ich nichts vergessen.

Danke

Gruß Peter\n\n

<!--EDIT|renee|1164719768-->

View full thread Schaubild hat nicht volle Größe