Defining File Observer jobs

Using the File Observer functionality, you can write bespoke data to a file in a specific format, upload this data to the topology service, and then visualize this data as a topology view in the Agile Service Manager UI. The File Observer is installed as part of the core installation procedure.

Remember: Swagger documentation for the observer is available at the following default location: https://<your host>/1.0/file-observer/swagger
File Observer jobs are HTTP POST requests that can be triggered via cURL or swagger, or via the example scripts provided in the $ASM_HOME/bin directory.
file_observer_common.sh
The config file you use to customize the File Observer job unique_id or service host.
The parameters defined here are then used by the file_observer_load_start.sh script to trigger the File Observer job.

The File Observer runs a 'loadFile' job that loads all requested topology data for each tenant. The loadFile job takes the name of the file to parse and load.

Lines starting with V: (vertex), E: (edge), D: (delete) or W: (wait) are treated as instruction lines to be processed. Other lines, for example lines that are empty or commented out, are ignored.

Line format
V:
The JSON payload takes the format described in the swagger documentation of the POST /resources message body.
E:
The JSON payload takes the format described in the swagger documentation for the _references section of the POST /resources message body.
W:
Takes an integer period followed by a string specifying the units.
D:
Takes a single string which is the unique ID of the vertex to delete.
Tip:
  • An example file is available in the $ASM_HOME/data/file-observer directory.
  • See the related links for more information on available timestamps formats.
Important: Ensure that the file is structured correctly. For each line of the file, information included after the closing } that matches an opening { is ignored, and no error is recorded. See the related links for more information on available timestamps formats.
Restriction:

Files to be read by File Observer must be located in the following directory: $ASM_HOME/data/file-observer

A file name specified in a File Observer job must be relative to that directory (and not absolute).

  1. Edit the file_observer_common.sh config file.
  2. Define your data file and copy the file to the following location: /opt/ibm/netcool/asm/data/file-observer/
    For example:
    cp dncim.file $ASM_HOME/data/file-observer/
  3. To start the File Observer Load job, use one of the following commands:
    To define the data file via a command line argument
    ./file_observer_load_start.sh --file dncim.file
    To define the data file via the environment
    env file=dncim.file $ASM_HOME/bin/file_observer_load_start.sh
    The load job loads all requested topology data from the file specified. This job runs only once.
You can also use the following scripts:
file_observer_load_stop.sh
Stops the job
file_observer_job_list.sh
Lists the current job status
file_observer_log_level.sh
Sets the log level
Remember: As an alternative to being configured using the Observer Configuration UI, observer jobs have scripts to start and stop all available jobs, to list the status of a current job, and to set its logging levels. These scripts can be run with -h or --help to display help information, and with -v or --verbose to print out the details of the actions performed by the script, including the full cURL command. For the on-prem version of Agile Service Manager, observer scripts are configured for specific jobs by editing the script configuration files.