Tbstatus monitoring

Tbstatus monitoring is a ruby script which makes use of the tbstatus API to gather statistics on a system. It periodically collects statistics according to a configuration file (tbstatus.yml). Results are presented in .csv files per selected module. This includes any statistics that tbstatus API can gather. E.g. trunks, signaling links status, ISUP interface status, NAPs status, calls status, etc.

Note: tbstatus.rb ruby script is different from the tbstatus command-line tool.

Download the script archive

Download the script here:

file-archive
16KB

This archive contain the gzip tar archive named tbstatus_monitor.tgz:

  • tbstatus.rb : Status script.

  • tbstatus.yml : Configuration file

  • Instructions.txt : Quick instruction

Copy the script archive to TMG

  • Transfer the .tgz file containing the script tbstatus.rb, and the configuration file tbstatus.yml to the host of TMG800, TMG3200 or TMG7800-CTRL using sFTP (Filezilla or Winscp)

  • Uncompress the file

tar xzf tbstatus_monitor.tgz
cd tbstatus_monitor

Script Usage

Adjust configuration file

Change the configuration file to select the required monitoring modules. This can be done by editing the tbstatus.yml file, you will see the below lines within.

  • To specify the output .csv file name

  • Or, output in a SQLite database file

  • To specify the file rotation period

  • To specify the statistics gathering interval

  • Configure the required module statistics

Comment out the lines (statistics) which are not required with a "#" sign. This reduces the number of files and the columns within files generated. Below example gathers the ISUP interface cic group statistics and put the result in ISUP_INTERFACE_CIC_GROUPS.csv files:

To get the list of available path or a short description of each available statistics fields:

Instead of .csv files, statistics can be saved in a SQLite database file. Below example gathers the NAPs statistics:

Execute the script in deamon mode

  • Change the script file permission

  • Execute tbstatus script in daemon mode

  • To stop it, kill the process

Execute the script on the Web Portal

Alternatively, you can start the tbstatus monitor tool in with Toolpack. Therefore, the script will start and stop automatically at the same time as Toolpack service:

  • On the Web Portal, Go to Host -> Applications -> Create New Application

Collect the data in .csv files

  • Multiple .csv files will be created in the same directory. They will be rotated and zipped according to the yml configuration. These files can be extracted from the unit with sFTP, or SSH scp commands to be analyzed by an external system.

Example files:

The result of ISUP_INTERFACE_CIC_GROUPS.csv with the above configuration would be:

Columns: date, time, path and item_name are always there. All other columns depends on the selected fields in the configuration file.

Lines: one per paths/item per update interval; in that example, there is 4 CIC groups. Note that the first entries are written at 22:24 because the script was started at that time.

Access data in the SQLite database

  • Check for the database file which matches the configuration in tbstatus.yml. Following the example above, it is:

  • Check for the database table name

  • Access the statistics in the database file

Last updated

Was this helpful?