All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* pfSense_MODULE: system */ ##|+PRIV ##|*IDENT=page-status-rrdgraphs ##|*NAME=Status: RRD Graphs page ##|*DESCR=Allow access to the 'Status: RRD Graphs' page. ##|*MATCH=status_rrd_graph.php* ##|-PRIV require("guiconfig.inc"); require_once("mail_reports.inc"); /* if the rrd graphs are not enabled redirect to settings page */ if(! isset($config['rrd']['enable'])) { header("Location: status_rrd_graph_settings.php"); return; } $cmdid = $_REQUEST['cmdid']; $logid = $_REQUEST['logid']; $graphid = $_REQUEST['graphid']; $id = $_REQUEST['id']; if (!is_array($config['mailreports']['schedule'])) $config['mailreports']['schedule'] = array(); $a_mailreports = &$config['mailreports']['schedule']; if (isset($id) && $a_mailreports[$id]) { if (!is_array($a_mailreports[$id]['row'])) $a_mailreports[$id]['row'] = array(); $pconfig = $a_mailreports[$id]; $a_cmds = $a_mailreports[$id]['cmd']['row']; $a_logs = $a_mailreports[$id]['log']['row']; $a_graphs = $a_mailreports[$id]['row']; } if (!is_array($pconfig)) $pconfig = array(); if (!is_array($a_cmds)) $a_cmds = array(); if (!is_array($a_logs)) $a_logs = array(); if (!is_array($a_graphs)) $a_graphs = array(); if ($_GET['act'] == "del") { if (is_numeric($cmdid) && $a_cmds[$cmdid]) { unset($a_cmds[$cmdid]); $a_mailreports[$id]['cmd']['row'] = $a_cmds; write_config(); header("Location: status_mail_report_edit.php?id={$id}"); return; } elseif (is_numeric($logid) && $a_logs[$logid]) { unset($a_logs[$logid]); $a_mailreports[$id]['log']['row'] = $a_logs; write_config(); header("Location: status_mail_report_edit.php?id={$id}"); return; } elseif (is_numeric($graphid) && $a_graphs[$graphid]) { unset($a_graphs[$graphid]); $a_mailreports[$id]['row'] = $a_graphs; write_config(); header("Location: status_mail_report_edit.php?id={$id}"); return; } } $frequencies = array("daily", "weekly", "monthly"); $daysofweek = array( "" => "", "0" => "sunday", "1" => "monday", "2" => "tuesday", "3" => "wednesday", "4" => "thursday", "5" => "friday", "6" => "saturday"); $dayofmonth = array("", "1", "15"); if ($_POST) { unset($_POST['__csrf_magic']); $pconfig = $_POST; if ($_POST['Submit'] == "Send Now") { mwexec_bg("/usr/local/bin/mail_reports_generate.php {$id}"); header("Location: status_mail_report_edit.php?id={$id}"); return; } $friendly = ""; // Default to midnight if unset/invalid. $pconfig['timeofday'] = isset($pconfig['timeofday']) ? $pconfig['timeofday'] : 0; $friendlytime = sprintf("%02d:00", $pconfig['timeofday']); $friendly = "Daily at {$friendlytime}"; // If weekly, check for day of week if ($pconfig['frequency'] == "weekly") { $pconfig['dayofweek'] = isset($pconfig['dayofweek']) ? $pconfig['dayofweek'] : 0; $friendly = "Weekly, on {$daysofweek[$pconfig['dayofweek']]} at {$friendlytime}"; } else { if (isset($pconfig['dayofweek'])) unset($pconfig['dayofweek']); } // If monthly, check for day of the month if ($pconfig['frequency'] == "monthly") { $pconfig['dayofmonth'] = isset($pconfig['dayofmonth']) ? $pconfig['dayofmonth'] : 1; $friendly = "Monthly, on day {$pconfig['dayofmonth']} at {$friendlytime}"; } else { if (isset($pconfig['dayofmonth'])) unset($pconfig['dayofmonth']); } // Copy back into the schedule. $pconfig['cmd']["row"] = $a_cmds; $pconfig['log']["row"] = $a_logs; $pconfig["row"] = $a_graphs; $pconfig['schedule_friendly'] = $friendly; if (isset($id) && $a_mailreports[$id]) $a_mailreports[$id] = $pconfig; else $a_mailreports[] = $pconfig; // Fix up cron job(s) set_mail_report_cron_jobs($a_mailreports); write_config(); configure_cron(); header("Location: status_mail_report.php"); return; } $pgtitle = array(gettext("Status"),gettext("Edit Mail Reports")); include("head.inc"); ?>
General Settings
Report Schedule
Frequency
Select the frequency for the report to be sent via e-mail.
Day of the Week
Select the day of the week to send the report. Only valid for weekly reports.
Day of the Month
Select the day of the month to send the report. Only valid for monthly reports.
Hour of Day
Select the hour of the day when the report should be sent. Be aware that scheduling reports between 1am-3am can cause issues during DST switches in zones that have them. Valid for any type of report.
Report Commands

Save the report first, then items may be added.
  ')">
Report Logs

Save the report first, then items may be added.
  ')">
Report Graphs

Save the report first, then items may be added.
  ')">
"> "> ">



Configure your SMTP settings under System -> Advanced, on the Notifications tab.