Can I receive reports regularly by e-mail?
Short answer
Yes. In a Load Balancer → Profiles → Reports profile, E-mail Report is turned on; E-mail Addresses, E-mail Report Content (PDF, XLSX) and E-mail Frequency (Daily, Weekly, Monthly, Annual) are selected, and the profile is assigned to the vService with the Report option. According to the device clock, the report is sent covering the previous day every day at 07:30 for daily, the previous week on Monday at 03:30 for weekly, the previous month on the 1st of the month at 05:30 for monthly, and the previous year on January 1 at 06:30 for annual. For sending, the E-mail Settings (SMTP) on the Notification Management screen must be configured; in a cluster, the report is sent by the device whose Cluster ID is 1.
Problem: Reports Are Produced Manually Every Time
The same vService report is produced and shared manually every day or every month. The reports are required to be sent automatically to the relevant people at certain intervals.
Solution: Two Methods
The two methods set the same Reports profile fields; one from the interface, the other from WEB-CLI.
| Your situation | Suitable method |
|---|---|
| Setting up the periodic e-mail report from the interface | Method 1: Reports profile → E-mail Report |
| Setting it up from the command line | Method 2: WEB-CLI |
Method 1: Reports Profile → E-mail Report Recommended
- How it works The profile sends the report covering the previous period at the selected frequencies, attached to the e-mail in the selected formats.
- Where it is openedLoad Balancer → Profiles → Reports → E-mail Report
- RequirementE-mail Settings (SMTP); assignment of the profile to the vService
- vService type HTTP · L7 TCP (report divisions are produced only on an HTTP vService)
- More than one profile If more than one Reports profile is assigned to the vService, the e-mail setting of each profile is applied separately; each profile sends to its own addresses with its own formats and frequencies.
Step-by-Step Configuration
On the Settings → General Settings → Notification Management screen, the E-mail Settings tab is selected and the Edit button is clicked (E-mail Settings editing form). If SMTP is not defined, the report e-mail is not sent.
Host Device, Port, Authentication, Security and Sender Address are entered.
An address is written in the Test E-mail Address field next to the button and the Test E-mail Settings button is clicked; the arrival of the test e-mail is confirmed.
The Save E-mail Settings button is clicked.
On the Load Balancer → Profiles → Reports screen, the Add button is clicked for a new profile, or the Edit button for an existing profile (how to add).
The E-mail Report switch is turned on (off by default). Recipient addresses are added to the E-mail Addresses field with +. E-mail Report Content (PDF, XLSX) and E-mail Frequency (Daily, Weekly, Monthly, Annual) are selected; when the switch is turned on, all formats and frequencies come selected, and the unwanted ones are unchecked. At least one selection must remain in each of the two fields (e-mail report settings).
The Add button is clicked for a new profile, or the Edit button for an existing profile. If the profile is already assigned to a vService, the change takes effect immediately on those vServices and the next steps are skipped.
On the Load Balancer → Load Balancer vService List screen, the vService is right-clicked and Edit is selected.
In the Details panel on the right of the form, Report is checked and the created profile is selected from the profile list. If more than one profile is selected, the first one becomes the main profile.
The Save button is clicked. The progress of applying the change is followed from the sync indicator at the bottom right of the screen. In a cluster setup, with the default auto-sync the change is also sent to the peer device; if Manual Sync Mode is on, it is sent manually with Synchronize. Report data is collected from the moment the profile is assigned.
Verification
Resend Daily Reports is selected from the second menu in the Report tab of the vService screen; only the frequencies defined in the profile are listed in the menu. In a cluster setup, this operation too sends the e-mail only when it is performed from the interface of the device whose Cluster ID is 1.
An e-mail with the previous day's report attached arrivesIn the Load Balancer → Profiles → Reports list, the E-mail Report column of the profile is checked (listing screen).
1 People (Daily)Method 2: WEB-CLI
- How it works A Reports profile with the e-mail report on is created from the command line and assigned to the vService.
- Where it is opened TR7 WEB-CLI →
lb report·lb service(lb report commands) - Requirement WEB-CLI access; E-mail Settings (SMTP)
- vService type HTTP · L7 TCP (report divisions are produced only on an HTTP vService)
Step-by-Step Configuration
name, xlsxMaxLines and pdfMaxLines are required fields and are written in this order. The command below creates a new profile that sends only a daily PDF report; if --emailFrequency.0 and --emailFileTypes.0 are not written, on the command line the default format is only PDF and the default frequency is all four frequencies:
lb report add name gunluk-rapor xlsxMaxLines 1000 pdfMaxLines 50 --emailReport true --emailAddresses.0 noc@example.com --emailFileTypes.0 pdf --emailFrequency.0 dailyA second recipient is added to the same line with --emailAddresses.1, and an XLSX attachment with --emailFileTypes.1 xlsx.
lb service update id <vService> --reportProfile gunluk-rapor--reportProfile is the main report profile of the vService; if the vService already has a main profile, the command replaces it. The current assignments are first viewed with lb service show <vService>.
Verification
Command: lb report show gunluk-rapor
emailReport true · emailFrequency only dailyResend Daily Reports is selected from the second menu in the Report tab of the vService screen (in a cluster setup, from the interface of the device whose Cluster ID is 1).
An e-mail with the previous day's report attached arrivesCommon Mistakes
- Not defining SMTP. If there are no E-mail Settings in Notification Management, the report e-mail is not sent.
- Leaving the frequencies as they are in the interface. When E-mail Report is turned on, all frequencies come selected; unwanted weekly, monthly and annual reports are also sent.
- Expecting the report from the second device of the cluster. The scheduled report is sent only by the device whose Cluster ID is 1.
- Expecting the first report to cover the full period. Data is collected from the moment the profile is assigned; the time before the assignment appears empty in the report.
- Expecting divisions on an L7 TCP vService. Report divisions are produced only on an HTTP vService (scope and limits).
How it is done in the documentation
