Exporting BITE Status Information

The bite_export program reads the Bitex configuration and exports configured status information to a CSV file in ASCII format. The program listens to the multicast UDP messages and retrieves data from there.

You can set bite_export to run in the background as a service using the /etc/init.d/bite_export script.

  1. To configure the tool, type a command similar to the following example:
    ${install_root}/bin/bite_export -port 30785 -interval 2 -history -output /var/log/irisrda/bite_ascii.csv &

    Use this command to configure the history option, logging interval, and the output file.

    In the example the command logs Bitex status to the defined output file every 2 seconds (-interval 2).

    If you change the multicast port, update the configuration here.

  2. To use the -history option, you must configure logrotate.

    The -history option does not overwrite the file. Instead, it appends the data to the end of the file.

    If you do not use the -history option, only the latest data is saved to output file and old values are overwritten.
    1. Create and edit the /etc/logrotate.d/sigmet-bite_export file.

      The default file contents are:

      /var/log/irisrda/bite_ascii.csv {
          copytruncate
          missingok
          notifempty
          daily
          rotate 5
          su root users
      }

      This copies the contents of the output file once a day to /var/log/irisrda/bite_ascii.csv.1, from .1 -> .2 and so on. It leaves the original output file empty.

      This configuration stores 5 days of history, each in its own file and deletes log files older than 5 days.

    2. You can configure the rotate 5 parameter to save more history data.

      For example, to save 100 days of history, change the value to rotate 100.

      This creates files:

      /var/log/irisrda/bite_ascii.csv.1
      /var/log/irisrda/bite_ascii.csv.2/var/log/irisrda/bite_ascii.csv.100
    3. As root, add file permissions 644 to the logrotate sigmet-bite_export configuration file with the following command:
      # chmod 644 /etc/logrotate.d/sigmet-bite_export
    4. To check the logrotate configuration, run the debug command:
      # logrotate –d/etc/logrotate.conf

      Look for the bite_export in the command output and check for errors.

      This command indicates what would have happened if the rotate had been run. It does not rotate the actual log files.

    5. To force logrotate to run, type the following command:
      # logrotate –f /etc/logrotate.conf

      This rotates the log files.

  3. To manage how bite_export starts and stops, login as root and use the following commands.
    Command Description
    # chkconfig --add bite_export
    Enable bite_export to start automatically during boot-up.
    # chkconfig --del bite_export
    Disable bite_export from starting automatically during the boot-up.
    # service bite_export start
    Start bite_export if it is not already running.
    # service bite_export stop
    Stop bite_export.