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 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
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 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, “Email on Upload”.
- Press the Add 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, we need to add two conditions or filters to the rule.
- There needs to be a filter that ensures this is a 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.
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.
- Add an Email Someone 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.
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 a 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 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.
- Finally, we only want this rule to trigger whenever the file is uploaded from 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.
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 user batch_processdownloads 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
This rule will detect a file upload to the /uploads/temp folder by a user named batch_process, and will execute a batch file operation to upload the file 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 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, “Forward 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 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 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 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.
- Finally, 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.
Adding an executable Target to the Event Targets page
In order to upload the file to another server, we will need to execute a program on the server machine that can be invoked by Cerberus to upload the file. There are several command-line clients available for command-line file uploading using a variety of protocols. cURL and Psftp are two popular command-line clients for uploading and downloading files. For this rule, we will use cURL to upload the file using SSH SFTP to another folder. To use cURL as part of an event rule action, we need to first add it as an available Executable target on the Event Targets page.
- Go the Event Targets page of the Event Manager
- Click the New button on the top-right corner of the Event Targets page
- Under the Executable Target field box, select the file path to the cURL executable
- Press the Add button to the right of the Executable Path edit box to add cURL as an available event rule action target
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 re-upload a newly uploaded file to another server using cURL.
- Add a Launch an Executable action
- Select cURL executable path as the operation sub-action
- Enter the command line:
-k -u upload_user:test sftp://127.0.0.1/ftproot/test/{{LFN}} -T {{LFP}}
The above command line is cURL-specific, and says to login to the SFTP server at 127.0.0.1 and upload the file to /ftproot/test/ using the credentials upload_user and password test. The filename of the original uploaded file is appended to the remote path using the variable {{LFN}}, and the target file to be upload is referenced by the full local file path variable {{LFP}}. That is the full path to the file that was just uploaded – the file that kicked off this event.
To watch a video summarizing these instructions, click here.
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
You will need to 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.
- In 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.