Documentation forServ-U MFT & Serv-U FTP Server

User properties: Events

With the MFT edition of the Serv-U File Server, you can automatically associate file server events with email notifications, balloon tip alerts or posts to the Windows Event Log or Microsoft Message Queue (MSMQ). For example, you might want to be notified in the event of a listener failure or whenever a new file is uploaded.

To access events for an individual user, select Users from the Global or Domain menu, click Edit, and select the Events tab from the User Properties window.

Create common events

To instantly populate the events list with the most commonly used file server events:

  1. Click Create Common Events.
  2. Select the event action to apply to all common events.
  3. Enter the email address to receive all notifications if you selected Send Email.
  4. Enter the Message Queue Path if you selected Write to Microsoft Message Queue.
  5. Click OK.
  6. The 13 most common file server events are created. These can be customized by selecting an event and clicking Edit.

Add an event

  1. Click Add.

  2. Select the Event Type.
  3. Enter a name and description for this event.

    If you want to create but not immediately enable an event, uncheck the Enable event box.

  4. Select the action to be triggered by this event, and complete the associated fields.
  5. The actions that can be triggered are:

    Event Action Description
    Send Email

    You can configure email actions to send emails to multiple recipients and to Serv-U File Server groups when an event is triggered.

    Enter the recipients in the To and BCC fields. Separate email addresses by commas or semicolons.

    To send emails to Serv-U groups, click the Group icon and drag the required groups from the Available Groups column to the Group Email List column.

    Enter the subject and message. You can use system variables to include data specific to the event.

    Show Balloon Tip Balloon Tips are displayed in the system tray when an event is triggered. Balloon tip actions require a Balloon Title and Balloon Message.

    You can use system variables to include data specific to the event.

    Execute Command (not available for Common Events)

    You can configure the execute of a file when an event is triggered. Execute command actions contain an Executable Path, Command Line Parameters, and a Completion Wait Time parameter. For the Completion Wait Time parameter, you can enter the number of seconds to wait after starting the executable path. Enter zero to execute immediately.

    Time spent waiting delays any processing that Serv-U can perform.

    A wait value should only be used to give an external program enough time to perform an operation, such as move a log file before it is deleted (for example, $LogFilePath for the Log File Deleted event). You can use system variables to use data specific to the event.

    Write to Windows Event Log (Windows only)

    By writing event messages to a local Windows Event Log, you can monitor and record Serv-U activity using third-party network management software.

    The message entered into the Log Information field is written into the event log. This is normally either a human-readable message (for example, filename uploaded by person) or a machine-readable string (for example, filename|uploaded|person), depending on who or what is expected to read these messages. System variables are supported for this field. This field can be left blank, but usually is not.

    Write to Microsoft Message Queue (MSMQ) (Windows only)

    Microsoft Message Queuing (MSMQ) is an enterprise technology that provides a method for independent applications to communicate quickly and reliably. Serv-U can send messages to new or existing MSMQ queues whenever an event is triggered. Corporations can use this feature to tell enterprise applications that files have arrived, files have been picked up, partners have signed on, or many other activities have occurred.

    Microsoft message queues created in Windows do not grant access to SYSTEM by default, preventing Serv-U from writing events to the queue. To correct this, after creating the queue in MSMQ, right-click it, select Properties, and then set the permissions so that SYSTEM (or the network account under which Serv-U runs) has permission to the queue.

    These events have the following two fields:

    Message Queue Path: The MSMQ path that addresses the queue. Remote queues can be addressed when a full path (for example, MessageServer\Serv-U Message Queue) is specified. Public queues on the local machine can be addressed when a full path is not specified (for example, .\Serv-U Message Queue or Serv-U Message Queue). If the specified queue does not exist, Serv-U attempts to create it. This normally only works on public queues on the local machine. You can also use Serv-U system variables in this field.

    Message Body: The contents of the message to be sent into the queue. This is normally a text string with a specific format specified by an enterprise application owner or enterprise architect. Serv-U system variables can also be used in this field. This field may be left blank, but usually is not.

    Only the email action is available to users other than Serv-U server administrators.

