aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailreport
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-02-10 17:46:44 +0545
committerjim-p <jimp@pfsense.org>2015-02-10 11:19:35 -0500
commit3339d6164c2333f1a6f529fe346466e90d94194e (patch)
tree56e5c0be2abc9ca17a772af9337496e098268545 /config/mailreport
parent2dd0d10d8eb7e9208cd0a02fa6ee02d47a554a8f (diff)
downloadpfsense-packages-3339d6164c2333f1a6f529fe346466e90d94194e.tar.gz
pfsense-packages-3339d6164c2333f1a6f529fe346466e90d94194e.tar.bz2
pfsense-packages-3339d6164c2333f1a6f529fe346466e90d94194e.zip
Support mail report of mbuf usage graph
Forum report: https://forum.pfsense.org/index.php?topic=82571.0
Diffstat (limited to 'config/mailreport')
-rw-r--r--config/mailreport/mail_reports.inc51
-rw-r--r--config/mailreport/mail_reports_generate.php2
-rw-r--r--config/mailreport/mailreport.xml2
3 files changed, 50 insertions, 5 deletions
diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc
index 6dddf7cd..669b1541 100644
--- a/config/mailreport/mail_reports.inc
+++ b/config/mailreport/mail_reports.inc
@@ -286,7 +286,7 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
/* this should never happen */
if($end < $start) {
- log_error("start $start is smaller than end $end");
+ log_error("start $start is greater than end $end");
$end = $now;
}
@@ -392,7 +392,7 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
$speedlimit = ($upstream + $downstream);
- /* Set default colors explicity, the theme can then override them below.
+ /* Set default colors explicitly, the theme can then override them below.
This prevents missing colors in themes from crashing the graphs. */
$colortrafficup = array("666666", "CCCCCC");
$colortrafficdown = array("990000", "CC0000");
@@ -402,6 +402,7 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
$colorstates = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
$colorprocessor = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
$colormemory = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+ $colormbuf = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
$colorqueuesup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
$colorqueuesdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
$colorqueuesdropup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
@@ -718,7 +719,7 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
}
elseif((strstr($curdatabase, "-wireless.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
- /* define graphcmd for packets stats */
+ /* define graphcmd for wireless stats */
$graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
$graphcmd .= "--start $start --end $end ";
$graphcmd .= "--vertical-label \"snr/channel/rate\" ";
@@ -927,6 +928,50 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
}
+ elseif((strstr($curdatabase, "-mbuf.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ /* define graphcmd for mbuf usage stats */
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
+ $graphcmd .= "--start $start --end $end ";
+ $graphcmd .= "--vertical-label \"utilization, percent\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"`hostname` - {$prettydb} clusters - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"current=$rrddbpath$curdatabase:current:AVERAGE\" ";
+ $graphcmd .= "DEF:\"cache=$rrddbpath$curdatabase:cache:AVERAGE\" ";
+ $graphcmd .= "DEF:\"total=$rrddbpath$curdatabase:total:AVERAGE\" ";
+ $graphcmd .= "DEF:\"max=$rrddbpath$curdatabase:max:AVERAGE\" ";
+ $graphcmd .= "LINE2:\"current#{$colormbuf[0]}:current\" ";
+ $graphcmd .= "LINE2:\"cache#{$colormbuf[1]}:cache\" ";
+ $graphcmd .= "LINE2:\"total#{$colormbuf[2]}:total\" ";
+ $graphcmd .= "LINE2:\"max#{$colormbuf[3]}:max\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t minimum average maximum current\\n\" ";
+ $graphcmd .= "COMMENT:\"Current. \" ";
+ $graphcmd .= "GPRINT:\"current:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"current:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Cache. \" ";
+ $graphcmd .= "GPRINT:\"cache:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"cache:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Total. \" ";
+ $graphcmd .= "GPRINT:\"total:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"total:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Max. \" ";
+ $graphcmd .= "GPRINT:\"max:MIN:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:AVERAGE:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:MAX:%7.2lf %s \" ";
+ $graphcmd .= "GPRINT:\"max:LAST:%7.2lf %S \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
+ }
elseif((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
/* define graphcmd for queue stats */
$graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
diff --git a/config/mailreport/mail_reports_generate.php b/config/mailreport/mail_reports_generate.php
index c31909c9..55a23283 100644
--- a/config/mailreport/mail_reports_generate.php
+++ b/config/mailreport/mail_reports_generate.php
@@ -2,7 +2,7 @@
<?php
/* $Id$ */
/*
- mail_reports.inc
+ mail_reports_generate.php
Part of pfSense
Copyright (C) 2011 Jim Pingle <jimp@pfsense.org>
Portions Copyright (C) 2007-2011 Seth Mos <seth.mos@dds.nl>
diff --git a/config/mailreport/mailreport.xml b/config/mailreport/mailreport.xml
index 803e205b..1c6880bd 100644
--- a/config/mailreport/mailreport.xml
+++ b/config/mailreport/mailreport.xml
@@ -37,7 +37,7 @@
]]>
</copyright>
<name>mailreport</name>
- <version>2.1</version>
+ <version>2.2</version>
<title>Status: Email Reports</title>
<additional_files_needed>
<prefix>/usr/local/bin/</prefix>