These are examples of some of the most popular rules you can create in Cerberus. For more information on how to create the numerous types of rules Cerberus offers, see the Events Manager Rule Examples documentation in our Online Help or watch our Event Manager Overview video.
Click on the rule example you'd like to review on the list below
- Send an Email Notification on File Upload
- Copy an Uploaded File to another Folder
- Delete a File after Download
- Transfer an Uploaded File to Another Server
- Email a Session Report after a User Logs Off
- Add a Scheduled Task to create a backup file of the server configuration
Send an Email Notification on File Upload
This rule will automatically send out an email to someone whenever a file is uploaded to a specific folder.
Adding the New Rule
- Go to the Event Rules page of the Event Manager
- Click the New button. The Add A New Event Rule dialog will appear.
- Select the File Transfer Event Rule Type for your new rule. This event is triggered whenever a user uploads a file to the server or downloads a file from the server.
- Enter a name for your rule in the Rule Name edit box. For example, “Email on Upload”.
- Press the Add New Rule button on the Add A New Event Rule dialog to save and add the new Event Rule. The event rule will be selected and ready for editing on the Edit Rules page.
Selecting the Rule Matching Mode
Select the Match If All Filters Match mode. Selecting this option means that this rule will only be triggered whenever the rule’s event occurs and if all of the conditions listed are fulfilled.
Adding the Rule Conditions
A rule’s actions are carried out whenever that rule’s event trigger happens. In this example, a File Transfer Event triggers our rule. To limit this rule to only triggering when a file is uploaded to a specific folder, we need to add two conditions or filters to the rule.
- There needs to be a filter that ensures this is an upload and not a download. To limit this rule to only triggering on upload, select the {{D}}, Is a Download, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to false.
- We only want this rule to trigger whenever the file is uploaded to the /uploads/temp folder. Select the {{RFP}}, Remote File Path, variable from the conditions drop-down list. Select Starts With as the comparison and set the value to /uploads/temp. This condition can also use the {{LFP}}, Local File Path, variable from the conditions drop-down list. You would then select Contains as the comparison and set the value to /uploads/temp.
The Email on Upload example rule.
Adding the Rule Actions
When an event matches all of the conditions of a rule then the rule actions are carried out. In this case, we want to email someone when a user uploads a file to a specific folder. Before adding this condition, ensure you have added an SMTP Server on the Event Targets page.
- Select the Email Event Notification action
- Select an SMTP server as the operation sub-action (this will only be selectable if you have added an SMTP Server on the Event Targets page)
- Enter the name and email of the person you wish to email when this rule triggers
- Enter the subject for the email, or leave it blank for the default email subject
To watch a video summarizing these instructions, click here.
Copy an Uploaded file to another Server
This rule will detect a file upload to the /uploads/temp folder by a user named batch_process, and will execute a copy to another server
Adding the New Rule
- Go to the Event Rules page of the Event Manager
- Click the New button. The Add A New Event Rule dialog will appear.
- Select the File Transfer Event Rule Type for your new rule. This event is triggered whenever a user uploads a file to the server, or downloads a file from the server.
- Enter a name for your rule in the Rule Name edit box. For example, "Copy Uploaded File".
- Press the Add a New Rule button on the Add A New Rule dialog to save and add the new Event Rule. The event rule will be selected and ready for editing on the Edit Rules page.
Selecting the Rule Matching Mode
Select the Match If All Filters Match mode. Selecting this option means that this rule will only be triggered whenever the rule’s event occurs and if all of the conditions listed are fulfilled.
Adding the Rule Conditions
A rule’s actions are carried out whenever that rule’s event trigger happens. In this example, a File Transfer Event triggers our rule. To further limit this rule to only triggering when a file is uploaded to a specific folder, and by a specific user, we need to add three conditions or filters to the rule.
There needs to be a filter that ensures this is an upload and not a download.
- To limit this rule to only triggering on upload, select the {{D}}, Is a Download, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to false.
- We also need a filter to ensure the rule only triggers when the user batch_process uploads a file. Select the U, Username, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to batch_process.
- We only want this rule to trigger whenever the file is uploaded to the /uploads/temp folder. Select the {{RFP}}, Remote File Path, variable from the conditions drop-down list. Select Starts With as the comparison and set the value to /uploads/temp. This condition can also use the {{LFP}}, Local File Path, variable from the conditions drop-down list. You would then select Contains as the comparison and set the value to /uploads/temp.
Adding the Rule Actions
When an event matches all of the conditions of a rule then the rule actions are carried out. In this case, we want to copy the file to another folder.
Add a Launch File Operation action
Using: Copy
Filepath From: {{LFP}} (LFP = Full path to the file that was just uploaded – the file that kicked off this event.)
Filepath To: C:/UploadedFiles/{{LFN}} (LFN = The name of the file that was just uploaded)
The above action says to copy the file from the local file path (which is written dynamically) to C:/UploadedFiles/{{LFN}}.
Settings for a copy uploaded file rule
Delete a File after Download
This rule will automatically delete a file located in the /uploads/temp folder after it has been downloaded by a user named batch_process.
Adding the New Rule
- Go to the Event Rules page of the Event Manager
- Click the New button. The Add A New Event Rule dialog will appear.
- Select the File Transfer Event Rule Type for your new rule. This event type will cause the rule to be triggered whenever a file transfer takes place.
- Enter a name for your rule in the Rule Name edit box. For example, "Delete on Download".
- Press the Add a New Rule button on the Add A New Rule dialog to save and add the new Event Rule. The event rule will be selected and ready for editing on the Edit Rules page.
Selecting a Rule Matching Mode
Select the Match If All Filters Match mode. Selecting this option means that this rule will only be triggered whenever the rule’s event occurs and if all of the conditions listed are fulfilled.
Adding the Rule Conditions
A rule's actions are carried out whenever that rule’s event trigger happens. In this example, a File Transfer Event triggers our rule. To further limit this rule to only triggering when a file is uploaded to a specific folder, and by a specific user, we need to add three conditions or filters to the rule.
- There needs to be a filter that ensures this is a download and not an upload. To limit this rule to only triggering on download, select the {{D}}, Is a Download, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to true.
- We also need a filter to ensure the rule only triggers when the user batch_process uploads a file. Select the {{U}}, Username, variable from the conditions drop-down list. Select Equals as the comparison, and set the value to batch_process.
- We only want this rule to trigger whenever the file is uploaded to the /uploads/temp folder. Select the {{RFP}}, Remote File Path, variable from the conditions drop-down list. Select Starts With as the comparison and set the value to /uploads/temp. This condition can also use the {{LFP}}, Local File Path, variable from the conditions drop-down list. You would then select Contains as the comparison and set the value to /uploads/temp.
Adding the Rule Actions
When an event matches all of the conditions of a rule then the rule actions are carried out. In this case, we want to delete the downloaded file from the server when the user batch_process downloads a file from a specific folder.
- Add a Launch a File Operation action
- Select Delete File as the operation sub-action
- Enter the variable {{LFP}} to delete the local file on the server
Transfer an Uploaded file to another Server
See this article to accomplish this task with a built-in file transfer event target:
Transfer an Uploaded file to another Server
Email a Session Report after a User Logs Off
The Logoff Event Rule has a special event action allowing an administrator to be emailed a report of all user file activity that occurred while a user was logged in. The Email a Session Report event action is only available with a rule that is triggered by a Logoff event. There are several prerequisites for this event action: The reporting database must be set up and statistics collection enabled. There must also be at least one SMTP server configured on the Event Targets page.
Adding the New Rule
- Go to the Event Rules page of the Event Manager
- Click the New button. The Add A New Event Rule dialog will appear.
- Select the Logoff Event Rule Type for your new rule. This event type will cause the rule to be triggered whenever a user logs out, or their session times out.
- Enter a name for your rule in the Rule Name edit box. For example, “Email a Session Report”.
- Press the Add A New Event Rule button on the Add A New Rule dialog to save and add the new Event Rule. The event rule will be selected and ready for editing on the Edit Rules page.
Adding the Rule Conditions
We will add a single condition to make sure this rule only triggers when the user test logs out.
- Select the {{U}}, Username, variable from the conditions dropdown list. Select Equals as the comparison, and set the value to test.
Adding the Rule Actions
Add the Email Session Report action to have the system send a session report for the user after they log out.
- Select the Email Session Report action
- Enter the Email Name and Email Address of the person you wish to email and an optional Email Subject for the session report email.
- Add the action to the rule.
Note: A reporting database must be set up, and statistics collection enabled on the Reporting page of the Server Manager for Session Reporting emails to work.
Add a Scheduled Task to create a backup file of the server configuration
In Events > Scheduled Tasks, you can create a recurring task to create a backup file of the server configuration.
Adding the New Task
- Go to the Scheduled Tasks page of the Event Manager
- Click the New button. The Add A New Scheduled Task dialog will appear.
- In Task Name, give your new task a relevant name. For example, “Server config backup”.
- Press the Add New Task button on the Add A New Scheduled Task dialog to save and add the new Scheduled Task. The task will be selected and ready for editing on the Scheduled Tasks page.
Adding the Task Schedule
We will add a recurring schedule for your new task.
- Click the New button under 'On This Schedule'.
- In Start Date select the date you wish your recurring task to start.
- In Repeat Every select the recurring schedule. Available intervals range from minutes to years.
- Click Add to save your selected schedule.
Adding the Task Action
You will need to add a Launch Server Operation action to have the system write the backup file.
- Click the New button under 'Perform These Actions'.
- In Action select Launch Server Operation.
- Using select Create a backup file of the server configuration.
- In Parameter insert the full local file path, including the file name, where you wish to have your backup file written.
- Click Add to save your selected Action.
Comments
0 comments
Please sign in to leave a comment.