Merge pull request #1 from mikaku/master

sync with upstream
This commit is contained in:
Mark Costlow 2019-11-08 18:52:03 -07:00 committed by GitHub
commit 10cf812a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 1355 additions and 654 deletions

22
Changes
View File

@ -1,12 +1,30 @@
3.NN.N - DD-MMM-2019
====================
- Added a complete graph to support PHP-FPM statistics ('phpfpm.pm'). [#167]
- Completely rewritten the 'gensens.pm' module which includes the battery
values as its third supported sensor. [#170]
- Rewritten the 'bind.pm' module to use XML::LibXML instead of XML::Simple,
fixing a number of long standing bugs. [#181] [#244]
- Added a warning if a process vanished during the accouting in 'process.pm'
- Added the ability, in the alerts of 'gensens.pm', to support a range of two
values, separated by a dash, in the threshold. [#221]
- Added the ability, in the alerts of 'ambsens.pm', to support a range of two
values, separated by a dash, in the threshold. [#221]
- Added support for FreeBSD NFS Server stats. [#238]
- Added the new option 'rrdtool_extra_options' to be able to include RRDtool
extra options on every graph.
(suggested by Greg Ogonowski, greg AT indexcom.com)
- Added the new option 'subject_prefix' in 'emailreports.pm' to be able to
set a customized prefix in the Subject of the emails that will be sent.
- Added the ability to support port ranges in 'port.pm'. [#172]
- Changed the main loop functionality using now the select() function, instead
of the alarm()+pause() pair. This should improve the responsiveness on high
system loads. [#230]
- Changed how the values in 'fail2ban.pm' are shown. Now it shows the Bans as
absolute values. The new option 'graph_mode' permits switching between
'absolute' (default) and 'rate'. [#241]
- Changed the way how 'ztool iostat' command get the read/write values of the
Operations/Bandwidth graphs. [#242]
- Fixed the copyright year in 'monitorix.cgi'.
- Fixed in 'mail.pm to use the option 'mail_log' instead the hard coded path I
forgot to remove when adding the Exim support.
@ -16,6 +34,10 @@
- Fixed to ensure that the 'L' option in port.pm is optional.
- Fixed to make sure that a maximum of 9 values is accepted in the 'graph_0'
and 'graph_1' options of 'squid.pm'; warn user otherwise. [#235]
- Fixed to include support for ZFS version 0.8.1+ in 'zfs.pm'. [#245]
- Fixed to honor the environment variable $OPTIONS during the execution.
- Fixed to not auto-restart the built-in HTTP server if it returned the message
"401 Access Denied" which happens when Basic Authentication is enabled. [#249]
3.11.0 - 14-Mar-2019

View File

@ -1,6 +1,6 @@
Monitorix
=========
Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible.
Monitorix is a free, open-source, lightweight system monitoring tool designed to monitor as many services and system resources as possible.
Community
---------

View File

@ -8,9 +8,9 @@
<mysql>
conn_type = socket
list = /var/run/mysqld/mysqld.sock
list = /run/mysqld/mysqld.sock
<desc>
/var/run/mysqld/mysqld.sock = 3306, user, secret
/run/mysqld/mysqld.sock = 3306, user, secret
</desc>
</mysql>

View File

@ -7,7 +7,7 @@ After=multi-user.target
[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/monitorix
ExecStart=/usr/bin/monitorix -c /etc/monitorix/monitorix.conf -p /run/monitorix.pid
ExecStart=/usr/bin/monitorix -c /etc/monitorix/monitorix.conf -p /run/monitorix.pid $OPTIONS
PIDFile=/run/monitorix.pid
[Install]

View File

@ -277,6 +277,7 @@ sub ambsens_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -305,6 +306,9 @@ sub ambsens_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -445,6 +449,7 @@ sub ambsens_cgi {
"--vertical-label=$unit",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -473,6 +478,7 @@ sub ambsens_cgi {
"--vertical-label=$unit",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -733,6 +733,7 @@ sub apache_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -752,6 +753,9 @@ sub apache_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -894,6 +898,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -918,6 +923,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1021,6 +1027,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1047,6 +1054,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1117,6 +1125,7 @@ sub apache_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1137,6 +1146,7 @@ sub apache_cgi {
"--vertical-label=Percent",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1199,6 +1209,7 @@ sub apache_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1219,6 +1230,7 @@ sub apache_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1288,6 +1300,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1311,6 +1324,7 @@ sub apache_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1376,6 +1390,7 @@ sub apache_cgi {
"--vertical-label=Slots",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1396,6 +1411,7 @@ sub apache_cgi {
"--vertical-label=Slots",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -278,6 +278,7 @@ sub apcupsd_cgi {
my $width;
my $height;
my $temp_scale = "Celsius";
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -297,6 +298,9 @@ sub apcupsd_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -492,6 +496,7 @@ sub apcupsd_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -517,6 +522,7 @@ sub apcupsd_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -594,6 +600,7 @@ sub apcupsd_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -619,6 +626,7 @@ sub apcupsd_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -696,6 +704,7 @@ sub apcupsd_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -718,6 +727,7 @@ sub apcupsd_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -783,6 +793,7 @@ sub apcupsd_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -804,6 +815,7 @@ sub apcupsd_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -868,6 +880,7 @@ sub apcupsd_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -889,6 +902,7 @@ sub apcupsd_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -950,6 +964,7 @@ sub apcupsd_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -970,6 +985,7 @@ sub apcupsd_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ use warnings;
use Monitorix;
use RRDs;
use LWP::UserAgent;
use XML::Simple;
use XML::LibXML;
use Exporter 'import';
our @EXPORT = qw(bind_init bind_update bind_cgi);
@ -305,14 +305,14 @@ sub bind_update {
my $ua = LWP::UserAgent->new(timeout => 30, $ssl);
$ua->agent($config->{user_agent_id}) if $config->{user_agent_id} || "";
my $response = $ua->request(HTTP::Request->new('GET', $l));
my $data = XMLin($response->content);
my $data = XML::LibXML->new->load_xml(string => $response->content);
my $value;
# BIND v9.9+ has different statistics layout than BIND v9.5+.
# we attempt first to get stats from a BIND v9.5+
if(!($value = $data->{bind}->{statistics}->{version})) {
if(!($value = $data->findnodes('/isc/bind/statistics/@version'))) {
# otherwise attempt it on a BIND v9.9+
$value = $data->{version};
$value = $data->findnodes('/statistics/@version');
}
my ($major, $minor) = split('\.', $value);
$minor =~ m/^(\d+)/;
@ -321,12 +321,17 @@ sub bind_update {
logger("$myself: BIND stats version '$version' unsupported.");
}
if($major eq "2") {
$value = $data->{bind}->{statistics}->{server}->{requests}->{opcode}->{counter};
foreach my $counters ($data->findnodes('/isc/bind/statistics/server/requests/opcode')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$value = $counter if $name eq "QUERY";
}
}
}
if($major eq "3") {
$value = $data->{server}->{counters}->[0]->{counter}->{QUERY}->{content};
$value = $data->findvalue('/statistics/server/counters/counter[@name="QUERY"]');
}
$str = $n . "totalinq";
$value = $value || 0;
@ -335,199 +340,219 @@ sub bind_update {
$totalinq /= 60;
$config->{bind_hist}->{$str} = $value;
if($major eq "2") {
$value = $data->{bind}->{statistics}->{server}->{'queries-in'}->{rdtype};
# converts BIND's output when there is only one hit
if($value->{name}) {
my $name = $value->{name};
my $counter = $value->{counter};
delete($value->{name});
delete($value->{counter});
$value->{$name}->{'counter'} = $counter;
}
foreach(keys %{$value}) {
$str = $n . "inq_$_";
$inq{$str} = $value->{$_}->{counter} - ($config->{bind_hist}->{$str} || 0);
$inq{$str} = 0 unless $inq{$str} != $value->{$_}->{counter};
$inq{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{counter};
foreach my $counters ($data->findnodes('/isc/bind/statistics/server/queries-in/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$str = $n . "inq_$name";
$inq{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$inq{$str} = 0 unless $inq{$str} != $counter;
$inq{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "3") {
$value = $data->{server}->{counters}->[1]->{counter} ;
foreach(keys %{$value}) {
$str = $n . "inq_$_";
$inq{$str} = $value->{$_}->{content} - ($config->{bind_hist}->{$str} || 0);
$inq{$str} = 0 unless $inq{$str} != $value->{$_}->{content};
$inq{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{content};
foreach my $counters ($data->findnodes('/statistics/server/counters[@type="qtype"]/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('@name');
my $counter = $c->textContent();
$str = $n . "inq_$name";
$inq{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$inq{$str} = 0 unless $inq{$str} != $counter;
$inq{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
my $views_default;
if($major eq "2") {
$views_default = $data->{bind}->{statistics}->{views}->{view}->{_default};
$value = $views_default->{rdtype};
foreach(keys %{$value}) {
$str = $n . "ouq_$_";
$ouq{$str} = $value->{$_}->{counter} - ($config->{bind_hist}->{$str} || 0);
$ouq{$str} = 0 unless $ouq{$str} != $value->{$_}->{counter};
$ouq{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{counter};
foreach my $counters ($data->findnodes('/isc/bind/statistics/views/view/rdtype')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$str = $n . "ouq_$name";
$ouq{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$ouq{$str} = 0 unless $ouq{$str} != $counter;
$ouq{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "3") {
$views_default = $data->{views}->{view}->{_default}->{counters};
$value = $views_default->[0]->{counter};
foreach(keys %{$value}) {
$str = $n . "ouq_$_";
$ouq{$str} = $value->{$_}->{content} - ($config->{bind_hist}->{$str} || 0);
$ouq{$str} = 0 unless $ouq{$str} != $value->{$_}->{content};
$ouq{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{content};
foreach my $counters ($data->findnodes('/statistics/views/view[@name="_default"]/counters[@type="resqtype"]/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('@name');
my $counter = $c->textContent();
$str = $n . "ouq_$name";
$ouq{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$ouq{$str} = 0 unless $ouq{$str} != $counter;
$ouq{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "2") {
$value = $data->{bind}->{statistics}->{server}->{nsstat};
foreach(keys %{$value}) {
$str = $n . "ss_$_";
$ss{$str} = $value->{$_}->{counter} - ($config->{bind_hist}->{$str} || 0);
$ss{$str} = 0 unless $ss{$str} != $value->{$_}->{counter};
$ss{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{counter};
foreach my $counters ($data->findnodes('/isc/bind/statistics/server/nsstat')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$str = $n . "ss_$name";
$ss{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$ss{$str} = 0 unless $ss{$str} != $counter;
$ss{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "3") {
$value = $data->{server}->{counters}->[2]->{counter};
foreach(keys %{$value}) {
$str = $n . "ss_$_";
$ss{$str} = $value->{$_}->{content} - ($config->{bind_hist}->{$str} || 0);
$ss{$str} = 0 unless $ss{$str} != $value->{$_}->{content};
$ss{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{content};
foreach my $counters ($data->findnodes('/statistics/server/counters[@type="nsstat"]/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('@name');
my $counter = $c->textContent();
$str = $n . "ss_$name";
$ss{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$ss{$str} = 0 unless $ss{$str} != $counter;
$ss{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "2") {
$value = $views_default->{resstat};
foreach(keys %{$value}) {
$str = $n . "rs_$_";
$rs{$str} = $value->{$_}->{counter} - ($config->{bind_hist}->{$str} || 0);
$rs{$str} = 0 unless $rs{$str} != $value->{$_}->{counter};
$rs{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{counter};
LOOP:
foreach my $counters ($data->findnodes('/isc/bind/statistics/views/view/resstat')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
last LOOP if $name eq "Queryv4" && defined($rs{$str});
$str = $n . "rs_$name";
$rs{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$rs{$str} = 0 unless $rs{$str} != $counter;
$rs{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "3") {
$value = $views_default->[1]->{counter};
foreach(keys %{$value}) {
$str = $n . "rs_$_";
$rs{$str} = $value->{$_}->{content} - ($config->{bind_hist}->{$str} || 0);
$rs{$str} = 0 unless $rs{$str} != $value->{$_}->{content};
$rs{$str} /= 60;
$config->{bind_hist}->{$str} = $value->{$_}->{content};
foreach my $counters ($data->findnodes('/statistics/views/view[@name="_default"]/counters[@type="resstats"]/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('@name');
my $counter = $c->textContent();
$str = $n . "rs_$name";
$rs{$str} = $counter - ($config->{bind_hist}->{$str} || 0);
$rs{$str} = 0 unless $rs{$str} != $counter;
$rs{$str} /= 60;
$config->{bind_hist}->{$str} = $counter;
}
}
}
if($major eq "2") {
$value = $views_default->{cache}->{rrset};
foreach my $counters ($data->findnodes('/isc/bind/statistics/views/view/cache[@name="_default"]/rrset')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$str = $n . "crr_$name";
$crr{$str} = $counter;
}
}
}
if($major eq "3") {
$value = $data->{views}->{view}->{_default}->{cache}->{rrset};
foreach my $counters ($data->findnodes('/statistics/views/view[@name="_default"]/cache[@name="_default"]/*')) {
foreach my $c ($counters) {
my $name = $c->findvalue('name');
my $counter = $c->findvalue('counter');
$str = $n . "crr_$name";
$crr{$str} = $counter;
}
}
}
foreach(keys %{$value}) {
$str = $n . "crr_$_";
$crr{$str} = $value->{$_}->{counter};
}
# Socket I/O Statistics
# $value = $data->{bind}->{statistics}->{server}->{sockstat};
# foreach(keys %{$value}) {
# $str = $n . "sio_$_";
# $sio{$str} = $value->{$_}->{counter} - ($config->{bind_hist}->{$str} || 0);
# $sio{$str} = 0 unless $sio{$str} != $value->{$_}->{counter};
# $sio{$str} /= 60;
# $config->{bind_hist}->{$str} = $value->{$_}->{counter};
# }
$rrdata .= ":$totalinq";
my @i;
@i = split(',', $bind->{in_queries_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = trim($i[$n2]);
my $j = trim($i[$n2] || 0);
$str = $n . "inq_$j";
$rrdata .= ":";
$rrdata .= defined($inq{$str}) ? $inq{$str} : 0;
}
@i = split(',', $bind->{out_queries_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = trim($i[$n2]);
my $j = trim($i[$n2] || 0);
$str = $n . "ouq_$j";
$rrdata .= ":";
$rrdata .= defined($ouq{$str}) ? $ouq{$str} : 0;
}
@i = split(',', $bind->{server_stats_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = trim($i[$n2]);
my $j = trim($i[$n2] || 0);
$str = $n . "ss_$j";
$rrdata .= ":";
$rrdata .= defined($ss{$str}) ? $ss{$str} : 0;
}
@i = split(',', $bind->{resolver_stats_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = trim($i[$n2]);
my $j = trim($i[$n2] || 0);
$str = $n . "rs_$j";
$rrdata .= ":";
$rrdata .= defined($rs{$str}) ? $rs{$str} : 0;
}
@i = split(',', $bind->{cache_rrsets_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = trim($i[$n2]);
my $j = trim($i[$n2] || 0);
$str = $n . "crr_$j";
$rrdata .= ":";
$rrdata .= defined($crr{$str}) ? $crr{$str} : 0;
}
# @i = split(',', $bind->{sio_stats_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = ""; #trim($i[$n2]);
$str = $n . "sio_$j";
$rrdata .= ":";
$rrdata .= defined($sio{$str}) ? $sio{$str} : 0;
# @i = split(',', $bind->{sio_stats_list}->{$l});
for($n2 = 0; $n2 < 20; $n2++) {
my $j = ""; #trim($i[$n2] || 0);
$str = $n . "sio_$j";
$rrdata .= ":";
$rrdata .= defined($sio{$str}) ? $sio{$str} : 0;
}
if($major eq "2") {
foreach my $counters ($data->findnodes('/isc/bind/statistics/memory/summary')) {
$rrdata .= ":" . $counters->findvalue('./TotalUse');
$rrdata .= ":" . $counters->findvalue('./InUse');
$rrdata .= ":" . $counters->findvalue('./BlockSize');
$rrdata .= ":" . $counters->findvalue('./ContextSize');
$rrdata .= ":" . $counters->findvalue('./Lost');
}
$rrdata .= ":0:0:0";
}
if($major eq "3") {
foreach my $counters ($data->findnodes('/statistics/memory/summary')) {
$rrdata .= ":" . $counters->findvalue('./TotalUse');
$rrdata .= ":" . $counters->findvalue('./InUse');
$rrdata .= ":" . $counters->findvalue('./BlockSize');
$rrdata .= ":" . $counters->findvalue('./ContextSize');
$rrdata .= ":" . $counters->findvalue('./Lost');
}
$rrdata .= ":0:0:0";
}
if($major eq "2") {
$value = $data->{bind}->{statistics}->{memory};
foreach my $counters ($data->findnodes('/isc/bind/statistics/taskmgr/thread-model')) {
$rrdata .= ":" . $counters->findvalue('./worker-threads');
$rrdata .= ":" . $counters->findvalue('./default-quantum');
$rrdata .= ":" . $counters->findvalue('./tasks-running');
}
$rrdata .= ":0:0:0";
}
if($major eq "3") {
$value = $data->{memory};
foreach my $counters ($data->findnodes('/statistics/taskmgr/thread-model')) {
$rrdata .= ":" . $counters->findvalue('./worker-threads');
$rrdata .= ":" . $counters->findvalue('./default-quantum');
$rrdata .= ":" . $counters->findvalue('./tasks-running');
}
$rrdata .= ":0:0:0";
}
$rrdata .= ":" . $value->{summary}->{TotalUse};
$rrdata .= ":" . $value->{summary}->{InUse};
$rrdata .= ":" . $value->{summary}->{BlockSize};
$rrdata .= ":" . $value->{summary}->{ContextSize};
$rrdata .= ":" . $value->{summary}->{Lost};
$rrdata .= ":0:0:0";
if($major eq "2") {
$value = $data->{bind}->{statistics}->{taskmgr};
}
if($major eq "3") {
$value = $data->{taskmgr};
}
$rrdata .= ":" . ($value->{'thread-model'}->{'worker-threads'} || 0);
$rrdata .= ":" . $value->{'thread-model'}->{'default-quantum'};
$rrdata .= ":" . $value->{'thread-model'}->{'tasks-running'};
$rrdata .= ":0:0:0";
}
RRDs::update($rrd, $rrdata);
@ -561,6 +586,7 @@ sub bind_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -601,6 +627,9 @@ sub bind_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -832,6 +861,7 @@ sub bind_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -870,6 +900,7 @@ sub bind_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -956,6 +987,7 @@ sub bind_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -994,6 +1026,7 @@ sub bind_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1078,6 +1111,7 @@ sub bind_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1116,6 +1150,7 @@ sub bind_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1202,6 +1237,7 @@ sub bind_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1240,6 +1276,7 @@ sub bind_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1324,6 +1361,7 @@ sub bind_cgi {
"--vertical-label=RRsets",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1362,6 +1400,7 @@ sub bind_cgi {
"--vertical-label=RRsets",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1449,6 +1488,7 @@ sub bind_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1478,6 +1518,7 @@ sub bind_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1539,6 +1580,7 @@ sub bind_cgi {
"--vertical-label=Tasks",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1561,6 +1603,7 @@ sub bind_cgi {
"--vertical-label=Tasks",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -238,6 +238,7 @@ sub chrony_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -257,6 +258,9 @@ sub chrony_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -427,6 +431,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -451,6 +456,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -520,6 +526,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -542,6 +549,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -607,6 +615,7 @@ sub chrony_cgi {
"--vertical-label=Level",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -627,6 +636,7 @@ sub chrony_cgi {
"--vertical-label=Level",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -688,6 +698,7 @@ sub chrony_cgi {
"--vertical-label=PPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -709,6 +720,7 @@ sub chrony_cgi {
"--vertical-label=PPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -770,6 +782,7 @@ sub chrony_cgi {
"--vertical-label=PPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -790,6 +803,7 @@ sub chrony_cgi {
"--vertical-label=PPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -850,6 +864,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -870,6 +885,7 @@ sub chrony_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -318,6 +318,7 @@ sub disk_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -348,6 +349,9 @@ sub disk_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -536,6 +540,7 @@ sub disk_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -562,6 +567,7 @@ sub disk_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -665,6 +671,7 @@ sub disk_cgi {
"--vertical-label=Sectors",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -692,6 +699,7 @@ sub disk_cgi {
"--vertical-label=Sectors",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -792,6 +800,7 @@ sub disk_cgi {
"--vertical-label=Sectors",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -819,6 +828,7 @@ sub disk_cgi {
"--vertical-label=Sectors",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2018 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -217,6 +217,7 @@ sub du_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -246,6 +247,9 @@ sub du_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -434,6 +438,7 @@ sub du_cgi {
"--vertical-label=$type_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -454,6 +459,7 @@ sub du_cgi {
"--vertical-label=$type_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -38,6 +38,7 @@ sub emailreports_send {
my $imgs_dir = $config->{imgs_dir};
my $images;
my $mime;
my $subject;
logger("$myself: sending $report reports.");
@ -175,6 +176,8 @@ EOF
$html .= $html_footer;
$subject = $emailreports->{subject_prefix} || "Monitorix:";
# create the multipart container and add attachments
foreach (split(',', $emailreports->{$report}->{to})) {
my $to = trim($_);
@ -182,7 +185,7 @@ EOF
my $msg = new MIME::Lite(
From => $emailreports->{from_address},
To => $to,
Subject => "Monitorix: '$report' Report",
Subject => "$subject '$report' Report",
Type => "multipart/related",
Organization => "Monitorix",
);

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -142,48 +142,70 @@ sub fail2ban_update {
my $str;
my $rrdata = "N";
if(! -r $config->{fail2ban_log}) {
logger("Couldn't find file '$config->{fail2ban_log}': $!");
return;
}
$seek_pos = $config->{fail2ban_hist} || 0;
$seek_pos = defined($seek_pos) ? int($seek_pos) : 0;
open(IN, $config->{fail2ban_log});
if(!seek(IN, 0, 2)) {
logger("Couldn't seek to the end of '$config->{fail2ban_log}': $!");
return;
}
$logsize = tell(IN);
if($logsize < $seek_pos) {
$seek_pos = 0;
}
if(!seek(IN, $seek_pos, 0)) {
logger("Couldn't seek to $seek_pos in '$config->{fail2ban_log}': $!");
return;
}
if($config->{fail2ban_hist} > 0) { # avoids initial peak
my $date = strftime("%Y-%m-%d", localtime);
while(<IN>) {
if(/^$date/) {
my $e = 0;
while($e < scalar(my @fl = split(',', $fail2ban->{list}))) {
my $e2 = 0;
foreach my $i (split(',', $fail2ban->{desc}->{$e})) {
($str = trim($i)) =~ s/\[/\\[/;
$str =~ s/\]/\\]/;
$jails[$e][$e2] = 0 unless defined $jails[$e][$e2];
if(/ $str Ban /) {
$jails[$e][$e2]++;
if(lc($fail2ban->{graph_mode} || "") ne "rate") {
my $e = 0;
while($e < scalar(my @fl = split(',', $fail2ban->{list}))) {
my $e2 = 0;
foreach my $i (split(',', $fail2ban->{desc}->{$e})) {
($str = trim($i)) =~ s/\[//;
$str =~ s/\]//;
$jails[$e][$e2] = 0 unless defined $jails[$e][$e2];
if(open(IN, "fail2ban-client status $str |")) {
while(<IN>) {
if(/- Currently banned:\s+(\d+)$/) {
$jails[$e][$e2] = $1;
}
$e2++;
}
$e++;
close(IN);
}
$e2++;
}
$e++;
}
} else {
if(! -r $config->{fail2ban_log}) {
logger("Couldn't find file '$config->{fail2ban_log}': $!");
return;
}
$seek_pos = $config->{fail2ban_hist} || 0;
$seek_pos = defined($seek_pos) ? int($seek_pos) : 0;
open(IN, $config->{fail2ban_log});
if(!seek(IN, 0, 2)) {
logger("Couldn't seek to the end of '$config->{fail2ban_log}': $!");
return;
}
$logsize = tell(IN);
if($logsize < $seek_pos) {
$seek_pos = 0;
}
if(!seek(IN, $seek_pos, 0)) {
logger("Couldn't seek to $seek_pos in '$config->{fail2ban_log}': $!");
return;
}
if($config->{fail2ban_hist} > 0) { # avoids initial peak
my $date = strftime("%Y-%m-%d", localtime);
while(<IN>) {
if(/^$date/) {
my $e = 0;
while($e < scalar(my @fl = split(',', $fail2ban->{list}))) {
my $e2 = 0;
foreach my $i (split(',', $fail2ban->{desc}->{$e})) {
($str = trim($i)) =~ s/\[/\\[/;
$str =~ s/\]/\\]/;
$jails[$e][$e2] = 0 unless defined $jails[$e][$e2];
if(/ $str Ban /) {
$jails[$e][$e2]++;
}
$e2++;
}
$e++;
}
}
}
}
close(IN);
}
close(IN);
my $e = 0;
while($e < scalar(my @fl = split(',', $fail2ban->{list}))) {
@ -227,12 +249,14 @@ sub fail2ban_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
my @tmp;
my @tmpz;
my @CDEF;
my $vlabel = "Bans";
my $n;
my $n2;
my $str;
@ -255,6 +279,12 @@ sub fail2ban_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
if(lc($fail2ban->{graph_mode} || "") eq "rate") {
$vlabel = "Bans/min";
}
$title = !$silent ? $title : "";
@ -370,11 +400,10 @@ sub fail2ban_cgi {
my $e = 0;
foreach my $i (split(',', $fail2ban->{desc}->{$n})) {
$str = sprintf("%-25s", substr(trim($i), 0, 25));
push(@tmp, "LINE1:j" . ($e + 1) . $LC[$e] . ":$str");
push(@tmp, "GPRINT:j" . ($e + 1) . ":LAST: Cur\\:%2.0lf\\g");
push(@tmp, "GPRINT:j" . ($e + 1) . ":AVERAGE: Avg\\:%2.0lf\\g");
push(@tmp, "GPRINT:j" . ($e + 1) . ":MIN: Min\\:%2.0lf\\g");
push(@tmp, "GPRINT:j" . ($e + 1) . ":MAX: Max\\:%2.0lf\\n");
push(@tmp, "LINE2:j" . ($e + 1) . $LC[$e] . ":$str");
push(@tmp, "GPRINT:j" . ($e + 1) . ":LAST:Cur\\:%4.0lf\\g");
push(@tmp, "GPRINT:j" . ($e + 1) . ":AVERAGE: Avg\\:%4.0lf\\g");
push(@tmp, "GPRINT:j" . ($e + 1) . ":MAX: Max\\:%4.0lf\\n");
push(@tmpz, "LINE2:j" . ($e + 1) . $LC[$e] . ":$str");
$e++;
}
@ -393,9 +422,10 @@ sub fail2ban_cgi {
"--title=$str ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=Bans/min",
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -421,9 +451,10 @@ sub fail2ban_cgi {
"--title=$str ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=Bans/min",
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -823,6 +823,7 @@ sub fs_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my $graph_title;
my $vlabel;
my @IMG;
@ -854,6 +855,9 @@ sub fs_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -1009,6 +1013,7 @@ sub fs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1035,6 +1040,7 @@ sub fs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1125,6 +1131,7 @@ sub fs_cgi {
"--vertical-label=Reads+Writes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1151,6 +1158,7 @@ sub fs_cgi {
"--vertical-label=Reads+Writes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1238,6 +1246,7 @@ sub fs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1264,6 +1273,7 @@ sub fs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1389,6 +1399,7 @@ sub fs_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1423,6 +1434,7 @@ sub fs_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -326,6 +326,7 @@ sub ftp_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -339,6 +340,9 @@ sub ftp_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -480,6 +484,7 @@ sub ftp_cgi {
"--vertical-label=Commands/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -505,6 +510,7 @@ sub ftp_cgi {
"--vertical-label=Commands/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -584,6 +590,7 @@ sub ftp_cgi {
"--vertical-label=Logins/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -607,6 +614,7 @@ sub ftp_cgi {
"--vertical-label=Logins/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -678,6 +686,7 @@ sub ftp_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -699,6 +708,7 @@ sub ftp_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -35,6 +35,7 @@ sub gensens_init {
my $gensens = $config->{gensens};
my $info;
my @ds;
my @rra;
my @tmp;
my $n;
@ -47,12 +48,21 @@ sub gensens_init {
if(-e $rrd) {
$info = RRDs::info($rrd);
for my $key (keys %$info) {
if(index($key, 'ds[') == 0) {
if(index($key, '.type') != -1) {
push(@ds, substr($key, 3, index($key, ']') - 3));
}
}
if(index($key, 'rra[') == 0) {
if(index($key, '.rows') != -1) {
push(@rra, substr($key, 4, index($key, ']') - 4));
}
}
}
if(scalar(@ds) / 9 != keys %{$gensens->{list}}) {
logger("$myself: Detected size mismatch between 'list' (" . keys(%{$gensens->{list}}) . ") and $rrd (" . scalar(@ds) / 9 . "). Resizing it accordingly. All historical data will be lost. Backup file created.");
rename($rrd, "$rrd.bak");
}
if(scalar(@rra) < 12 + (4 * $config->{max_historic_years})) {
logger("$myself: Detected size mismatch between 'max_historic_years' (" . $config->{max_historic_years} . ") and $rrd (" . ((scalar(@rra) -12) / 4) . "). Resizing it accordingly. All historical data will be lost. Backup file created.");
rename($rrd, "$rrd.bak");
@ -67,27 +77,21 @@ sub gensens_init {
push(@max, "RRA:MAX:0.5:1440:" . (365 * $n));
push(@last, "RRA:LAST:0.5:1440:" . (365 * $n));
}
for($n = 0; $n < keys %{$gensens->{list}}; $n++) {
push(@tmp, "DS:gensens" . $n . "_s1:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s2:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s3:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s4:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s5:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s6:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s7:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s8:GAUGE:120:0:U");
push(@tmp, "DS:gensens" . $n . "_s9:GAUGE:120:0:U")
}
eval {
RRDs::create($rrd,
"--step=60",
"DS:gensens0_s1:GAUGE:120:U:U",
"DS:gensens0_s2:GAUGE:120:U:U",
"DS:gensens0_s3:GAUGE:120:U:U",
"DS:gensens0_s4:GAUGE:120:U:U",
"DS:gensens0_s5:GAUGE:120:U:U",
"DS:gensens0_s6:GAUGE:120:U:U",
"DS:gensens0_s7:GAUGE:120:U:U",
"DS:gensens0_s8:GAUGE:120:U:U",
"DS:gensens0_s9:GAUGE:120:U:U",
"DS:gensens1_s1:GAUGE:120:U:U",
"DS:gensens1_s2:GAUGE:120:U:U",
"DS:gensens1_s3:GAUGE:120:U:U",
"DS:gensens1_s4:GAUGE:120:U:U",
"DS:gensens1_s5:GAUGE:120:U:U",
"DS:gensens1_s6:GAUGE:120:U:U",
"DS:gensens1_s7:GAUGE:120:U:U",
"DS:gensens1_s8:GAUGE:120:U:U",
"DS:gensens1_s9:GAUGE:120:U:U",
@tmp,
"RRA:AVERAGE:0.5:1:1440",
"RRA:AVERAGE:0.5:30:336",
"RRA:AVERAGE:0.5:60:744",
@ -269,6 +273,7 @@ sub gensens_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $temp_scale = "Celsius";
my @IMG;
@ -298,6 +303,9 @@ sub gensens_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -324,20 +332,19 @@ sub gensens_cgi {
my $line3;
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
push(@output, " ");
for($n = 0; $n < 2; $n++) {
foreach my $sg (sort keys %{$gensens->{list}}) {
$line1 = "";
foreach my $i (split(',', $gensens->{list}->{$n})) {
foreach my $i (split(',', $gensens->{list}->{$sg})) {
$i = trim($i);
$str = $i;
$str = sprintf("%10s", substr($str, 0, 10));
$line1 .= " ";
$line2 .= sprintf(" %10s", $str);
$line3 .= "-----------";
$str = sprintf("%12s", substr($str, 0, 10));
$line1 .= " ";
$line2 .= sprintf(" %12s", $str);
$line3 .= "-------------";
}
if($line1) {
my $i = length($line1);
$str = "_gensens" . ($n + 1);
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($config->{graphs}->{$str})))));
push(@output, substr(sprintf("%${i}s", sprintf("%s", trim($gensens->{title}->{$sg}))), 0, 13));
}
}
push(@output, "\n");
@ -347,22 +354,22 @@ sub gensens_cgi {
my @row;
my $time;
my $n2;
my $n3;
my $from;
my $to;
for($n = 0, $time = $tf->{tb}; $n < ($tf->{tb} * $tf->{ts}); $n++) {
$line = @$data[$n];
$time = $time - (1 / $tf->{ts});
push(@output, sprintf(" %2d$tf->{tc} ", $time));
for($n2 = 0; $n2 < 2; $n2++) {
$n3 = 0;
foreach my $i (split(',', $gensens->{list}->{$n2})) {
$from = $n2 * 9 + $n3++;
foreach my $sg (sort keys %{$gensens->{list}}) {
$n2 = 0;
foreach my $i (split(',', $gensens->{list}->{$sg})) {
$from = $sg * 9 + $n2++;
$to = $from + 1;
my ($j) = @$line[$from..$to];
@row = ($j);
push(@output, sprintf("%10d ", @row));
@row = ($j || 0);
push(@output, sprintf("%12d ", @row));
}
$n2++;
}
push(@output, "\n");
}
@ -399,235 +406,161 @@ sub gensens_cgi {
}
}
my (@ls, $max, @sg);
$max = max(scalar(@sg = split(',', $gensens->{list}->{0}), @sg = split(',', $gensens->{list}->{1})));
# Temperatures
if($title) {
push(@output, main::graph_header($title, 2));
push(@output, " <tr>\n");
}
@riglim = @{setup_riglim($rigid[0], $limit[0])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
@ls = split(',', $gensens->{list}->{0});
for($n = 0; $n < 9; $n++) {
my $str = trim($ls[$n] || "");
if($str) {
$str = $gensens->{map}->{$str} ? $gensens->{map}->{$str} : $str;
$str = sprintf("%-20s", substr($str, 0, 20));
push(@tmp, "LINE2:gsen" . $n . $LC[$n] . ":$str");
push(@tmp, "GPRINT:gsen" . $n . ":LAST: Cur\\:%5.1lf%s");
push(@tmp, "GPRINT:gsen" . $n . ":MIN: Min\\:%5.1lf%s");
push(@tmp, "GPRINT:gsen" . $n . ":MAX: Max\\:%5.1lf%s\\n");
push(@tmpz, "LINE2:gsen" . $n . $LC[$n] . ":$str");
next;
my @linpad =(0);
my $e = 0;
foreach my $sg (sort keys %{$gensens->{list}}) {
my @ls = split(',', $gensens->{list}->{$sg});
$linpad[$e] = scalar(@ls);
if($e && $e % 2) {
$linpad[$e] = max($linpad[$e - 1], $linpad[$e]);
$linpad[$e - 1] = $linpad[$e];
}
last;
$e++;
}
while($n < $max) {
push(@tmp, "COMMENT: \\n");
$n++;
}
if($title) {
push(@output, " <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}->{medium});
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[0]",
"--title=$config->{graphs}->{_gensens1} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:gsen0=$rrd:gensens0_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens0_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens0_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens0_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens0_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens0_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens0_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens0_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens0_s9:AVERAGE",
"CDEF:allvalues=gsen0,gsen1,gsen2,gsen3,gsen4,gsen5,gsen6,gsen7,gsen8,+,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[0]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom});
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[0]",
"--title=$config->{graphs}->{_gensens1} ($tf->{nwhen}$tf->{twhen})",
my $vlabel;
$e = 0;
foreach my $sg (sort keys %{$gensens->{list}}) {
my @ls = split(',', $gensens->{list}->{$sg});
# determine if we are dealing with a 'temp', 'cpu' or 'bat' graph
if(index($ls[0], "temp") == 0) {
$vlabel = $temp_scale;
} elsif(index($ls[0], "cpu") == 0) {
$vlabel = "Hz";
} elsif(index($ls[0], "bat") == 0) {
$vlabel = "Charge";
} else {
# not supported yet
}
if(!$e) {
if($title) {
push(@output, main::graph_header($title, 2));
push(@output, " <tr>\n");
}
}
@riglim = @{setup_riglim($rigid[$e], $limit[$e])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
for($n = 0; $n < 9; $n++) {
my $str = trim($ls[$n] || "");
if($str) {
$str = $gensens->{map}->{$str} ? $gensens->{map}->{$str} : $str;
$str = sprintf("%-20s", substr($str, 0, 20));
push(@tmp, "LINE2:gsen" . $n . $LC[$n] . ":$str");
push(@tmp, "GPRINT:gsen" . $n . ":LAST: Cur\\:%5.1lf%s");
push(@tmp, "GPRINT:gsen" . $n . ":MIN: Min\\:%5.1lf%s");
push(@tmp, "GPRINT:gsen" . $n . ":MAX: Max\\:%5.1lf%s\\n");
push(@tmpz, "LINE2:gsen" . $n . $LC[$n] . ":$str");
next;
}
last;
}
while($n < $linpad[$e]) {
push(@tmp, "COMMENT: \\n");
$n++;
}
if($title) {
push(@output, " <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}->{medium});
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$e]",
"--title=$gensens->{title}->{$sg} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=$temp_scale",
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:gsen0=$rrd:gensens0_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens0_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens0_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens0_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens0_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens0_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens0_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens0_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens0_s9:AVERAGE",
"DEF:gsen0=$rrd:gensens" . $e . "_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens" . $e . "_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens" . $e . "_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens" . $e . "_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens" . $e . "_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens" . $e . "_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens" . $e . "_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens" . $e . "_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens" . $e . "_s9:AVERAGE",
"CDEF:allvalues=gsen0,gsen1,gsen2,gsen3,gsen4,gsen5,gsen6,gsen7,gsen8,+,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
@tmp);
$err = RRDs::error;
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[0]: $err\n") if $err;
}
if($title || ($silent =~ /imagetag/ && $graph =~ /gensens0/)) {
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") {
if(lc($config->{disable_javascript_void}) eq "y") {
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[0] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[0] . "' border='0'></a>\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
($width, $height) = split('x', $config->{graph_size}->{zoom});
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e]",
"--title=$gensens->{title}->{$sg} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:gsen0=$rrd:gensens" . $e . "_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens" . $e . "_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens" . $e . "_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens" . $e . "_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens" . $e . "_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens" . $e . "_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens" . $e . "_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens" . $e . "_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens" . $e . "_s9:AVERAGE",
"CDEF:allvalues=gsen0,gsen1,gsen2,gsen3,gsen4,gsen5,gsen6,gsen7,gsen8,+,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e]: $err\n") if $err;
}
if($title || ($silent =~ /imagetag/ && $graph =~ /gensens0/)) {
if(lc($config->{enable_zoom}) eq "y") {
if(lc($config->{disable_javascript_void}) eq "y") {
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e] . "' border='0'></a>\n");
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e] . "' border='0'></a>\n");
}
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[0] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[0] . "' border='0'></a>\n");
}
} else {
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[0] . "'>\n");
}
}
if($title) {
push(@output, " </td>\n");
}
# CPU frequency
@riglim = @{setup_riglim($rigid[1], $limit[1])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
@ls = split(',', $gensens->{list}->{1});
for($n = 0; $n < 9; $n++) {
my $str = trim($ls[$n] || "");
if($str) {
$str = $gensens->{map}->{$str} ? $gensens->{map}->{$str} : $str;
$str = sprintf("%-20s", substr($str, 0, 20));
push(@tmp, "LINE2:gsen" . $n . $LC[$n] . ":$str");
push(@tmp, "GPRINT:gsen" . $n . ":LAST: Cur\\:%4.1lf%shz");
push(@tmp, "GPRINT:gsen" . $n . ":MIN: Min\\:%4.1lf%shz");
push(@tmp, "GPRINT:gsen" . $n . ":MAX: Max\\:%4.1lf%shz\\n");
push(@tmpz, "LINE2:gsen" . $n . $LC[$n] . ":$str");
next;
}
last;
}
while($n < $max) {
push(@tmp, "COMMENT: \\n");
$n++;
}
if($title) {
push(@output, " <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}->{medium});
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[1]",
"--title=$config->{graphs}->{_gensens2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:gsen0=$rrd:gensens1_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens1_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens1_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens1_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens1_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens1_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens1_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens1_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens1_s9:AVERAGE",
"CDEF:allvalues=gsen0,gsen1,gsen2,gsen3,gsen4,gsen5,gsen6,gsen7,gsen8,+,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[1]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom});
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[1]",
"--title=$config->{graphs}->{_gensens2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc",
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:gsen0=$rrd:gensens1_s1:AVERAGE",
"DEF:gsen1=$rrd:gensens1_s2:AVERAGE",
"DEF:gsen2=$rrd:gensens1_s3:AVERAGE",
"DEF:gsen3=$rrd:gensens1_s4:AVERAGE",
"DEF:gsen4=$rrd:gensens1_s5:AVERAGE",
"DEF:gsen5=$rrd:gensens1_s6:AVERAGE",
"DEF:gsen6=$rrd:gensens1_s7:AVERAGE",
"DEF:gsen7=$rrd:gensens1_s8:AVERAGE",
"DEF:gsen8=$rrd:gensens1_s9:AVERAGE",
"CDEF:allvalues=gsen0,gsen1,gsen2,gsen3,gsen4,gsen5,gsen6,gsen7,gsen8,+,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[1]: $err\n") if $err;
}
if($title || ($silent =~ /imagetag/ && $graph =~ /gensens1/)) {
if(lc($config->{enable_zoom}) eq "y") {
if(lc($config->{disable_javascript_void}) eq "y") {
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[1] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[1] . "' border='0'></a>\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[1] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[1] . "' border='0'></a>\n");
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e] . "'>\n");
}
} else {
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[1] . "'>\n");
}
if($title) {
push(@output, " </td>\n");
}
$e++;
if(!($e % 2)) {
push(@output, " </tr>\n");
push(@output, " <tr>\n");
}
}
if($title) {
push(@output, " </td>\n");
push(@output, " </tr>\n");
push(@output, main::graph_footer());
}

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -270,6 +270,7 @@ sub hptemp_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $temp_scale = "Celsius";
my @tmp;
@ -296,6 +297,9 @@ sub hptemp_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -479,6 +483,7 @@ sub hptemp_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -506,6 +511,7 @@ sub hptemp_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -610,6 +616,7 @@ sub hptemp_cgi {
"--width=$width",
"--height=$height",
"--lower-limit=0",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -635,6 +642,7 @@ sub hptemp_cgi {
"--width=$width",
"--height=$height",
"--lower-limit=0",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -733,6 +741,7 @@ sub hptemp_cgi {
"--width=$width",
"--height=$height",
"--lower-limit=0",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -758,6 +767,7 @@ sub hptemp_cgi {
"--width=$width",
"--height=$height",
"--lower-limit=0",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -243,6 +243,7 @@ sub icecast_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -283,6 +284,9 @@ sub icecast_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -448,6 +452,7 @@ sub icecast_cgi {
"--vertical-label=Listeners",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -475,6 +480,7 @@ sub icecast_cgi {
"--vertical-label=Listeners",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -549,6 +555,7 @@ sub icecast_cgi {
"--vertical-label=Bitrate",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -576,6 +583,7 @@ sub icecast_cgi {
"--vertical-label=Bitrate",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -451,6 +451,7 @@ sub int_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @CDEF;
my @allvalues1;
@ -826,6 +827,9 @@ sub int_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -1062,6 +1066,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1081,6 +1086,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1137,6 +1143,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1157,6 +1164,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1210,6 +1218,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1230,6 +1239,7 @@ sub int_cgi {
"--vertical-label=Ticks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -234,6 +234,7 @@ sub ipmi_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -262,6 +263,9 @@ sub ipmi_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -403,6 +407,7 @@ sub ipmi_cgi {
"--vertical-label=$unit",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -431,6 +436,7 @@ sub ipmi_cgi {
"--vertical-label=$unit",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -399,6 +399,7 @@ sub kern_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -413,6 +414,9 @@ sub kern_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -705,6 +709,7 @@ sub kern_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -731,6 +736,7 @@ sub kern_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -815,6 +821,7 @@ sub kern_cgi {
"--vertical-label=CS & forks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -837,6 +844,7 @@ sub kern_cgi {
"--vertical-label=CS & forks/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -914,6 +922,7 @@ sub kern_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -936,6 +945,7 @@ sub kern_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -315,6 +315,7 @@ sub libvirt_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my $graph_title;
my @IMG;
my @IMGz;
@ -347,6 +348,9 @@ sub libvirt_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -517,6 +521,7 @@ sub libvirt_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -543,6 +548,7 @@ sub libvirt_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -628,6 +634,7 @@ sub libvirt_cgi {
"--vertical-label=Bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -662,6 +669,7 @@ sub libvirt_cgi {
"--vertical-label=Bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -752,6 +760,7 @@ sub libvirt_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -786,6 +795,7 @@ sub libvirt_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -898,6 +908,7 @@ sub libvirt_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -924,6 +935,7 @@ sub libvirt_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -223,6 +223,7 @@ sub lighttpd_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -243,6 +244,9 @@ sub lighttpd_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -388,6 +392,7 @@ sub lighttpd_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -412,6 +417,7 @@ sub lighttpd_cgi {
"--vertical-label=Workers",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -484,6 +490,7 @@ sub lighttpd_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -504,6 +511,7 @@ sub lighttpd_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -566,6 +574,7 @@ sub lighttpd_cgi {
"--vertical-label=Accesses/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -586,6 +595,7 @@ sub lighttpd_cgi {
"--vertical-label=Accesses/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -404,6 +404,7 @@ sub lmsens_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $temp_scale = "Celsius";
my @tmp;
@ -438,6 +439,9 @@ sub lmsens_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -712,6 +716,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -746,6 +751,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -905,6 +911,7 @@ sub lmsens_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -935,6 +942,7 @@ sub lmsens_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1046,6 +1054,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1072,6 +1081,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1172,6 +1182,7 @@ sub lmsens_cgi {
"--vertical-label=RPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1201,6 +1212,7 @@ sub lmsens_cgi {
"--vertical-label=RPM",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1327,6 +1339,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1356,6 +1369,7 @@ sub lmsens_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -733,6 +733,7 @@ sub mail_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $T = "B";
my $vlabel = "bytes/s";
@ -752,6 +753,9 @@ sub mail_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -1082,6 +1086,7 @@ sub mail_cgi {
"--vertical-label=$rate_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1117,6 +1122,7 @@ sub mail_cgi {
"--vertical-label=$rate_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1213,6 +1219,7 @@ sub mail_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1237,6 +1244,7 @@ sub mail_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1304,6 +1312,7 @@ sub mail_cgi {
"--vertical-label=Messages",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1324,6 +1333,7 @@ sub mail_cgi {
"--vertical-label=Messages",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1385,6 +1395,7 @@ sub mail_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1406,6 +1417,7 @@ sub mail_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1474,6 +1486,7 @@ sub mail_cgi {
"--vertical-label=Messages",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1497,6 +1510,7 @@ sub mail_cgi {
"--vertical-label=Messages",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1585,6 +1599,7 @@ sub mail_cgi {
"--vertical-label=$rate_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1608,6 +1623,7 @@ sub mail_cgi {
"--vertical-label=$rate_label",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -418,6 +418,7 @@ sub memcached_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -437,6 +438,9 @@ sub memcached_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -645,6 +649,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -675,6 +680,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -778,6 +784,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -809,6 +816,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -882,6 +890,7 @@ sub memcached_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -905,6 +914,7 @@ sub memcached_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -965,6 +975,7 @@ sub memcached_cgi {
"--vertical-label=Items",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -985,6 +996,7 @@ sub memcached_cgi {
"--vertical-label=Items",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1051,6 +1063,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1073,6 +1086,7 @@ sub memcached_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1141,6 +1155,7 @@ sub memcached_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1163,6 +1178,7 @@ sub memcached_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1234,6 +1250,7 @@ sub memcached_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1255,6 +1272,7 @@ sub memcached_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -595,6 +595,7 @@ sub mongodb_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -616,6 +617,9 @@ sub mongodb_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -828,6 +832,7 @@ sub mongodb_cgi {
"--vertical-label=Operations/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -853,6 +858,7 @@ sub mongodb_cgi {
"--vertical-label=Operations/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -935,6 +941,7 @@ sub mongodb_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -958,6 +965,7 @@ sub mongodb_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1027,6 +1035,7 @@ sub mongodb_cgi {
"--vertical-label=ms",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1048,6 +1057,7 @@ sub mongodb_cgi {
"--vertical-label=ms",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1112,6 +1122,7 @@ sub mongodb_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1133,6 +1144,7 @@ sub mongodb_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1197,6 +1209,7 @@ sub mongodb_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1218,6 +1231,7 @@ sub mongodb_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1295,6 +1309,7 @@ sub mongodb_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1316,6 +1331,7 @@ sub mongodb_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1410,6 +1426,7 @@ sub mongodb_cgi {
"--vertical-label=Values",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1432,6 +1449,7 @@ sub mongodb_cgi {
"--vertical-label=Values",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1505,6 +1523,7 @@ sub mongodb_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1527,6 +1546,7 @@ sub mongodb_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -508,6 +508,7 @@ sub mysql_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -528,6 +529,9 @@ sub mysql_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -731,6 +735,7 @@ sub mysql_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -759,6 +764,7 @@ sub mysql_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -865,6 +871,7 @@ sub mysql_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -890,6 +897,7 @@ sub mysql_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -967,6 +975,7 @@ sub mysql_cgi {
"--vertical-label=Open & Locks/min",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -988,6 +997,7 @@ sub mysql_cgi {
"--vertical-label=Open & Locks/min",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1057,6 +1067,7 @@ sub mysql_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1078,6 +1089,7 @@ sub mysql_cgi {
"--vertical-label=Queries/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1152,6 +1164,7 @@ sub mysql_cgi {
"--vertical-label=Connectionss/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1174,6 +1187,7 @@ sub mysql_cgi {
"--vertical-label=Connectionss/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1252,6 +1266,7 @@ sub mysql_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1273,6 +1288,7 @@ sub mysql_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -270,6 +270,7 @@ sub net_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $netname;
my @tmp;
@ -287,6 +288,9 @@ sub net_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -463,6 +467,7 @@ sub net_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -489,6 +494,7 @@ sub net_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -562,6 +568,7 @@ sub net_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -583,6 +590,7 @@ sub net_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -653,6 +661,7 @@ sub net_cgi {
"--vertical-label=Errors/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -674,6 +683,7 @@ sub net_cgi {
"--vertical-label=Errors/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -375,6 +375,7 @@ sub netstat_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -388,6 +389,9 @@ sub netstat_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -532,6 +536,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -557,6 +562,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -657,6 +663,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -682,6 +689,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -761,6 +769,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -785,6 +794,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -864,6 +874,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -890,6 +901,7 @@ sub netstat_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -957,6 +969,7 @@ sub netstat_cgi {
"--vertical-label=Listen",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -979,6 +992,7 @@ sub netstat_cgi {
"--vertical-label=Listen",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -240,6 +240,7 @@ sub nfsc_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -284,6 +285,9 @@ sub nfsc_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
my @nfsv2 = ("null", "getattr", "setattr", "root", "lookup", "readlink", "read", "wrcache", "write", "create", "remove", "rename", "link", "symlink", "mkdir", "rmdir", "readdir", "fsstat");
my @nfsv3 = ("null", "getattr", "setattr", "lookup", "access", "readlink", "read", "write", "create", "mkdir", "symlink", "mknod", "remove", "rmdir", "rename", "link", "readdir", "readdirplus", "fsstat", "fsinfo", "pathconf", "commit");
@ -445,6 +449,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -464,6 +469,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -539,6 +545,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -557,6 +564,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -642,6 +650,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -661,6 +670,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -743,6 +753,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -762,6 +773,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -844,6 +856,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -863,6 +876,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -933,6 +947,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -955,6 +970,7 @@ sub nfsc_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -375,6 +375,7 @@ sub nfss_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -415,6 +416,9 @@ sub nfss_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
my @nfsv2 = ("null", "getattr", "setattr", "root", "lookup", "readlink", "read", "wrcache", "write", "create", "remove", "rename", "link", "symlink", "mkdir", "rmdir", "readdir", "fsstat");
my @nfsv3 = ("null", "getattr", "setattr", "lookup", "access", "readlink", "read", "write", "create", "mkdir", "symlink", "mknod", "remove", "rmdir", "rename", "link", "readdir", "readdirplus", "fsstat", "fsinfo", "pathconf", "commit");
@ -607,6 +611,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -626,6 +631,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -701,6 +707,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -719,6 +726,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -794,6 +802,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -812,6 +821,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -882,6 +892,7 @@ sub nfss_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -903,6 +914,7 @@ sub nfss_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -975,6 +987,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -998,6 +1011,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1072,6 +1086,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1096,6 +1111,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1189,6 +1205,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1219,6 +1236,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1300,6 +1318,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1322,6 +1341,7 @@ sub nfss_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1395,6 +1415,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1419,6 +1440,7 @@ sub nfss_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -269,6 +269,7 @@ sub nginx_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @warning;
my @tmp;
@ -285,6 +286,9 @@ sub nginx_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -424,6 +428,7 @@ sub nginx_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -447,6 +452,7 @@ sub nginx_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -514,6 +520,7 @@ sub nginx_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -534,6 +541,7 @@ sub nginx_cgi {
"--vertical-label=Requests/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -644,6 +652,7 @@ sub nginx_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -666,6 +675,7 @@ sub nginx_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -216,6 +216,7 @@ sub ntp_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -247,6 +248,9 @@ sub ntp_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -405,6 +409,7 @@ sub ntp_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -430,6 +435,7 @@ sub ntp_cgi {
"--vertical-label=Seconds",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -493,6 +499,7 @@ sub ntp_cgi {
"--vertical-label=Level",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -513,6 +520,7 @@ sub ntp_cgi {
"--vertical-label=Level",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -579,6 +587,7 @@ sub ntp_cgi {
"--vertical-label=Hits",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -608,6 +617,7 @@ sub ntp_cgi {
"--vertical-label=Hits",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -266,6 +266,7 @@ sub nut_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my $temp_scale = "Celsius";
my @riglim;
my @IMG;
@ -286,6 +287,9 @@ sub nut_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -480,6 +484,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -505,6 +510,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -582,6 +588,7 @@ sub nut_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -607,6 +614,7 @@ sub nut_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -684,6 +692,7 @@ sub nut_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -706,6 +715,7 @@ sub nut_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -771,6 +781,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -792,6 +803,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -856,6 +868,7 @@ sub nut_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -879,6 +892,7 @@ sub nut_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -942,6 +956,7 @@ sub nut_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -962,6 +977,7 @@ sub nut_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -296,6 +296,7 @@ sub nvidia_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $temp_scale = "Celsius";
my @tmp;
@ -321,6 +322,9 @@ sub nvidia_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -477,6 +481,7 @@ sub nvidia_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -506,6 +511,7 @@ sub nvidia_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -594,6 +600,7 @@ sub nvidia_cgi {
"--vertical-label=Percent",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -623,6 +630,7 @@ sub nvidia_cgi {
"--vertical-label=Percent",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -708,6 +716,7 @@ sub nvidia_cgi {
"--vertical-label=Percent",
"--width=$width",
"--height=$height",
@extra,
@riglim,
@{$cgi->{version12}},
$zoom,
@ -737,6 +746,7 @@ sub nvidia_cgi {
"--vertical-label=Percent",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -659,6 +659,7 @@ sub pagespeed_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -678,6 +679,9 @@ sub pagespeed_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -866,6 +870,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -894,6 +899,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -999,6 +1005,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1024,6 +1031,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1107,6 +1115,7 @@ sub pagespeed_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1133,6 +1142,7 @@ sub pagespeed_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1210,6 +1220,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1235,6 +1246,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1307,6 +1319,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1332,6 +1345,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1401,6 +1415,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1425,6 +1440,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1496,6 +1512,7 @@ sub pagespeed_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1521,6 +1538,7 @@ sub pagespeed_cgi {
"--vertical-label=Value/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1578,6 +1596,7 @@ sub pagespeed_cgi {
"--vertical-label=Microseconds/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1598,6 +1617,7 @@ sub pagespeed_cgi {
"--vertical-label=Microseconds/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -219,6 +219,7 @@ sub phpapc_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -238,6 +239,9 @@ sub phpapc_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -409,6 +413,7 @@ sub phpapc_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -433,6 +438,7 @@ sub phpapc_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -505,6 +511,7 @@ sub phpapc_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -526,6 +533,7 @@ sub phpapc_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -589,6 +597,7 @@ sub phpapc_cgi {
"--vertical-label=Cached files/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -611,6 +620,7 @@ sub phpapc_cgi {
"--vertical-label=Cached files/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -154,6 +154,12 @@ sub phpfpm_update {
foreach my $pfg (sort keys %{$phpfpm->{group}}) {
my @pfl = split(',', $phpfpm->{list}->{$pfg});
if(!scalar(@pfl)) {
for($n = 0; $n < 8; $n++) {
$rrdata .= ":0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0";
}
next;
}
for($n = 0; $n < 8; $n++) {
my $uptim = 0;
my $aconn = 0;
@ -167,11 +173,6 @@ sub phpfpm_update {
my $ssl = "";
my $pool = trim($pfl[$n] || "");
if(!$pool) {
$rrdata .= ":0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0";
next;
}
my $url = $phpfpm->{desc}->{$pool} || "";
if(!$url) {
logger("$myself: ERROR: the pool '$pool' don't has an associated URL.");
@ -256,6 +257,7 @@ sub phpfpm_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -286,6 +288,9 @@ sub phpfpm_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -310,6 +315,9 @@ sub phpfpm_cgi {
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
push(@output, " ");
foreach my $pfg (sort keys %{$phpfpm->{group}}) {
if(!scalar(my @pfl = split(',', $phpfpm->{list}->{$pfg}))) {
next;
}
$line1 = " ";
$line2 .= " ";
$line3 .= " ";
@ -322,10 +330,8 @@ sub phpfpm_cgi {
$line3 .= " aconn lqueue mlqueu idproc acproc macpro mchild slwreq";
$line4 .= "---------------------------------------------------------------";
}
if($line1) {
my $i = length($line1);
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($phpfpm->{group}->{$pfg})))));
}
my $i = length($line1);
push(@output, sprintf("%${i}s", sprintf("%s", trim($phpfpm->{group}->{$pfg}))));
}
push(@output, "\n");
push(@output, " $line2\n");
@ -344,6 +350,9 @@ sub phpfpm_cgi {
push(@output, sprintf(" %2d$tf->{tc} ", $time));
$n3 = 0;
foreach my $pfg (sort keys %{$phpfpm->{group}}) {
if(!scalar(my @pfl = split(',', $phpfpm->{list}->{$pfg}))) {
next;
}
for($n2 = 0; $n2 < scalar(my @pfl = split(',', $phpfpm->{list}->{$pfg})); $n2++) {
$from = $n2 * 18 + ($n3 * 144);
$to = $from + 18;
@ -406,10 +415,13 @@ sub phpfpm_cgi {
$uptimeline = "COMMENT:uptime: " . uptime2str($uptime) . "\\c";
}
$e = 0;
$e = $n2 = 0;
foreach my $pfg (sort keys %{$phpfpm->{group}}) {
# skip empty lists
next if !$phpfpm->{list}->{$pfg};
if(!scalar(my @pfl = split(',', $phpfpm->{list}->{$pfg}))) {
$n2++;
next;
}
if($e) {
push(@output, " <br>\n");
@ -427,12 +439,12 @@ sub phpfpm_cgi {
$str = trim($pfl[$n]);
$str = $phpfpm->{map}->{$str} ? $phpfpm->{map}->{$str} : $str;
my $dstr = sprintf("%-25s", substr($str, 0, 25));
push(@tmp, "LINE2:acon" . $e . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:acon" . $e . "_$n" . $LC[$n] . ":$str");
push(@tmp, "GPRINT:acon" . $e . "_$n" . ":LAST: Cur\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $e . "_$n" . ":AVERAGE: Avg\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $e . "_$n" . ":MIN: Min\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $e . "_$n" . ":MAX: Max\\:%5.2lf\\n");
push(@tmp, "LINE2:acon" . $n2 . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:acon" . $n2 . "_$n" . $LC[$n] . ":$str");
push(@tmp, "GPRINT:acon" . $n2 . "_$n" . ":LAST: Cur\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $n2 . "_$n" . ":AVERAGE: Avg\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $n2 . "_$n" . ":MIN: Min\\:%5.2lf");
push(@tmp, "GPRINT:acon" . $n2 . "_$n" . ":MAX: Max\\:%5.2lf\\n");
}
if($title) {
@ -455,19 +467,20 @@ sub phpfpm_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:acon" . $e . "_0=$rrd:phpfpm" . $e . "_aconn0:AVERAGE",
"DEF:acon" . $e . "_1=$rrd:phpfpm" . $e . "_aconn1:AVERAGE",
"DEF:acon" . $e . "_2=$rrd:phpfpm" . $e . "_aconn2:AVERAGE",
"DEF:acon" . $e . "_3=$rrd:phpfpm" . $e . "_aconn3:AVERAGE",
"DEF:acon" . $e . "_4=$rrd:phpfpm" . $e . "_aconn4:AVERAGE",
"DEF:acon" . $e . "_5=$rrd:phpfpm" . $e . "_aconn5:AVERAGE",
"DEF:acon" . $e . "_6=$rrd:phpfpm" . $e . "_aconn6:AVERAGE",
"DEF:acon" . $e . "_7=$rrd:phpfpm" . $e . "_aconn7:AVERAGE",
"CDEF:allvalues=acon" . $e . "_0,acon" . $e . "_1,acon" . $e . "_2,acon" . $e . "_3,acon" . $e . "_4,acon" . $e . "_5,acon" . $e . "_6,acon" . $e . "_7,+,+,+,+,+,+,+",
"DEF:acon" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aconn0:AVERAGE",
"DEF:acon" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aconn1:AVERAGE",
"DEF:acon" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aconn2:AVERAGE",
"DEF:acon" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aconn3:AVERAGE",
"DEF:acon" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aconn4:AVERAGE",
"DEF:acon" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aconn5:AVERAGE",
"DEF:acon" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aconn6:AVERAGE",
"DEF:acon" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aconn7:AVERAGE",
"CDEF:allvalues=acon" . $n2 . "_0,acon" . $n2 . "_1,acon" . $n2 . "_2,acon" . $n2 . "_3,acon" . $n2 . "_4,acon" . $n2 . "_5,acon" . $n2 . "_6,acon" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmp,
$uptimeline);
@ -482,19 +495,20 @@ sub phpfpm_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:acon" . $e . "_0=$rrd:phpfpm" . $e . "_aconn0:AVERAGE",
"DEF:acon" . $e . "_1=$rrd:phpfpm" . $e . "_aconn1:AVERAGE",
"DEF:acon" . $e . "_2=$rrd:phpfpm" . $e . "_aconn2:AVERAGE",
"DEF:acon" . $e . "_3=$rrd:phpfpm" . $e . "_aconn3:AVERAGE",
"DEF:acon" . $e . "_4=$rrd:phpfpm" . $e . "_aconn4:AVERAGE",
"DEF:acon" . $e . "_5=$rrd:phpfpm" . $e . "_aconn5:AVERAGE",
"DEF:acon" . $e . "_6=$rrd:phpfpm" . $e . "_aconn6:AVERAGE",
"DEF:acon" . $e . "_7=$rrd:phpfpm" . $e . "_aconn7:AVERAGE",
"CDEF:allvalues=acon" . $e . "_0,acon" . $e . "_1,acon" . $e . "_2,acon" . $e . "_3,acon" . $e . "_4,acon" . $e . "_5,acon" . $e . "_6,acon" . $e . "_7,+,+,+,+,+,+,+",
"DEF:acon" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aconn0:AVERAGE",
"DEF:acon" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aconn1:AVERAGE",
"DEF:acon" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aconn2:AVERAGE",
"DEF:acon" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aconn3:AVERAGE",
"DEF:acon" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aconn4:AVERAGE",
"DEF:acon" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aconn5:AVERAGE",
"DEF:acon" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aconn6:AVERAGE",
"DEF:acon" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aconn7:AVERAGE",
"CDEF:allvalues=acon" . $n2 . "_0,acon" . $n2 . "_1,acon" . $n2 . "_2,acon" . $n2 . "_3,acon" . $n2 . "_4,acon" . $n2 . "_5,acon" . $n2 . "_6,acon" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
@ -528,12 +542,12 @@ sub phpfpm_cgi {
$str = trim($pfl[$n]);
$str = $phpfpm->{map}->{$str} ? $phpfpm->{map}->{$str} : $str;
my $dstr = sprintf("%-25s", substr($str, 0, 25));
push(@tmp, "LINE2:aproc" . $e . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:aproc" . $e . "_$n" . $LC[$n] . ":$str");
push(@tmp, "GPRINT:aproc" . $e . "_$n" . ":LAST: Cur\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $e . "_$n" . ":AVERAGE: Avg\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $e . "_$n" . ":MIN: Min\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $e . "_$n" . ":MAX: Max\\:%5.2lf\\n");
push(@tmp, "LINE2:aproc" . $n2 . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:aproc" . $n2 . "_$n" . $LC[$n] . ":$str");
push(@tmp, "GPRINT:aproc" . $n2 . "_$n" . ":LAST: Cur\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $n2 . "_$n" . ":AVERAGE: Avg\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $n2 . "_$n" . ":MIN: Min\\:%5.2lf");
push(@tmp, "GPRINT:aproc" . $n2 . "_$n" . ":MAX: Max\\:%5.2lf\\n");
}
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
@ -551,19 +565,20 @@ sub phpfpm_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:aproc" . $e . "_0=$rrd:phpfpm" . $e . "_aproc0:AVERAGE",
"DEF:aproc" . $e . "_1=$rrd:phpfpm" . $e . "_aproc1:AVERAGE",
"DEF:aproc" . $e . "_2=$rrd:phpfpm" . $e . "_aproc2:AVERAGE",
"DEF:aproc" . $e . "_3=$rrd:phpfpm" . $e . "_aproc3:AVERAGE",
"DEF:aproc" . $e . "_4=$rrd:phpfpm" . $e . "_aproc4:AVERAGE",
"DEF:aproc" . $e . "_5=$rrd:phpfpm" . $e . "_aproc5:AVERAGE",
"DEF:aproc" . $e . "_6=$rrd:phpfpm" . $e . "_aproc6:AVERAGE",
"DEF:aproc" . $e . "_7=$rrd:phpfpm" . $e . "_aproc7:AVERAGE",
"CDEF:allvalues=aproc" . $e . "_0,aproc" . $e . "_1,aproc" . $e . "_2,aproc" . $e . "_3,aproc" . $e . "_4,aproc" . $e . "_5,aproc" . $e . "_6,aproc" . $e . "_7,+,+,+,+,+,+,+",
"DEF:aproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aproc0:AVERAGE",
"DEF:aproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aproc1:AVERAGE",
"DEF:aproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aproc2:AVERAGE",
"DEF:aproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aproc3:AVERAGE",
"DEF:aproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aproc4:AVERAGE",
"DEF:aproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aproc5:AVERAGE",
"DEF:aproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aproc6:AVERAGE",
"DEF:aproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aproc7:AVERAGE",
"CDEF:allvalues=aproc" . $n2 . "_0,aproc" . $n2 . "_1,aproc" . $n2 . "_2,aproc" . $n2 . "_3,aproc" . $n2 . "_4,aproc" . $n2 . "_5,aproc" . $n2 . "_6,aproc" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
@ -577,19 +592,20 @@ sub phpfpm_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:aproc" . $e . "_0=$rrd:phpfpm" . $e . "_aproc0:AVERAGE",
"DEF:aproc" . $e . "_1=$rrd:phpfpm" . $e . "_aproc1:AVERAGE",
"DEF:aproc" . $e . "_2=$rrd:phpfpm" . $e . "_aproc2:AVERAGE",
"DEF:aproc" . $e . "_3=$rrd:phpfpm" . $e . "_aproc3:AVERAGE",
"DEF:aproc" . $e . "_4=$rrd:phpfpm" . $e . "_aproc4:AVERAGE",
"DEF:aproc" . $e . "_5=$rrd:phpfpm" . $e . "_aproc5:AVERAGE",
"DEF:aproc" . $e . "_6=$rrd:phpfpm" . $e . "_aproc6:AVERAGE",
"DEF:aproc" . $e . "_7=$rrd:phpfpm" . $e . "_aproc7:AVERAGE",
"CDEF:allvalues=aproc" . $e . "_0,aproc" . $e . "_1,aproc" . $e . "_2,aproc" . $e . "_3,aproc" . $e . "_4,aproc" . $e . "_5,aproc" . $e . "_6,aproc" . $e . "_7,+,+,+,+,+,+,+",
"DEF:aproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aproc0:AVERAGE",
"DEF:aproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aproc1:AVERAGE",
"DEF:aproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aproc2:AVERAGE",
"DEF:aproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aproc3:AVERAGE",
"DEF:aproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aproc4:AVERAGE",
"DEF:aproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aproc5:AVERAGE",
"DEF:aproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aproc6:AVERAGE",
"DEF:aproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aproc7:AVERAGE",
"CDEF:allvalues=aproc" . $n2 . "_0,aproc" . $n2 . "_1,aproc" . $n2 . "_2,aproc" . $n2 . "_3,aproc" . $n2 . "_4,aproc" . $n2 . "_5,aproc" . $n2 . "_6,aproc" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
@ -628,8 +644,8 @@ sub phpfpm_cgi {
$str = trim($pfl[$n]);
$str = $phpfpm->{map}->{$str} ? $phpfpm->{map}->{$str} : $str;
my $dstr = substr($str, 0, 25);
push(@tmp, "LINE2:lqueue" . $e . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:lqueue" . $e . "_$n" . $LC[$n] . ":$str\\g");
push(@tmp, "LINE2:lqueue" . $n2 . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:lqueue" . $n2 . "_$n" . $LC[$n] . ":$str\\g");
}
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
@ -644,20 +660,21 @@ sub phpfpm_cgi {
"--vertical-label=Listening",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:lqueue" . $e . "_0=$rrd:phpfpm" . $e . "_lqueu0:AVERAGE",
"DEF:lqueue" . $e . "_1=$rrd:phpfpm" . $e . "_lqueu1:AVERAGE",
"DEF:lqueue" . $e . "_2=$rrd:phpfpm" . $e . "_lqueu2:AVERAGE",
"DEF:lqueue" . $e . "_3=$rrd:phpfpm" . $e . "_lqueu3:AVERAGE",
"DEF:lqueue" . $e . "_4=$rrd:phpfpm" . $e . "_lqueu4:AVERAGE",
"DEF:lqueue" . $e . "_5=$rrd:phpfpm" . $e . "_lqueu5:AVERAGE",
"DEF:lqueue" . $e . "_6=$rrd:phpfpm" . $e . "_lqueu6:AVERAGE",
"DEF:lqueue" . $e . "_7=$rrd:phpfpm" . $e . "_lqueu7:AVERAGE",
"CDEF:allvalues=lqueue" . $e . "_0,lqueue" . $e . "_1,lqueue" . $e . "_2,lqueue" . $e . "_3,lqueue" . $e . "_4,lqueue" . $e . "_5,lqueue" . $e . "_6,lqueue" . $e . "_7,+,+,+,+,+,+,+",
"DEF:lqueue" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_lqueu0:AVERAGE",
"DEF:lqueue" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_lqueu1:AVERAGE",
"DEF:lqueue" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_lqueu2:AVERAGE",
"DEF:lqueue" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_lqueu3:AVERAGE",
"DEF:lqueue" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_lqueu4:AVERAGE",
"DEF:lqueue" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_lqueu5:AVERAGE",
"DEF:lqueue" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_lqueu6:AVERAGE",
"DEF:lqueue" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_lqueu7:AVERAGE",
"CDEF:allvalues=lqueue" . $n2 . "_0,lqueue" . $n2 . "_1,lqueue" . $n2 . "_2,lqueue" . $n2 . "_3,lqueue" . $n2 . "_4,lqueue" . $n2 . "_5,lqueue" . $n2 . "_6,lqueue" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
@ -671,20 +688,21 @@ sub phpfpm_cgi {
"--vertical-label=Listening",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:lqueue" . $e . "_0=$rrd:phpfpm" . $e . "_lqueu0:AVERAGE",
"DEF:lqueue" . $e . "_1=$rrd:phpfpm" . $e . "_lqueu1:AVERAGE",
"DEF:lqueue" . $e . "_2=$rrd:phpfpm" . $e . "_lqueu2:AVERAGE",
"DEF:lqueue" . $e . "_3=$rrd:phpfpm" . $e . "_lqueu3:AVERAGE",
"DEF:lqueue" . $e . "_4=$rrd:phpfpm" . $e . "_lqueu4:AVERAGE",
"DEF:lqueue" . $e . "_5=$rrd:phpfpm" . $e . "_lqueu5:AVERAGE",
"DEF:lqueue" . $e . "_6=$rrd:phpfpm" . $e . "_lqueu6:AVERAGE",
"DEF:lqueue" . $e . "_7=$rrd:phpfpm" . $e . "_lqueu7:AVERAGE",
"CDEF:allvalues=lqueue" . $e . "_0,lqueue" . $e . "_1,lqueue" . $e . "_2,lqueue" . $e . "_3,lqueue" . $e . "_4,lqueue" . $e . "_5,lqueue" . $e . "_6,lqueue" . $e . "_7,+,+,+,+,+,+,+",
"DEF:lqueue" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_lqueu0:AVERAGE",
"DEF:lqueue" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_lqueu1:AVERAGE",
"DEF:lqueue" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_lqueu2:AVERAGE",
"DEF:lqueue" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_lqueu3:AVERAGE",
"DEF:lqueue" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_lqueu4:AVERAGE",
"DEF:lqueue" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_lqueu5:AVERAGE",
"DEF:lqueue" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_lqueu6:AVERAGE",
"DEF:lqueue" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_lqueu7:AVERAGE",
"CDEF:allvalues=lqueue" . $n2 . "_0,lqueue" . $n2 . "_1,lqueue" . $n2 . "_2,lqueue" . $n2 . "_3,lqueue" . $n2 . "_4,lqueue" . $n2 . "_5,lqueue" . $n2 . "_6,lqueue" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
@ -734,35 +752,36 @@ sub phpfpm_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:iproc" . $e . "_0=$rrd:phpfpm" . $e . "_iproc0:AVERAGE",
"DEF:iproc" . $e . "_1=$rrd:phpfpm" . $e . "_iproc1:AVERAGE",
"DEF:iproc" . $e . "_2=$rrd:phpfpm" . $e . "_iproc2:AVERAGE",
"DEF:iproc" . $e . "_3=$rrd:phpfpm" . $e . "_iproc3:AVERAGE",
"DEF:iproc" . $e . "_4=$rrd:phpfpm" . $e . "_iproc4:AVERAGE",
"DEF:iproc" . $e . "_5=$rrd:phpfpm" . $e . "_iproc5:AVERAGE",
"DEF:iproc" . $e . "_6=$rrd:phpfpm" . $e . "_iproc6:AVERAGE",
"DEF:iproc" . $e . "_7=$rrd:phpfpm" . $e . "_iproc7:AVERAGE",
"DEF:aproc" . $e . "_0=$rrd:phpfpm" . $e . "_aproc0:AVERAGE",
"DEF:aproc" . $e . "_1=$rrd:phpfpm" . $e . "_aproc1:AVERAGE",
"DEF:aproc" . $e . "_2=$rrd:phpfpm" . $e . "_aproc2:AVERAGE",
"DEF:aproc" . $e . "_3=$rrd:phpfpm" . $e . "_aproc3:AVERAGE",
"DEF:aproc" . $e . "_4=$rrd:phpfpm" . $e . "_aproc4:AVERAGE",
"DEF:aproc" . $e . "_5=$rrd:phpfpm" . $e . "_aproc5:AVERAGE",
"DEF:aproc" . $e . "_6=$rrd:phpfpm" . $e . "_aproc6:AVERAGE",
"DEF:aproc" . $e . "_7=$rrd:phpfpm" . $e . "_aproc7:AVERAGE",
"CDEF:tproc0=iproc" . $e . "_0,aproc" . $e . "_0,+",
"CDEF:tproc1=iproc" . $e . "_1,aproc" . $e . "_1,+",
"CDEF:tproc2=iproc" . $e . "_2,aproc" . $e . "_2,+",
"CDEF:tproc3=iproc" . $e . "_3,aproc" . $e . "_3,+",
"CDEF:tproc4=iproc" . $e . "_4,aproc" . $e . "_4,+",
"CDEF:tproc5=iproc" . $e . "_5,aproc" . $e . "_5,+",
"CDEF:tproc6=iproc" . $e . "_6,aproc" . $e . "_6,+",
"CDEF:tproc7=iproc" . $e . "_7,aproc" . $e . "_6,+",
"DEF:iproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_iproc0:AVERAGE",
"DEF:iproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_iproc1:AVERAGE",
"DEF:iproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_iproc2:AVERAGE",
"DEF:iproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_iproc3:AVERAGE",
"DEF:iproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_iproc4:AVERAGE",
"DEF:iproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_iproc5:AVERAGE",
"DEF:iproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_iproc6:AVERAGE",
"DEF:iproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_iproc7:AVERAGE",
"DEF:aproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aproc0:AVERAGE",
"DEF:aproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aproc1:AVERAGE",
"DEF:aproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aproc2:AVERAGE",
"DEF:aproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aproc3:AVERAGE",
"DEF:aproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aproc4:AVERAGE",
"DEF:aproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aproc5:AVERAGE",
"DEF:aproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aproc6:AVERAGE",
"DEF:aproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aproc7:AVERAGE",
"CDEF:tproc0=iproc" . $n2 . "_0,aproc" . $n2 . "_0,+",
"CDEF:tproc1=iproc" . $n2 . "_1,aproc" . $n2 . "_1,+",
"CDEF:tproc2=iproc" . $n2 . "_2,aproc" . $n2 . "_2,+",
"CDEF:tproc3=iproc" . $n2 . "_3,aproc" . $n2 . "_3,+",
"CDEF:tproc4=iproc" . $n2 . "_4,aproc" . $n2 . "_4,+",
"CDEF:tproc5=iproc" . $n2 . "_5,aproc" . $n2 . "_5,+",
"CDEF:tproc6=iproc" . $n2 . "_6,aproc" . $n2 . "_6,+",
"CDEF:tproc7=iproc" . $n2 . "_7,aproc" . $n2 . "_6,+",
"CDEF:allvalues=tproc0,tproc1,tproc2,tproc3,tproc4,tproc5,tproc6,tproc7,+,+,+,+,+,+,+",
@CDEF,
@tmp);
@ -777,35 +796,36 @@ sub phpfpm_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:iproc" . $e . "_0=$rrd:phpfpm" . $e . "_iproc0:AVERAGE",
"DEF:iproc" . $e . "_1=$rrd:phpfpm" . $e . "_iproc1:AVERAGE",
"DEF:iproc" . $e . "_2=$rrd:phpfpm" . $e . "_iproc2:AVERAGE",
"DEF:iproc" . $e . "_3=$rrd:phpfpm" . $e . "_iproc3:AVERAGE",
"DEF:iproc" . $e . "_4=$rrd:phpfpm" . $e . "_iproc4:AVERAGE",
"DEF:iproc" . $e . "_5=$rrd:phpfpm" . $e . "_iproc5:AVERAGE",
"DEF:iproc" . $e . "_6=$rrd:phpfpm" . $e . "_iproc6:AVERAGE",
"DEF:iproc" . $e . "_7=$rrd:phpfpm" . $e . "_iproc7:AVERAGE",
"DEF:aproc" . $e . "_0=$rrd:phpfpm" . $e . "_aproc0:AVERAGE",
"DEF:aproc" . $e . "_1=$rrd:phpfpm" . $e . "_aproc1:AVERAGE",
"DEF:aproc" . $e . "_2=$rrd:phpfpm" . $e . "_aproc2:AVERAGE",
"DEF:aproc" . $e . "_3=$rrd:phpfpm" . $e . "_aproc3:AVERAGE",
"DEF:aproc" . $e . "_4=$rrd:phpfpm" . $e . "_aproc4:AVERAGE",
"DEF:aproc" . $e . "_5=$rrd:phpfpm" . $e . "_aproc5:AVERAGE",
"DEF:aproc" . $e . "_6=$rrd:phpfpm" . $e . "_aproc6:AVERAGE",
"DEF:aproc" . $e . "_7=$rrd:phpfpm" . $e . "_aproc7:AVERAGE",
"CDEF:tproc0=iproc" . $e . "_0,aproc" . $e . "_0,+",
"CDEF:tproc1=iproc" . $e . "_1,aproc" . $e . "_1,+",
"CDEF:tproc2=iproc" . $e . "_2,aproc" . $e . "_2,+",
"CDEF:tproc3=iproc" . $e . "_3,aproc" . $e . "_3,+",
"CDEF:tproc4=iproc" . $e . "_4,aproc" . $e . "_4,+",
"CDEF:tproc5=iproc" . $e . "_5,aproc" . $e . "_5,+",
"CDEF:tproc6=iproc" . $e . "_6,aproc" . $e . "_6,+",
"CDEF:tproc7=iproc" . $e . "_7,aproc" . $e . "_6,+",
"DEF:iproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_iproc0:AVERAGE",
"DEF:iproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_iproc1:AVERAGE",
"DEF:iproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_iproc2:AVERAGE",
"DEF:iproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_iproc3:AVERAGE",
"DEF:iproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_iproc4:AVERAGE",
"DEF:iproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_iproc5:AVERAGE",
"DEF:iproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_iproc6:AVERAGE",
"DEF:iproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_iproc7:AVERAGE",
"DEF:aproc" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_aproc0:AVERAGE",
"DEF:aproc" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_aproc1:AVERAGE",
"DEF:aproc" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_aproc2:AVERAGE",
"DEF:aproc" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_aproc3:AVERAGE",
"DEF:aproc" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_aproc4:AVERAGE",
"DEF:aproc" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_aproc5:AVERAGE",
"DEF:aproc" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_aproc6:AVERAGE",
"DEF:aproc" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_aproc7:AVERAGE",
"CDEF:tproc0=iproc" . $n2 . "_0,aproc" . $n2 . "_0,+",
"CDEF:tproc1=iproc" . $n2 . "_1,aproc" . $n2 . "_1,+",
"CDEF:tproc2=iproc" . $n2 . "_2,aproc" . $n2 . "_2,+",
"CDEF:tproc3=iproc" . $n2 . "_3,aproc" . $n2 . "_3,+",
"CDEF:tproc4=iproc" . $n2 . "_4,aproc" . $n2 . "_4,+",
"CDEF:tproc5=iproc" . $n2 . "_5,aproc" . $n2 . "_5,+",
"CDEF:tproc6=iproc" . $n2 . "_6,aproc" . $n2 . "_6,+",
"CDEF:tproc7=iproc" . $n2 . "_7,aproc" . $n2 . "_6,+",
"CDEF:allvalues=tproc0,tproc1,tproc2,tproc3,tproc4,tproc5,tproc6,tproc7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
@ -840,8 +860,8 @@ sub phpfpm_cgi {
$str = trim($pfl[$n]);
$str = $phpfpm->{map}->{$str} ? $phpfpm->{map}->{$str} : $str;
my $dstr = substr($str, 0, 25);
push(@tmp, "LINE2:mchild" . $e . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:mchild" . $e . "_$n" . $LC[$n] . ":$str\\g");
push(@tmp, "LINE2:mchild" . $n2 . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:mchild" . $n2 . "_$n" . $LC[$n] . ":$str\\g");
}
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
@ -856,20 +876,21 @@ sub phpfpm_cgi {
"--vertical-label=Children",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:mchild" . $e . "_0=$rrd:phpfpm" . $e . "_mchil0:AVERAGE",
"DEF:mchild" . $e . "_1=$rrd:phpfpm" . $e . "_mchil1:AVERAGE",
"DEF:mchild" . $e . "_2=$rrd:phpfpm" . $e . "_mchil2:AVERAGE",
"DEF:mchild" . $e . "_3=$rrd:phpfpm" . $e . "_mchil3:AVERAGE",
"DEF:mchild" . $e . "_4=$rrd:phpfpm" . $e . "_mchil4:AVERAGE",
"DEF:mchild" . $e . "_5=$rrd:phpfpm" . $e . "_mchil5:AVERAGE",
"DEF:mchild" . $e . "_6=$rrd:phpfpm" . $e . "_mchil6:AVERAGE",
"DEF:mchild" . $e . "_7=$rrd:phpfpm" . $e . "_mchil7:AVERAGE",
"CDEF:allvalues=mchild" . $e . "_0,mchild" . $e . "_1,mchild" . $e . "_2,mchild" . $e . "_3,mchild" . $e . "_4,mchild" . $e . "_5,mchild" . $e . "_6,mchild" . $e . "_7,+,+,+,+,+,+,+",
"DEF:mchild" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_mchil0:AVERAGE",
"DEF:mchild" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_mchil1:AVERAGE",
"DEF:mchild" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_mchil2:AVERAGE",
"DEF:mchild" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_mchil3:AVERAGE",
"DEF:mchild" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_mchil4:AVERAGE",
"DEF:mchild" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_mchil5:AVERAGE",
"DEF:mchild" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_mchil6:AVERAGE",
"DEF:mchild" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_mchil7:AVERAGE",
"CDEF:allvalues=mchild" . $n2 . "_0,mchild" . $n2 . "_1,mchild" . $n2 . "_2,mchild" . $n2 . "_3,mchild" . $n2 . "_4,mchild" . $n2 . "_5,mchild" . $n2 . "_6,mchild" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
@ -883,20 +904,21 @@ sub phpfpm_cgi {
"--vertical-label=Children",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:mchild" . $e . "_0=$rrd:phpfpm" . $e . "_mchil0:AVERAGE",
"DEF:mchild" . $e . "_1=$rrd:phpfpm" . $e . "_mchil1:AVERAGE",
"DEF:mchild" . $e . "_2=$rrd:phpfpm" . $e . "_mchil2:AVERAGE",
"DEF:mchild" . $e . "_3=$rrd:phpfpm" . $e . "_mchil3:AVERAGE",
"DEF:mchild" . $e . "_4=$rrd:phpfpm" . $e . "_mchil4:AVERAGE",
"DEF:mchild" . $e . "_5=$rrd:phpfpm" . $e . "_mchil5:AVERAGE",
"DEF:mchild" . $e . "_6=$rrd:phpfpm" . $e . "_mchil6:AVERAGE",
"DEF:mchild" . $e . "_7=$rrd:phpfpm" . $e . "_mchil7:AVERAGE",
"CDEF:allvalues=mchild" . $e . "_0,mchild" . $e . "_1,mchild" . $e . "_2,mchild" . $e . "_3,mchild" . $e . "_4,mchild" . $e . "_5,mchild" . $e . "_6,mchild" . $e . "_7,+,+,+,+,+,+,+",
"DEF:mchild" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_mchil0:AVERAGE",
"DEF:mchild" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_mchil1:AVERAGE",
"DEF:mchild" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_mchil2:AVERAGE",
"DEF:mchild" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_mchil3:AVERAGE",
"DEF:mchild" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_mchil4:AVERAGE",
"DEF:mchild" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_mchil5:AVERAGE",
"DEF:mchild" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_mchil6:AVERAGE",
"DEF:mchild" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_mchil7:AVERAGE",
"CDEF:allvalues=mchild" . $n2 . "_0,mchild" . $n2 . "_1,mchild" . $n2 . "_2,mchild" . $n2 . "_3,mchild" . $n2 . "_4,mchild" . $n2 . "_5,mchild" . $n2 . "_6,mchild" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
@ -930,8 +952,8 @@ sub phpfpm_cgi {
$str = trim($pfl[$n]);
$str = $phpfpm->{map}->{$str} ? $phpfpm->{map}->{$str} : $str;
my $dstr = substr($str, 0, 25);
push(@tmp, "LINE2:slwreq" . $e . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:slwreq" . $e . "_$n" . $LC[$n] . ":$str\\g");
push(@tmp, "LINE2:slwreq" . $n2 . "_$n" . $LC[$n] . ":$dstr");
push(@tmpz, "LINE2:slwreq" . $n2 . "_$n" . $LC[$n] . ":$str\\g");
}
if(lc($config->{show_gaps}) eq "y") {
push(@tmp, "AREA:wrongdata#$colors->{gap}:");
@ -946,20 +968,21 @@ sub phpfpm_cgi {
"--vertical-label=Requests",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:slwreq" . $e . "_0=$rrd:phpfpm" . $e . "_slreq0:AVERAGE",
"DEF:slwreq" . $e . "_1=$rrd:phpfpm" . $e . "_slreq1:AVERAGE",
"DEF:slwreq" . $e . "_2=$rrd:phpfpm" . $e . "_slreq2:AVERAGE",
"DEF:slwreq" . $e . "_3=$rrd:phpfpm" . $e . "_slreq3:AVERAGE",
"DEF:slwreq" . $e . "_4=$rrd:phpfpm" . $e . "_slreq4:AVERAGE",
"DEF:slwreq" . $e . "_5=$rrd:phpfpm" . $e . "_slreq5:AVERAGE",
"DEF:slwreq" . $e . "_6=$rrd:phpfpm" . $e . "_slreq6:AVERAGE",
"DEF:slwreq" . $e . "_7=$rrd:phpfpm" . $e . "_slreq7:AVERAGE",
"CDEF:allvalues=slwreq" . $e . "_0,slwreq" . $e . "_1,slwreq" . $e . "_2,slwreq" . $e . "_3,slwreq" . $e . "_4,slwreq" . $e . "_5,slwreq" . $e . "_6,slwreq" . $e . "_7,+,+,+,+,+,+,+",
"DEF:slwreq" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_slreq0:AVERAGE",
"DEF:slwreq" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_slreq1:AVERAGE",
"DEF:slwreq" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_slreq2:AVERAGE",
"DEF:slwreq" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_slreq3:AVERAGE",
"DEF:slwreq" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_slreq4:AVERAGE",
"DEF:slwreq" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_slreq5:AVERAGE",
"DEF:slwreq" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_slreq6:AVERAGE",
"DEF:slwreq" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_slreq7:AVERAGE",
"CDEF:allvalues=slwreq" . $n2 . "_0,slwreq" . $n2 . "_1,slwreq" . $n2 . "_2,slwreq" . $n2 . "_3,slwreq" . $n2 . "_4,slwreq" . $n2 . "_5,slwreq" . $n2 . "_6,slwreq" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmp);
$err = RRDs::error;
@ -973,20 +996,21 @@ sub phpfpm_cgi {
"--vertical-label=Requests",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
"DEF:slwreq" . $e . "_0=$rrd:phpfpm" . $e . "_slreq0:AVERAGE",
"DEF:slwreq" . $e . "_1=$rrd:phpfpm" . $e . "_slreq1:AVERAGE",
"DEF:slwreq" . $e . "_2=$rrd:phpfpm" . $e . "_slreq2:AVERAGE",
"DEF:slwreq" . $e . "_3=$rrd:phpfpm" . $e . "_slreq3:AVERAGE",
"DEF:slwreq" . $e . "_4=$rrd:phpfpm" . $e . "_slreq4:AVERAGE",
"DEF:slwreq" . $e . "_5=$rrd:phpfpm" . $e . "_slreq5:AVERAGE",
"DEF:slwreq" . $e . "_6=$rrd:phpfpm" . $e . "_slreq6:AVERAGE",
"DEF:slwreq" . $e . "_7=$rrd:phpfpm" . $e . "_slreq7:AVERAGE",
"CDEF:allvalues=slwreq" . $e . "_0,slwreq" . $e . "_1,slwreq" . $e . "_2,slwreq" . $e . "_3,slwreq" . $e . "_4,slwreq" . $e . "_5,slwreq" . $e . "_6,slwreq" . $e . "_7,+,+,+,+,+,+,+",
"DEF:slwreq" . $n2 . "_0=$rrd:phpfpm" . $n2 . "_slreq0:AVERAGE",
"DEF:slwreq" . $n2 . "_1=$rrd:phpfpm" . $n2 . "_slreq1:AVERAGE",
"DEF:slwreq" . $n2 . "_2=$rrd:phpfpm" . $n2 . "_slreq2:AVERAGE",
"DEF:slwreq" . $n2 . "_3=$rrd:phpfpm" . $n2 . "_slreq3:AVERAGE",
"DEF:slwreq" . $n2 . "_4=$rrd:phpfpm" . $n2 . "_slreq4:AVERAGE",
"DEF:slwreq" . $n2 . "_5=$rrd:phpfpm" . $n2 . "_slreq5:AVERAGE",
"DEF:slwreq" . $n2 . "_6=$rrd:phpfpm" . $n2 . "_slreq6:AVERAGE",
"DEF:slwreq" . $n2 . "_7=$rrd:phpfpm" . $n2 . "_slreq7:AVERAGE",
"CDEF:allvalues=slwreq" . $n2 . "_0,slwreq" . $n2 . "_1,slwreq" . $n2 . "_2,slwreq" . $n2 . "_3,slwreq" . $n2 . "_4,slwreq" . $n2 . "_5,slwreq" . $n2 . "_6,slwreq" . $n2 . "_7,+,+,+,+,+,+,+",
@CDEF,
@tmpz);
$err = RRDs::error;
@ -1027,6 +1051,7 @@ sub phpfpm_cgi {
push(@output, main::graph_footer());
}
$e++;
$n2++;
}
push(@output, " <br>\n");
return @output;

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -143,6 +143,10 @@ sub port_init {
logger("$myself: port number '$np' listed but not defined.");
next;
}
# support for port range (i.e: 49152:65534)
if(index($pl[$n], ":") != -1) {
($np) = ($pl[$n] =~ m/^(\d+:\d+).*?/);
}
if($pl[$n] && $np) {
my $p = trim(lc((split(',', $port->{desc}->{$pl[$n]}))[1])) || "";
if(! grep {$_ eq $p} ("tcp", "udp", "tcp6", "udp6")) {
@ -345,6 +349,7 @@ sub port_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @warning;
my @IMG;
@ -367,6 +372,9 @@ sub port_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -627,6 +635,7 @@ sub port_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -651,6 +660,7 @@ sub port_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -268,6 +268,7 @@ sub proc_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -287,6 +288,9 @@ sub proc_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -622,6 +626,7 @@ sub proc_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -649,6 +654,7 @@ sub proc_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -334,6 +334,7 @@ sub process_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my $graph_title;
my @IMG;
my @IMGz;
@ -368,6 +369,9 @@ sub process_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -529,6 +533,7 @@ sub process_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -557,6 +562,7 @@ sub process_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -640,6 +646,7 @@ sub process_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -678,6 +685,7 @@ sub process_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -768,6 +776,7 @@ sub process_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -806,6 +815,7 @@ sub process_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -922,6 +932,7 @@ sub process_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -950,6 +961,7 @@ sub process_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1030,6 +1042,7 @@ sub process_cgi {
"--vertical-label=Files",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1058,6 +1071,7 @@ sub process_cgi {
"--vertical-label=Files",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1141,6 +1155,7 @@ sub process_cgi {
"--vertical-label=Threads",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1169,6 +1184,7 @@ sub process_cgi {
"--vertical-label=Threads",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1254,6 +1270,7 @@ sub process_cgi {
"--vertical-label=Nonvoluntary + voluntary/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1313,6 +1330,7 @@ sub process_cgi {
"--vertical-label=Nonvoluntary + voluntary/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1427,6 +1445,7 @@ sub process_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1455,6 +1474,7 @@ sub process_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -227,6 +227,7 @@ sub raspberrypi_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my $temp_scale = "Celsius";
my @riglim;
my @tmp;
@ -252,6 +253,9 @@ sub raspberrypi_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -411,6 +415,7 @@ sub raspberrypi_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -438,6 +443,7 @@ sub raspberrypi_cgi {
"--vertical-label=Hz",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -514,6 +520,7 @@ sub raspberrypi_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -534,6 +541,7 @@ sub raspberrypi_cgi {
"--vertical-label=$temp_scale",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -602,6 +610,7 @@ sub raspberrypi_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -625,6 +634,7 @@ sub raspberrypi_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -652,6 +652,7 @@ sub serv_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my $vlabel;
my @tmp;
@ -667,6 +668,9 @@ sub serv_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -899,6 +903,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -933,6 +938,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1032,6 +1038,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1055,6 +1062,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1151,6 +1159,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1177,6 +1186,7 @@ sub serv_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -481,6 +481,7 @@ sub squid_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -525,6 +526,9 @@ sub squid_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -772,6 +776,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -790,6 +795,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -866,6 +872,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -884,6 +891,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -985,6 +993,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1012,6 +1021,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1088,6 +1098,7 @@ sub squid_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1112,6 +1123,7 @@ sub squid_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1181,6 +1193,7 @@ sub squid_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1205,6 +1218,7 @@ sub squid_cgi {
"--vertical-label=Megabytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1280,6 +1294,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1302,6 +1317,7 @@ sub squid_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1380,6 +1396,7 @@ sub squid_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1403,6 +1420,7 @@ sub squid_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1481,6 +1499,7 @@ sub squid_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1502,6 +1521,7 @@ sub squid_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1578,6 +1598,7 @@ sub squid_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1599,6 +1620,7 @@ sub squid_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -448,6 +448,7 @@ sub system_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -461,7 +462,9 @@ sub system_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -615,6 +618,7 @@ sub system_cgi {
"--vertical-label=Load average",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -638,6 +642,7 @@ sub system_cgi {
"--vertical-label=Load average",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -712,6 +717,7 @@ sub system_cgi {
"--lower-limit=0",
"--rigid",
"--base=1024",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -747,6 +753,7 @@ sub system_cgi {
"--lower-limit=0",
"--rigid",
"--base=1024",
@extra,
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -851,6 +858,7 @@ sub system_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -877,6 +885,7 @@ sub system_cgi {
"--vertical-label=Processes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -940,6 +949,7 @@ sub system_cgi {
"--vertical-label=Size",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -960,6 +970,7 @@ sub system_cgi {
"--vertical-label=Size",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1017,6 +1028,7 @@ sub system_cgi {
"--vertical-label=Days",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1038,6 +1050,7 @@ sub system_cgi {
"--vertical-label=Days",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -315,6 +315,7 @@ sub tc_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -348,6 +349,9 @@ sub tc_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -527,6 +531,7 @@ sub tc_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -554,6 +559,7 @@ sub tc_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -637,6 +643,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -664,6 +671,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -744,6 +752,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -771,6 +780,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -853,6 +863,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -880,6 +891,7 @@ sub tc_cgi {
"--vertical-label=Packets/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -445,6 +445,7 @@ sub traffacct_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -464,6 +465,9 @@ sub traffacct_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
if(lc($config->{netstats_in_bps}) eq "y") {
$T = "b";
@ -550,6 +554,7 @@ sub traffacct_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -571,6 +576,7 @@ sub traffacct_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -663,6 +669,7 @@ sub traffacct_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -685,6 +692,7 @@ sub traffacct_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -184,6 +184,7 @@ sub user_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -197,6 +198,9 @@ sub user_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -299,6 +303,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -322,6 +327,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -386,6 +392,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -406,6 +413,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -467,6 +475,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -487,6 +496,7 @@ sub user_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -394,6 +394,7 @@ sub varnish_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -407,6 +408,9 @@ sub varnish_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -578,6 +582,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -605,6 +610,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -711,6 +717,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -737,6 +744,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -813,6 +821,7 @@ sub varnish_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -835,6 +844,7 @@ sub varnish_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -902,6 +912,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -924,6 +935,7 @@ sub varnish_cgi {
"--vertical-label=Values/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -994,6 +1006,7 @@ sub varnish_cgi {
"--vertical-label=Objects",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1017,6 +1030,7 @@ sub varnish_cgi {
"--vertical-label=Objects",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1088,6 +1102,7 @@ sub varnish_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1109,6 +1124,7 @@ sub varnish_cgi {
"--vertical-label=bytes/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -185,6 +185,7 @@ sub verlihub_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @tmp;
my @tmpz;
@ -198,6 +199,9 @@ sub verlihub_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -298,6 +302,7 @@ sub verlihub_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -321,6 +326,7 @@ sub verlihub_cgi {
"--vertical-label=Users",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -388,6 +394,7 @@ sub verlihub_cgi {
"--width=$width",
"--height=$height",
"--units-exponent=0",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -409,6 +416,7 @@ sub verlihub_cgi {
"--width=$width",
"--height=$height",
"--units-exponent=0",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -471,6 +479,7 @@ sub verlihub_cgi {
"--width=$width",
"--height=$height",
"--units-exponent=0",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -492,6 +501,7 @@ sub verlihub_cgi {
"--width=$width",
"--height=$height",
"--units-exponent=0",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -408,6 +408,7 @@ sub wowza_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -451,6 +452,9 @@ sub wowza_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -617,6 +621,7 @@ sub wowza_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -645,6 +650,7 @@ sub wowza_cgi {
"--vertical-label=Connections",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -720,6 +726,7 @@ sub wowza_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -754,6 +761,7 @@ sub wowza_cgi {
"--vertical-label=$vlabel",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -831,6 +839,7 @@ sub wowza_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -858,6 +867,7 @@ sub wowza_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -923,6 +933,7 @@ sub wowza_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -950,6 +961,7 @@ sub wowza_cgi {
"--vertical-label=Connections/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1015,6 +1027,7 @@ sub wowza_cgi {
"--vertical-label=Sessions",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1042,6 +1055,7 @@ sub wowza_cgi {
"--vertical-label=Sessions",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -1,7 +1,7 @@
#
# Monitorix - A lightweight system monitoring tool.
#
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
# Copyright (C) 2005-2019 by Jordi Sanfeliu <jordi@fibranet.cat>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -267,13 +267,17 @@ sub zfs_update {
my $pool = (split(',', $zfs->{list}))[$n] || "";
if($pool) {
my @zpool;
my @data;
$free = trim(`zfs get -Hp -o value available $pool`);
$udata = trim(`zfs get -Hp -o value used $pool`);
$usnap = eval join('+',`zfs get -rHp -o value usedbysnapshots -tfilesystem $pool`);
@zpool = split(' ', `zpool list -H $pool` || "");
if(scalar(@zpool) == 10) { # ZFS version 0.6.4+
if(scalar(@zpool) > 10) { # ZFS version 0.8.0+
$cap = trim($zpool[7]);
$fra = trim($zpool[6]);
} elsif(scalar(@zpool) == 10) { # ZFS version 0.6.4+
$cap = trim($zpool[6]);
$fra = trim($zpool[5]);
} elsif(scalar(@zpool) == 8) { # ZFS version 0.6.3- (?)
@ -282,8 +286,13 @@ sub zfs_update {
}
$cap =~ s/%//;
$fra =~ s/[%-]//g; $fra = $fra || 0;
@zpool = split(' ', `zpool iostat -Hp $pool` || "");
(undef, undef, undef, $oper, $opew, $banr, $banw) = @zpool;
open(IN, "zpool iostat -Hp $pool 5 2 |");
while(<IN>) {
push(@data, $_);
}
close(IN);
(undef, undef, undef, $oper, $opew, $banr, $banw) = split(' ', $data[1]);
}
$rrdata .= ":$free:$udata:$usnap:$cap:$fra:$oper:$opew:$banr:$banw:0";
@ -320,6 +329,7 @@ sub zfs_cgi {
my $u = "";
my $width;
my $height;
my @extra;
my @riglim;
my @IMG;
my @IMGz;
@ -337,6 +347,9 @@ sub zfs_cgi {
my $IMG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
my $imgfmt_uc = uc($config->{image_format});
my $imgfmt_lc = lc($config->{image_format});
foreach my $i (split(',', $config->{rrdtool_extra_options} || "")) {
push(@extra, trim($i)) if trim($i);
}
$title = !$silent ? $title : "";
@ -511,6 +524,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -537,6 +551,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -611,6 +626,7 @@ sub zfs_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -633,6 +649,7 @@ sub zfs_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -697,6 +714,7 @@ sub zfs_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -718,6 +736,7 @@ sub zfs_cgi {
"--vertical-label=Reads/s",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -794,6 +813,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -816,6 +836,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -881,6 +902,7 @@ sub zfs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -902,6 +924,7 @@ sub zfs_cgi {
"--vertical-label=Percent (%)",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -970,6 +993,7 @@ sub zfs_cgi {
"--vertical-label=Number",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -992,6 +1016,7 @@ sub zfs_cgi {
"--vertical-label=Number",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1057,6 +1082,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},
@ -1081,6 +1107,7 @@ sub zfs_cgi {
"--vertical-label=bytes",
"--width=$width",
"--height=$height",
@extra,
@riglim,
$zoom,
@{$cgi->{version12}},

View File

@ -155,6 +155,13 @@ This is the format of each generated graph. There are only two possible values:
Default value: \fIPNG\fP
.RE
.P
.BI enable_parallelizing
.RS
This option will fork an independent process for each graph in order to speed up graph generation in multi-core systems. It's best to keep it disabled on unicore processors.
.P
Default value: \fIy\fP
.RE
.P
.BI include_dir
.RS
The main configuration file is usually called \fImonitorix.conf\fP and its location is provided as part of the command line arguments. In addition, other configuration files may be loaded placing them in the directory pointed by this option. The names must end with .conf to be included.
@ -218,6 +225,16 @@ It will show a back arrow in the upper-left corner and it is specially useful fo
Default value: \fIn\fP
.RE
.P
.BI rrdtool_extra_options
.RS
This option permits create a comma-separated list of RRDtool options that will be included in all graphs. This is specially useful if you want to take advantage of an specific RRDtool graphics option.
.P
An example would be:
.P
.br
rrdtool_extra_options = "--grid-dash=1:0, --no-legend"
.RE
.P
.BI base_dir
.RS
This is the absolute path to the directory where all the web elements are located:
@ -442,7 +459,7 @@ Default value: \fI/var/log/proftpd/access.log\fP
.P
.BI fail2ban_log
.RS
This is the path to the Fail2ban log file. Monitorix uses this file to report IP addresses banned.
This is the path to the Fail2ban log file. Monitorix uses this file only if the option \fBgraph_mode\fP has the value \fIrate\fP.
.P
Default value: \fI/var/log/fail2ban.log\fP
.RE
@ -884,11 +901,11 @@ The external script will receive the following arguments:
.P
.RE
.SS Generic sensors statistics (gensens.pm)
This graph is able to monitor up to 9 temperatures and CPU frequencies which, depending of your machine, should appear in the \fI/sys/devices\fP directory.
This graph helps to monitor up to three (so far) different sensors: temperatures, CPU frequencies and battery status which, depending of your machine, they should appear in the \fI/sys\fP directory.
.P
.BI list
.RS
This is a fixed list that can only hold two keys (0 and 1). Each key though can hold up to 9 different entries separated by comma which corresponds to the names of the sensors present in your computer. The key 0 is only for temperature sensors and the key 1 is for CPU frequencies. All this is hard-coded and a bit rigid currently but it might change in the future.
This is a list of an unlimited number of groups to define the sensors to monitor. Each group is numbered starting from 0, and each one can hold up to 9 different entries separated by comma which corresponds to the names of the sensors present in your computer that you want to monitor. This module is capable to identify the type of the group by searching the substrings \fItemp\fP, \fIcpu\fP and \fIbat\fP, so it will put automatically the vertical label in the graph accordingly (\fICelsius\fP or \fIFahrenheit\fP, \fIHz\fP or \fICharge\fP respectively). Of course, it cannot supports mixed sensors in a same group. For example, if you need to monitor more than 9 temperature sensors just create a new group in \fBlist\fP.
.P
An example would be:
.P
@ -898,13 +915,31 @@ An example would be:
0 = temp0, temp1
.br
1 = cpu0, cpu1, cpu2, cpu3
.br
2 = bat0
.br
</list>
.RE
.RE
.BI title
.RS
In this option you must associate a title with the group number specified in \fBlist\fP. This is the title that will appear as the name of the graph. Following the settings in the example above:
.P
.RS
<title>
.br
0 = Temperatures
.br
1 = CPU frequency
.br
2 = Battery status
.br
</title>
.RE
.RE
.BI desc
.RS
In this option you must associate the complete pathname of the file from where to get the value of each entry defined in the \fBlist\fP. Following the settings in the example above:
In this option you must associate the complete pathname of the file from where to get the value of each entry defined in the \fBlist\fP option. Following the settings in the example above:
.P
.RS
<desc>
@ -920,13 +955,15 @@ In this option you must associate the complete pathname of the file from where t
cpu2 = /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq
.br
cpu3 = /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq
.br
bat0 = /sys/class/power_supply/BAT0/capacity
.br
</desc>
.RE
.RE
.BI unit
.RS
With this option you can define the order of magnitude associated to a specific value. This is used in both temperatures and CPU frequencies, since this kind of temperature sensors tend to give the value in 1000ths of degrees Celsius. In the case of CPU frequencies the values come in Mhz which means that they need to be converted to Hz by multiplying them by 1000. Therefore you can define something like this:
With this option you can define the order of magnitude associated to a specific value. This is used in both temperatures and CPU frequencies, since this kind of temperature sensors tend to give the value in 1000ths of degrees Celsius. In the case of CPU frequencies the values come in Mhz which means that they need to be converted to Hz by multiplying them by 1000. Since the battery value represents a percentage, it doesn't need any special calculation. Therefore you can define something like this:
.P
.RS
<unit>
@ -942,6 +979,8 @@ With this option you can define the order of magnitude associated to a specific
cpu2 = 0.001
.br
cpu3 = 0.001
.br
bat0 = 1
.br
</unit>
.RE
@ -964,6 +1003,8 @@ With this option you can optionally rename any of the sensor names defined in th
cpu2 = CPU2 frequency
.br
cpu3 = CPU3 frequency
.br
bat0 = Battery 0
.br
</map>
.RE
@ -977,7 +1018,7 @@ This optional list enables the alert capabilities for this graph and complements
.P
The \fItime interval\fP is the period of time (in seconds) that the \fIthreshold\fP needs to be exceeded before the external script is executed.
.P
The \fIthreshold\fP is the value (either temperature or HZ) that needs to be reached or exceeded within the specified time in \fItime interval\fP to execute the external script. It can be specified as a unique value or as a range of two values separated by a dash.
The \fIthreshold\fP is the value (temperature, Hz or battery charge) that needs to be reached or exceeded within the specified time in \fItime interval\fP to execute the external script. It can be specified as a unique value or as a range of two values separated by a dash.
.P
The \fIscript\fP is the full path name of the script that will be executed by this alert.
.P
@ -1169,7 +1210,7 @@ This optional list enables the alert capabilities for this graph and complements
.P
The \fItime interval\fP is the period of time (in seconds) that the \fIthreshold\fP needs to be exceeded before the external script is executed.
.P
The \fIthreshold\fP is the value (either temperature or HZ) that needs to be reached or exceeded within the specified time in \fItime interval\fP to execute the external script. It can be specified as a unique value or as a range of two values separated by a dash.
The \fIthreshold\fP is the value (temperature, etc.) that needs to be reached or exceeded within the specified time in \fItime interval\fP to execute the external script. It can be specified as a unique value or as a range of two values separated by a dash.
.P
The \fIscript\fP is the full path name of the script that will be executed by this alert.
.P
@ -1984,9 +2025,9 @@ Default value: \fI24000\fP
.P
.BI list
.RS
You may define here up to \fBmax\fP network port numbers. If you need to monitor the same network port with TCP and UDP protocols, you can add your own suffix to the port number (e.g: 443t and 443u) in order to distinguish it from the double definition in the <desc> block.
You may define here up to \fBmax\fP network port numbers. If you need to monitor the same network port with TCP and UDP protocols, you can add your own suffix to the port number (e.g: 443t and 443u) in order to distinguish it from the double definition in the <desc> block. It also support port ranges (e.g: 49152:65534) to be able to monitor the traffic of a number of consecutive ports summarized on a unique graph.
.P
If you see a red color in the background of a network port graph, it means that there is not a daemon listening on that port. This can be useful to know if some service gone down unexpectedly.
If you see a red color in the background of a network port graph, it means that there is not a daemon listening on that port. This can be useful to know if some service gone down unexpectedly. Of course, this is only valid on a single port, not ranged ports.
.RE
.P
.BI desc
@ -2003,24 +2044,28 @@ This is the option where each network port specified in \fBlist\fP is described.
.br
- the limit value.
.br
- the \fIL\fP optional option which specifies that this port should be listening and Monitorix will advice it, by changing the background color of the graph to red, if finds it down.
- the \fIL\fP optional option which specifies that this port should be listening and Monitorix will advice it, by changing the background color of the graph to red, if finds it down. This option has no effect on ranged ports.
.RE
.P
There is also support (Linux only) for IPv6 network ports activity by using protocol names as \fItcp6\fP or \fIudp6\fP.
.P
An example would be:
.RS
list = 25, 25ip6, 80, 53
list = 25, 25ip6, 80, 53t, 53u, 49152:65534
.br
<desc>
.br
25 = SMTP, tcp, in/out, 0, 1000, L
25 = SMTP, tcp, in/out, 0, 1000, L
.br
25ip6 = SMTP, tcp6, in/out, 0, 1000, L
25ip6 = SMTP, tcp6, in/out, 0, 1000, L
.br
80 = HTTP, tcp, in, 0, 1000, L
80 = HTTP, tcp, in, 0, 1000, L
.br
53 = DNS, udp, in, 0, 1000, L
53t = DNS, tcp, in, 0, 1000, L
.br
53u = DNS, udp, in, 0, 1000, L
.br
49152:65534 = FTP_PSV, tcp, in, 0, 1000
.br
</desc>
.RE
@ -2608,6 +2653,13 @@ This is the number of fail2ban graphs that will be put in a row.
.P
Default value: \fI2\fP
.RE
.P
.BI graph_mode
.RS
This option changes how the values are represented in the graph. It has two possible values: \fIabsolute\fP which is the default, and \fIrate\fP. The former takes the values directly from the command \fIfail2ban-client status <JAIL>\fP and so the values in the graph will appear as absolute. The later option shows the values in a rating format per minute.
.P
Default value: \fIabsolute\fP
.RE
.SS Icecast Streaming Media Server (icecast.pm)
This graph is able to monitor an unlimited number of Icecast servers.
.P
@ -3076,6 +3128,13 @@ This is the address that will be used as remitent for all the monthly report ema
Default value: \fInoreply@example.com\fP
.RE
.P
.BI subject_prefix
.RS
This is a string that will be prefixed in the Subject of all emails that will be sent.
.P
Default value: \fIMonitorix:\fP
.RE
.P
.BI hour
.RS
This is the hour (in 24h format) when the email reports will be sent.

View File

@ -311,6 +311,14 @@ EOF
}
next;
}
if($g eq "gensens") {
for($n = 0; $n < keys %{$config{gensens}->{list}}; $n++) {
my $name = trim($config{gensens}->{title}->{$n});
$gname = "_" . $g;
print(OUT " <option value='" . $gname . $n . "'>" . $name . "</option>\n");
}
next;
}
if($g eq "ipmi") {
for($n = 0; $n < scalar(my @ipmi_list = split(',', $config{ipmi}->{list})); $n++) {
my $name = trim($ipmi_list[$n]);
@ -737,9 +745,8 @@ logger("Ok, ready.");
# main loop
while(1) {
local $SIG{'ALRM'} = sub { };
alarm(1);
pause();
select undef, undef, undef, 1.0;
my ($sec, $min, $hour, $mday, $mon, undef, $wday) = localtime(time);
@ -856,8 +863,10 @@ while(1) {
my $ua = LWP::UserAgent->new(timeout => 30);
my $response = $ua->request(HTTP::Request->new('GET', $url));
if(!$response->is_success) {
logger("WARNING: HTTP built-in server not responding at '$url'.");
exit(1);
if($response->status_line ne "401 Access Denied") {
logger("WARNING: HTTP built-in server not responding at '$url'.");
exit(1);
}
}
exit(0);
}

View File

@ -52,7 +52,7 @@ milter_gl = /var/milter-greylist/greylist.db
imap_log = /var/log/imap
hylafax_log = /var/spool/hylafax/etc/xferfaxlog
cups_log = /var/log/cups/page_log
ftp_log = /var/log/proftpd/access.log
ftp_log = /var/log/proftpd/access.log # Check monitorix.conf(5) manpage how to edit your ProFTPD server.
fail2ban_log = /var/log/fail2ban.log
spamassassin_log = /var/log/maillog
clamav_log = /var/log/clamav/clamav.log
@ -214,23 +214,32 @@ secure_log_date_format = %b %e
<list>
0 = temp0
1 = cpu0
2 = bat0
</list>
<title>
0 = Temperatures
1 = CPU frequency
2 = Battery status
</title>
<desc>
temp0 = /sys/devices/virtual/thermal/thermal_zone0/temp
cpu0 = /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
bat0 = /sys/class/power_supply/BAT0/capacity
</desc>
<unit>
temp0 = 1000
cpu0 = 0.001
bat0 = 1
</unit>
<map>
temp0 = Temperature Zone 0
cpu0 = CPU0 frequency
bat0 = Battery 0
</map>
<alerts>
</alerts>
rigid = 0, 0
limit = 100, 100
rigid = 0, 0, 2
limit = 100, 100, 100
</gensens>
@ -662,7 +671,7 @@ secure_log_date_format = %b %e
<fail2ban>
list = Security, Overload / Abuse
<desc>
0 = [apache], [apache-mod-security], [apache-overflows], [courierauth], [ssh], [pam-generic], [php-url-fopen], [vsftpd]
0 = [apache], [apache-mod-security], [apache-overflows], [courierauth], [sshd], [pam-generic], [php-url-fopen], [vsftpd]
1 = [apache-evasive], [apache-badbots], [named-refused-udp], [named-refused-tcp]
</desc>
graphs_per_row = 2
@ -989,8 +998,7 @@ graph_name = system, kern, proc, hptemp, lmsens, gensens, ipmi, ambsens, nvidia,
_lmsens3 = MB and CPU temperatures
_lmsens4 = Fan speeds
_lmsens5 = GPU temperatures
_gensens1 = Temperatures
_gensens2 = CPU frequency
_gensens = Generic sensors
_ipmi = IPMI sensors
_ambsens = Ambient sensors
_nvidia1 = NVIDIA temperatures