added 'show_gaps' support to the 'wowza' graph

This commit is contained in:
Jordi Sanfeliu 2013-07-04 12:20:34 +02:00
parent ea88e84653
commit 7bb64e3d01
1 changed files with 47 additions and 0 deletions

View File

@ -544,6 +544,7 @@ sub wowza_cgi {
undef(@tmp); undef(@tmp);
undef(@tmpz); undef(@tmpz);
undef(@CDEF);
$n = 0; $n = 0;
foreach my $w (split(',', $wowza->{desc}->{$url})) { foreach my $w (split(',', $wowza->{desc}->{$url})) {
$w = trim($w); $w = trim($w);
@ -561,6 +562,11 @@ sub wowza_cgi {
print(" <tr>\n"); print(" <tr>\n");
print(" <td bgcolor='" . $colors->{title_bg_color} . "'>\n"); print(" <td bgcolor='" . $colors->{title_bg_color} . "'>\n");
} }
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
push(@tmpz, "AREA:wrongdata#$colors->{gap}:");
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
}
($width, $height) = split('x', $config->{graph_size}->{main}); ($width, $height) = split('x', $config->{graph_size}->{main});
RRDs::graph("$PNG_DIR" . "$PNG[$e * 5]", RRDs::graph("$PNG_DIR" . "$PNG[$e * 5]",
"--title=$config->{graphs}->{_wowza1} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza1} ($tf->{nwhen}$tf->{twhen})",
@ -581,6 +587,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conncur:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conncur:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conncur:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conncur:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conncur:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conncur:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmp, @tmp,
"COMMENT: \\n", "COMMENT: \\n",
$uptimeline); $uptimeline);
@ -607,6 +615,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conncur:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conncur:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conncur:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conncur:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conncur:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conncur:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . "$PNGz[$e * 5]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNGz[$e * 5]: $err\n") if $err;
@ -657,6 +667,11 @@ sub wowza_cgi {
push(@CDEF, "CDEF:K_wms" . $e . "_a$n=B_wms" . $e . "_a$n,1024,/"); push(@CDEF, "CDEF:K_wms" . $e . "_a$n=B_wms" . $e . "_a$n,1024,/");
$n++; $n++;
} }
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
push(@tmpz, "AREA:wrongdata#$colors->{gap}:");
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
}
($width, $height) = split('x', $config->{graph_size}->{main}); ($width, $height) = split('x', $config->{graph_size}->{main});
RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 1], RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 1],
"--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})",
@ -685,6 +700,7 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a6o=$rrd:wms" . $e . "_a6_moutbrt:AVERAGE", "DEF:wms" . $e . "_a6o=$rrd:wms" . $e . "_a6_moutbrt:AVERAGE",
"DEF:wms" . $e . "_a7i=$rrd:wms" . $e . "_a7_minbrt:AVERAGE", "DEF:wms" . $e . "_a7i=$rrd:wms" . $e . "_a7_minbrt:AVERAGE",
"DEF:wms" . $e . "_a7o=$rrd:wms" . $e . "_a7_moutbrt:AVERAGE", "DEF:wms" . $e . "_a7o=$rrd:wms" . $e . "_a7_moutbrt:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0i,wms" . $e . "_a0o,wms" . $e . "_a1i,wms" . $e . "_a1o,wms" . $e . "_a2i,wms" . $e . "_a2o,wms" . $e . "_a3i,wms" . $e . "_a3o,wms" . $e . "_a4i,wms" . $e . "_a4o,wms" . $e . "_a5i,wms" . $e . "_a5o,wms" . $e . "_a6i,wms" . $e . "_a6o,wms" . $e . "_a7i,wms" . $e . "_a7o,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
@CDEF, @CDEF,
@tmp); @tmp);
$err = RRDs::error; $err = RRDs::error;
@ -718,6 +734,7 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a6o=$rrd:wms" . $e . "_a6_moutbrt:AVERAGE", "DEF:wms" . $e . "_a6o=$rrd:wms" . $e . "_a6_moutbrt:AVERAGE",
"DEF:wms" . $e . "_a7i=$rrd:wms" . $e . "_a7_minbrt:AVERAGE", "DEF:wms" . $e . "_a7i=$rrd:wms" . $e . "_a7_minbrt:AVERAGE",
"DEF:wms" . $e . "_a7o=$rrd:wms" . $e . "_a7_moutbrt:AVERAGE", "DEF:wms" . $e . "_a7o=$rrd:wms" . $e . "_a7_moutbrt:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0i,wms" . $e . "_a0o,wms" . $e . "_a1i,wms" . $e . "_a1o,wms" . $e . "_a2i,wms" . $e . "_a2o,wms" . $e . "_a3i,wms" . $e . "_a3o,wms" . $e . "_a4i,wms" . $e . "_a4o,wms" . $e . "_a5i,wms" . $e . "_a5o,wms" . $e . "_a6i,wms" . $e . "_a6o,wms" . $e . "_a7i,wms" . $e . "_a7o,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
@CDEF, @CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $err = RRDs::error;
@ -753,6 +770,7 @@ sub wowza_cgi {
} }
undef(@tmp); undef(@tmp);
undef(@tmpz); undef(@tmpz);
undef(@CDEF);
$n = 0; $n = 0;
foreach my $w (split(',', $wowza->{desc}->{$url})) { foreach my $w (split(',', $wowza->{desc}->{$url})) {
$w = trim($w); $w = trim($w);
@ -762,6 +780,11 @@ sub wowza_cgi {
push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w"); push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w");
$n++; $n++;
} }
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
push(@tmpz, "AREA:wrongdata#$colors->{gap}:");
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
}
($width, $height) = split('x', $config->{graph_size}->{small}); ($width, $height) = split('x', $config->{graph_size}->{small});
RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 2], RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 2],
"--title=$config->{graphs}->{_wowza3} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza3} ($tf->{nwhen}$tf->{twhen})",
@ -783,6 +806,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntacc:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntacc:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntacc:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntacc:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntacc:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntacc:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmp); @tmp);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 2] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 2] . ": $err\n") if $err;
@ -808,6 +833,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntacc:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntacc:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntacc:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntacc:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntacc:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntacc:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 2] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 2] . ": $err\n") if $err;
@ -837,6 +864,7 @@ sub wowza_cgi {
} }
undef(@tmp); undef(@tmp);
undef(@tmpz); undef(@tmpz);
undef(@CDEF);
$n = 0; $n = 0;
foreach my $w (split(',', $wowza->{desc}->{$url})) { foreach my $w (split(',', $wowza->{desc}->{$url})) {
$w = trim($w); $w = trim($w);
@ -846,6 +874,11 @@ sub wowza_cgi {
push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w"); push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w");
$n++; $n++;
} }
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
push(@tmpz, "AREA:wrongdata#$colors->{gap}:");
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
}
($width, $height) = split('x', $config->{graph_size}->{small}); ($width, $height) = split('x', $config->{graph_size}->{small});
RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 3], RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 3],
"--title=$config->{graphs}->{_wowza4} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza4} ($tf->{nwhen}$tf->{twhen})",
@ -867,6 +900,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntrej:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntrej:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntrej:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntrej:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntrej:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntrej:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmp); @tmp);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 3] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 3] . ": $err\n") if $err;
@ -892,6 +927,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntrej:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_conntrej:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntrej:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_conntrej:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntrej:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_conntrej:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 3] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 3] . ": $err\n") if $err;
@ -921,6 +958,7 @@ sub wowza_cgi {
} }
undef(@tmp); undef(@tmp);
undef(@tmpz); undef(@tmpz);
undef(@CDEF);
$n = 0; $n = 0;
foreach my $w (split(',', $wowza->{desc}->{$url})) { foreach my $w (split(',', $wowza->{desc}->{$url})) {
$w = trim($w); $w = trim($w);
@ -930,6 +968,11 @@ sub wowza_cgi {
push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w"); push(@tmpz, "LINE2:wms" . $e . "_a$n" . $LC[$n] . ":$w");
$n++; $n++;
} }
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
push(@tmpz, "AREA:wrongdata#$colors->{gap}:");
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
}
($width, $height) = split('x', $config->{graph_size}->{small}); ($width, $height) = split('x', $config->{graph_size}->{small});
RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 4], RRDs::graph("$PNG_DIR" . $PNG[$e * 5 + 4],
"--title=$config->{graphs}->{_wowza5} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza5} ($tf->{nwhen}$tf->{twhen})",
@ -951,6 +994,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_sestot:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_sestot:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_sestot:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_sestot:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_sestot:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_sestot:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmp); @tmp);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 4] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNG[$e * 5 + 4] . ": $err\n") if $err;
@ -976,6 +1021,8 @@ sub wowza_cgi {
"DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_sestot:AVERAGE", "DEF:wms" . $e . "_a5=$rrd:wms" . $e . "_a5_sestot:AVERAGE",
"DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_sestot:AVERAGE", "DEF:wms" . $e . "_a6=$rrd:wms" . $e . "_a6_sestot:AVERAGE",
"DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_sestot:AVERAGE", "DEF:wms" . $e . "_a7=$rrd:wms" . $e . "_a7_sestot:AVERAGE",
"CDEF:allvalues=wms" . $e . "_a0,wms" . $e . "_a1,wms" . $e . "_a2,wms" . $e . "_a3,wms" . $e . "_a4,wms" . $e . "_a5,wms" . $e . "_a6,wms" . $e . "_a7,+,+,+,+,+,+,+",
@CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $err = RRDs::error;
print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 4] . ": $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . $PNGz[$e * 5 + 4] . ": $err\n") if $err;