Edit an event

  1. Select the event you want to edit and click Edit.
  2. Edit the event details and the event filters as required.
  3. Click Save.

Add an event filter

Event filters allow you to control when a Serv-U event action is triggered. By default, event actions are triggered each time the event occurs. Event filters allow events to be triggered only if certain conditions are met.

For example, a standard event may trigger an email each time a file is uploaded to the server. However, by using an event filter, events can be triggered on a more targeted basis, such as configuring a File Uploaded event to send an email only if the file name contains the string important. Thus an email would be sent when the file Important Tax Forms.pdf is uploaded but not for other files.

Additionally, you could configure a File Upload Failed event to run only when the FTP protocol is used, not triggering for failed HTTP or SFTP uploads. You can do this by controlling the variables and values related to the event and by evaluating their results when the event is triggered.

To add an event filter to an event:

  1. Click the Events Filters tab.
  2. Click Add.

  3. Enter the following filter information:

    Name

    The name of the filter, used to identify the filter for the event.

    Description (Optional) The description of the event, which may be included for reference.
    Logic This determines how the filter interacts with any other filter set up for an event. In most cases, AND is used, and all filters must be satisfied for the event to trigger. The function of AND is to require that all conditions be met. However, the OR operator can be used if there are multiple possible satisfactory responses (for example, abnormal bandwidth usage of less than 20 KB/s OR greater than 2000 KB/s).
  4. Click Add to open the File Comparison window.
  5. Select the System Variable to be used in the comparison.
  6. Select the comparison method.
  7. Enter the value the system variable is to be compared to. The following wild cards can be used.

    *

    The asterisk wildcard matches any text string of any length. For example:

    • An event filter that compares the $FileName variable to the string data* matches files named data, data7, data77, data.txt, data7.txt, and data77.txt.

    ?

    The question mark wildcard matches any one character, but only one character. For example:

    • An event filter that compares the $FileName variable to the string data? matches a file named data7 but not data, data77, data.txt, data7.txt, or data77.txt.
    • An event filter that compares the $FileName variable to the string data?.* matches files named data7 and data7.txt but not data, data77, data.txt, or data77.txt.
    • An event filter that compares the $Name variable to the string A???? matches any five-character user name that starts with A.

    []

    The bracket wildcard matches a character against the set of characters inside the brackets. For example:

    • An event filter that compares the $FileName variable to the string data[687].txt matches files named data6.txt, data7.txt and data8.txt but not data5.txt.
    • An event filter that compares the $LocalPathName variable to the string [CD]:\* matches any file or folder on the C: or D: drives.

    You can use multiple wildcards in each filter. For example:

    • An event filter that compares the $FileName variable to the string [cC]:\*.??? matches any file on the C: drive that ends in a three letter file extension.
    • An event filter that compares the $FileName variable to the string ?:\*Red[678]\?????.* matches a file on any Windows drive, contained in any folder whose name contains Red6, Red7 or Red8, and that also has a five character file name followed by a file extension of any length.
  8. Select the data type.
  9. And another filter for this event or click Save to close.

Filter examples

Example 1. An administrator may want to raise an email event when the file HourlyUpdate.csv is uploaded to the server, but not when other files are uploaded. To do this, create a new event in the Domain Details > Events menu. The Event Type is File Uploaded, and on the Event Filter tab a new filter must be added. The $FileName variable is used and the value is HourlyUpdate.csv as shown below:

Example 2. It may be necessary to know when a file transfer fails for a specific user account. To perform this task, create a new File Upload Failed event, and add a new filter.

The filter comparison is the $Name variable, and the value to compare is the user name, such as ProductionLineFTP:

Example 3, using wildcards. You can also filter for events based on specific folders using wildcards. It may be necessary to trigger events for files uploaded only to a specific folder, such as when an accounting department uploads time-sensitive tax files. To filter based on a folder name, create a new File Uploaded event in the Domain Details > Events menu, and set it to Send Email. Enter the email recipients, subject line, and message content, and then open the Event Filters page. Create a new event filter, and add the filter comparison If $LocalPathName = (is equal to) C:\ftproot\accounting\* with the type of (abcd) string. This will cause the event to trigger only for files that are located within C:\ftproot\accounting\.