From f4a2b3e843a72e4b62c54bc5da4ef4f3c568bd89 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 27 Jul 2011 14:55:38 -0400 Subject: Respect the user-defined interface names in e-mailed RRD graphs, and in drop-downs for building reports. --- config/mailreport/mail_reports.inc | 18 ++++++++---------- config/mailreport/status_mail_report_add_graph.php | 13 ++++++++----- config/mailreport/status_mail_report_edit.php | 12 +++++++----- 3 files changed, 23 insertions(+), 20 deletions(-) (limited to 'config') diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc index dc8026cc..d94631cc 100644 --- a/config/mailreport/mail_reports.inc +++ b/config/mailreport/mail_reports.inc @@ -301,16 +301,14 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) { // log_error("start $start, end $end, archivestart $archivestart, average $average, scale $scale, seconds $seconds"); /* Deduce a interface if possible and use the description */ - $curif = split("-", $curdatabase); - $curif = "$curif[0]"; - $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif)); - if($friendly == "") { - $friendly = $curif; + $curif = explode("-", $curdatabase); + $curif[1] = str_replace(".rrd", "", $curif[1]); + $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif[0])); + if(!empty($friendly)) { + $curif[0] = $friendly; } - $search = array("-", ".rrd", $curif); - $replace = array(" :: ", "", $friendly); - $prettydb = ucwords(str_replace($search, $replace, $curdatabase)); - + $prettydb = ucwords(implode(" :: ", $curif)); + $curif = $curif[0]; $rrddbpath = "/var/db/rrd/"; $rrdtmppath = "/tmp/"; @@ -1200,4 +1198,4 @@ function timeDiff($time, $opt = array()) { return $str; } -?> \ No newline at end of file +?> diff --git a/config/mailreport/status_mail_report_add_graph.php b/config/mailreport/status_mail_report_add_graph.php index 17d7731c..c0287367 100644 --- a/config/mailreport/status_mail_report_add_graph.php +++ b/config/mailreport/status_mail_report_add_graph.php @@ -183,12 +183,15 @@ include("head.inc");