xDR File Push Functionality

The ESS has the capability of simultaneously fetching any types of files from one or more chassis. That is, it can fetch CDR, EDR, NBR, UDR file, etc.

The chassis is configured such that the xDR files can either be pulled from chassis by ESS using python scripts, or the CDR files can be automatically pushed by chassis to any external server, in this case, ESS. ESS then forwards these files to the required destinations.

In the PUSH model, the transfer of CDR files will be done from within a context on the chassis. The files are collected from the SMC hard disk or in-memory file system and will be transferred to ESS. Once the file is transferred successfully, according to the configuration, the file will be either removed from the chassis or kept as is.

This Appendix includes the following topics:

Configuring HDD

To use the hard disk for storing the EDR/UDR files, the following configuration needs to be applied.

configure
      context  <context_name>
         edr-module
active-charging-service
         cdr
use-harddisk
               end

Applying this configuration results in EDR/UDR files to be transferred from RAMFS on the PSC card to the hard disk on the SMC card. On the hard disk, the EDR/UDR files are stored in the /records/edr and /records/udr directories respectively.

The default value of use-harddisk is set to FALSE, indicating that, by default, the usage of hard disk is disabled.

This configuration can be applied either in EDR / UDR module, but it is applicable for both EDR and UDR modules. Configuring in one of the modules prevents the configuration to be done in the other module. Hence, it is must to remove the configuration from the current module to apply it in the other module.

To disable the usage of hard disk, use the following command:

no cdr use-harddisk

In 12.3 and earlier releases, see the HDD Storage chapter in the AAA and GTPP Interface Administration and Reference for more information on HDD. In 14.0 and later releases, refer to the GTPP Interface Administration and Reference

Configuring Push Functionality

Before configuring the push functionality, you must make sure that the SSH Daemon (sshd) config on the external server is ready to receive the files.

IMPORTANT:

Make sure that the SSH Daemon is running on the ESS server and has appropriate configuration for receiving the files from one or more chassis.

Make sure the following configuration changes are done in the /etc/ssh/sshd_config file on the ESS server.
  • PasswordAuthentication yes
  • UsePAM no

Any changes to the /etc/ssh/sshd_config file needs sshd to re-read the config file. For this to happen, get the pid of the sshd process and execute this command kill -1 <pid of the sshd>

Now, the sshd on the ESS is ready to receive the files from chassis using push mode. The push functionality can be configured on chassis.

To configure the push functionality, use the following command:

configure
      context  <context_name>
         edr-module
