changed the code to treat MessagesInBytesRate and MessagesOutBytesRate as gauge values. #86

This commit is contained in:
Jordi Sanfeliu 2015-03-26 17:07:05 +01:00
parent 4000488da2
commit 2509300d28
1 changed files with 15 additions and 31 deletions

View File

@ -323,16 +323,12 @@ sub wowza_update {
$config->{wowza_hist}->{$str} = $entry->{ConnectionsTotalRejected}; $config->{wowza_hist}->{$str} = $entry->{ConnectionsTotalRejected};
$str = $e . $e2 . "msginbytes"; $str = $e . $e2 . "msginbytes";
$msginbytes = $entry->{MessagesInBytesRate} - ($config->{wowza_hist}->{$str} || 0); $msginbytes = $entry->{MessagesInBytesRate};
$msginbytes = 0 unless $msginbytes != $entry->{MessagesInBytesRate}; # $msginbytes /= 60;
$msginbytes /= 60;
$config->{wowza_hist}->{$str} = $entry->{MessagesInBytesRate};
$str = $e . $e2 . "msgoutbytes"; $str = $e . $e2 . "msgoutbytes";
$msgoutbytes = $entry->{MessagesOutBytesRate} - ($config->{wowza_hist}->{$str} || 0); $msgoutbytes = $entry->{MessagesOutBytesRate};
$msgoutbytes = 0 unless $msgoutbytes != $entry->{MessagesOutBytesRate}; # $msgoutbytes /= 60;
$msgoutbytes /= 60;
$config->{wowza_hist}->{$str} = $entry->{MessagesOutBytesRate};
$rrdata .= ":" . $entry->{TimeRunning}; $rrdata .= ":" . $entry->{TimeRunning};
$rrdata .= ":" . $entry->{ConnectionsTotal}; $rrdata .= ":" . $entry->{ConnectionsTotal};
@ -403,8 +399,6 @@ sub wowza_cgi {
my @tmp; my @tmp;
my @tmpz; my @tmpz;
my @CDEF; my @CDEF;
my $T = "B";
my $vlabel = "bytes/s";
my $e; my $e;
my $e2; my $e2;
my $n; my $n;
@ -441,11 +435,6 @@ sub wowza_cgi {
$title = !$silent ? $title : ""; $title = !$silent ? $title : "";
if(lc($config->{netstats_in_bps}) eq "y") {
$T = "b";
$vlabel = "bits/s";
}
# text mode # text mode
# #
@ -680,17 +669,12 @@ sub wowza_cgi {
$str = sprintf("%-25s", substr($w, 0, 25)); $str = sprintf("%-25s", substr($w, 0, 25));
push(@tmp, "LINE2:B_wms" . $e . "_a$n" . $LC[$n] . ":$str"); push(@tmp, "LINE2:B_wms" . $e . "_a$n" . $LC[$n] . ":$str");
push(@tmpz, "LINE2:B_wms" . $e . "_a$n" . $LC[$n] . ":$w"); push(@tmpz, "LINE2:B_wms" . $e . "_a$n" . $LC[$n] . ":$w");
push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":LAST: Cur\\:%3.0lfK$T/s"); push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":LAST: Cur\\:%4.0lfKB");
push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":AVERAGE: Avg\\:%3.0lfK$T/s"); push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":AVERAGE: Avg\\:%4.0lfKB");
push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":MIN: Min\\:%3.0lfK$T/s"); push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":MIN: Min\\:%4.0lfKB");
push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":MAX: Max\\:%3.0lfK$T/s\\n"); push(@tmp, "GPRINT:K_wms" . $e . "_a$n" . ":MAX: Max\\:%4.0lfKB\\n");
if(lc($config->{netstats_in_bps}) eq "y") {
push(@CDEF, "CDEF:wms" . $e . "_a$n=wms" . $e . "_a$n" . "i,wms" . $e . "_a$n" . "o,+");
push(@CDEF, "CDEF:B_wms" . $e . "_a$n=wms" . $e . "_a$n,8,*");
} else {
push(@CDEF, "CDEF:wms" . $e . "_a$n=wms" . $e . "_a$n" . "i,wms" . $e . "_a$n" . "o,+"); push(@CDEF, "CDEF:wms" . $e . "_a$n=wms" . $e . "_a$n" . "i,wms" . $e . "_a$n" . "o,+");
push(@CDEF, "CDEF:B_wms" . $e . "_a$n=wms" . $e . "_a$n"); push(@CDEF, "CDEF:B_wms" . $e . "_a$n=wms" . $e . "_a$n");
}
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++;
} }
@ -704,7 +688,7 @@ sub wowza_cgi {
"--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
"--vertical-label=$vlabel", "--vertical-label=bytes",
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
@ -738,7 +722,7 @@ sub wowza_cgi {
"--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_wowza2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
"--vertical-label=$vlabel", "--vertical-label=bytes",
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,