Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add support for SNMP custom data in tsung_stats.pl

  • Loading branch information...
commit 3a77f8216afd1c8687502c06c2c8f3140d5ec116 1 parent 7519458
@nniclausse nniclausse authored
View
16 src/templates/graph.thtml
@@ -118,6 +118,22 @@
</td>
</tr>
+
+
+ [% USE table(os_mon_other, cols=2) %]
+ [% FOREACH row = table.rows %]
+ <tr>
+ [% FOREACH key = row %]
+ <td>
+ <a href="images/graphes-$key-mean.[% ext %]">
+ <img class="graph" src="images/graphes-$key-mean_tn.png" alt="other"/>
+ </a>
+
+</td>
+ [% END %]
+</tr>
+[% END %]
+
</table>
</div>
[% END %]
View
7 src/templates/report.thtml
@@ -155,6 +155,13 @@
<td class="stats">[% data.minmean.$key %] / sec</td>
</tr>
[% END %]
+ [% IF cat_data.$key == "os_mon_other" %]
+ <tr>
+ <td class="stats">$key</td>
+ <td class="stats">[% data.maxmean.$key %] / sec</td>
+ <td class="stats">[% data.minmean.$key %] / sec</td>
+ </tr>
+ [% END %]
[% END %]
</table>
</div>
View
7 src/tsung_stats.pl.in
@@ -64,6 +64,7 @@ my $match =0;
my $async =0;
my $errors =0;
my $maxval;
+my $os_mon_other;
my $category;
my $CPU_MAX = 3200; # cpu usage should never be higher than 3200% (32 cores at 100%)
@@ -355,6 +356,11 @@ sub parse_stats_file {
} elsif ($type =~ /^\w{4}packets:/) {
next if $values =~ /^0/; # skip when no data is available
$category->{$type} = "os_mon_packets";
+ } elsif ($type =~ /^(\w+):os_mon/) {
+ next if $values =~ /^0/; # skip when no data is available
+ $category->{$type} = "os_mon_other";
+ push @{$os_mon_other}, $1;
+
} elsif ($type =~ /^\d+$/) {
$category->{$type} = "http_status";
} elsif ($type eq "request" or $type eq "page" or $type eq "session" or $type eq "connect" or $type eq "async_rcv") {
@@ -583,6 +589,7 @@ sub html_report {
subtitle => "Graphs Report",
stats_subtitle => "Stats Report ",
graph_subtitle => "Graphs Report ",
+ os_mon_other=> $os_mon_other,
contact => $contact,
conf => $xml_conf,
ext => $imgfmt
Please sign in to comment.
Something went wrong with that request. Please try again.