active-charging-service
         cdr { transfer-mode [ pull | push { primary { encrypted-url | url } <value> [ { encrypted-secondary-url | secondary-url } ] ]  | push-interval <push_interval>  | remove-file-after-transfer | use-harddisk }
               end
Notes:
  • If pull mode is selected, the ESS server pulls the xDR files from chassis. If push mode is selected, an application process on the chassis will be responsible for pushing the xDR files as and when needed. By default, the transfer mode is set to pull.

    IMPORTANT:

    The change in the file transfer mode does not require any reboot of the chassis and ESS.

  • Please note the following points before switching between transfer modes:
    • The chassis should first remove all temporary files and directories that are created while pushing files to ESS.
    • Changing transfer mode from ‘pull’ to ‘push’ - You should first remove the entry of chassis’ host from the list of hosts maintained in ESS configuration file. Then disable ‘pull’ from ESS and change the transfer mode to ‘push’ through the specified CLI command.

      IMPORTANT:

      Make sure that the push server URL specified in the CLI is accessible from the local context. Also, make sure that the base directory mentioned contains edr and udr directories created within it.

    • Changing transfer mode from ‘push’ to ‘pull’ - You should first disable ‘push’ from chassis and then manually remove the host directory of the chassis’ from the base directory path.
      After removing the host directory, ESS configuration file should be altered to have entry of corresponding chassis in pull hosts list.
      Then, use the CLI command to enable ‘pull’ on ESS. Any of the ongoing push activity will continue till all the file transfers scheduled is completed. If there is no push activity at the time of this configuration change, all the push related configuration is nullified immediately.
  • If push mode is selected, it is mandatory that you specify the ESS server URL to which the xDR files need to be transferred to. This allows user to configure a primary and a secondary server. Whenever a file transfer to the primary server fails for 4 times, the files will be transferred to the secondary server. The transfer will switch back to the primary server under the following conditions.
    • Transfer failures to secondary server for 4 times
    • Time elapsed for 30 minutes from the time it switched from primary server
    The server can be specified in the standard URL format similar to the following:
    scheme://user:password@host
    Currently, for push, only sftp scheme is supported. Configuring a secondary server is optional.
    For example:
    cdr transfer-mode 
    push  primary url sftp://less-user:staretnt@1.1.1.1 server secondary secondary-url sftp://less-user:starent@2.2.2.2 
    
  • Once the file transfer is completed, the file is removed from the disk if remove-file is configured through the CLI. If not, the files are kept as is on the disk. Once the disk usage reaches a threshold limit, some of the files transferred already are removed to make room for new CDR files. By default, a file is removed after its successful transfer.

Pushing xDR Files Manually

To manually push xDR files to the configured ESS, in the Exec mode, enter the following command:

cdr-push { all | local-filename <file_name> }
Notes:
  • Before you can use this command, in the EDR/UDR Configuration Mode, the CDR transfer mode and file locations must be set to ‘push’.
  • <file_name> must be absolute path of the local file to push.
  • If the file push is successful, the file name will have the prefix “tx.” Also, the transferred files will be moved to the /records/edr/TX directory. The prefix “prog.” indicates the file transfer is in progress.
    For the files that failed to transfer, “failed.” is added as a prefix to the file name.

    IMPORTANT:

    A new temporary directory named "TX" is created within /records/edr and /records/udr directories during the push activity. This directory contains the successfully pushed files. Tampering of any of the directories/files within /records file system is not allowed, and doing so may result into an unexpected behavior.

During the push activity, if one more push is triggered i.e., either due to a periodic timer expiry or due to a manual push, then the push request is queued. Once the first push is completed, the queued request will be processed. At any time, there can be a maximum of one periodic push and one manual push that can be queued. Once the queue is full, the subsequent push triggers are ignored / failed.

ESS Directory Structure

This section describes the internal directory structure of the ESS server.

The chassis creates individual directories by its name under the base directory. Also, separate sub-directories are created for edr and udr under the chassis’ directory. Thus, the directory structure should be similar to the following:

|_____ <Local data directory > e.g. /less/ess/data

        | |_____<STX-1> e.g. /less/ess/data/stx-1

             | | |_____udr

                 | | | |______temp

                  | | | |______temp_dest1

                  | | | |______temp_dest2

                  | | | |______temp_dest3

             | | |_____edr

                 | | | |______temp

                  | | | |______temp_dest1

                  | | | |______temp_dest2

                  | | | |______temp_dest3

        | |_____<STX-2> e.g. /less/ess/data/stx-2

             | | |_____udr

                 | | | |______temp

                  | | | |______temp_dest1

                  | | | |______ temp_dest2

                  | | | |______ temp_dest3

             | | |_____edr

                 | | | |______ temp

                  | | | |______ temp_dest1

                  | | | |______ temp_dest2

                  | | | |______ temp_dest3

The STX-n indicates the name of the chassis.

In case of cluster environment, the chassis is configured to push the files to central location on shared disk so that active ESS cluster nodes will be able to retrieve the files in case of switchover / failover.

In case of any chassis failure during file transfer, it will push the half-cooked file again. Since chassis is pushing the files to ESS, missing of any files is reported by chassis and if some files are deleted due to insufficient disk space, the chassis generates an alarm.

Log Maintenance

This section provides information on the logs maintained during file transfer.

The file transfer script generates separate logs like the pull and push process under the configured log directory. The script creates separate directory for the logs as shown below:

Log directory name: FTRANSFER_LOG_date_time

Log file name: ftransfer.log

The file transfer process generates logs under the following events:
  • When script is started
  • Detection of addition or removal of new host
  • Detection of UDR or EDR files addition or removal
  • Successful transfer of file (Link creation or copy operation)
  • Failure during transfer of file (Link creation or copy operation)