Generating a New Topology Using the Topology Loader Utility

In Moogsoft Enterprise, you are not restricted to a single topology. For example, what if you wanted to assess the impact of application errors? You could construct an alternate topology to show the flow of information between application servers.

Overview

Add a second topology to your system using the Topology Loader utility.

  1. Use the Topology API topologies endpoint to create a new appserver topology.

  2. Use the Topology Loader utility and the file $MOOGSOFT_HOME/train/topology/appserver.csv to populate the topology with nodes and links.

  3. Use Topology API calls to verify that the node and links loaded successfully.

  4. Send an event and look at the resulting Situation using both network and appserver topology visualizations.

Step-by-Step Instructions

  1. Consider the description in the following event. Your network topology is not particularly relevant to this application error.

    curl http://localhost:8888 -H 'Content-Type: application/json' --insecure -v --data '{events:[{"signature":"EnterpriseAppServer03::Init failure","source_id":"eas03","external_id":"5842","manager":"BNT","source":"EnterpriseAppServer03","class":"appserver","agent_location":"White Plains","type":"Init failure","severity":5,"description":"wpauction failed to initialize"}]}'
  2. To examine the impact of application faults on nearby components, construct an alternate topology that connects your front-end router-firewall through load balancers to web servers, web application servers, enterprise application servers, database servers, and, finally, your mainframe. Begin by using the topologies API endpoint to create a new appserver topology.

    curl --insecure -X POST 'https://localhost/api/v1/topologies' --header 'Content-Type: application/json; charset=UTF-8' -u graze:graze --verbose --data '[{"name":"appserver","description":"Server-Based Topology","active":true}]'
  3. Verify that the topology was created successfully. You should see the network topology in the list of topologies returned.

    curl --insecure -X GET 'https://localhost/api/v1/topologies' -u graze:graze
  4. You could add links and nodes to your appserver topology using Topology API commands, but that would be tedious. Instead, submit them to the Topology Loader utility using a .csv (comma-separated values) file. The links and nodes for the appserver topology are in a file on your instance, $MOOGSOFT_HOME/train/topology/appserver.csv. Change to the super user if you have not already done so and examine the contents of this file.

    sudo su
    cat $MOOGSOFT_HOME/train/topology/appserver.csv

    You'll recognize the names of the nodes in the file. In fact, the appserver.csv file uses the same nodes as the network topology, though the links are different.

    Even though the appserver and network topologies use all of the same nodes, that is not a requirement. Topologies can partially overlap or be completely separate. For example, you could maintain separate topologies for separate geographic regions, or for separate teams.

  5. Invoke the topology loader utility to load the appserver nodes and links. Substitute your URL for the example URL below.

    topology_loader --file=$MOOGSOFT_HOME/train/topology/appserver.csv --credentials=graze:graze --hostname=tanisha-johnson-topo.datalab.moogsoft.com --topology=appserver

    You should see messages indicating that all of the links were sent.

  6. Use API calls to check that the nodes and links loaded correctly.

    curl --insecure -X GET 'https://localhost/api/v1/topologies/appserver/nodes' -u graze:graze
    curl --insecure -X GET 'https://localhost/api/v1/topologies/appserver/links' -u graze:graze

    Note that the nodes and links can optionally include descriptions. They are no descriptions in these topologies, so the API calls return the description values as 'null'.

  7. In the UI, go to Settings > Algorithms > Cookbook Recipes > Source.

  8. Set the named topology to 'appserver' in the Topology Filter and save your changes.

  9. Close any open Situations.

  10. Send an application event from your terminal.

    curl http://localhost:8888 -H 'Content-Type: application/json' --insecure -v --data '{events:[{"signature":"EnterpriseAppServer03::Init failure","source_id":"eas03","external_id":"5842","manager":"BNT","source":"EnterpriseAppServer03","class":"appserver","agent_location":"White Plains","type":"Init failure","severity":5,"description":"wpauction failed to initialize"}]}'
  11. In the UI, go to Workbench > Open Situations. Doubleclick on the Situation and go to the Topology tab.

  12. Set neighbor nodes to '4' in display options. You can now examine the application error in the context of the appserver topology.

    To see this view, you had to change the topology filter in your Cookbook Recipe. What if you want to use multiple topologies at the same time? You could define multiple Cookbooks and Recipes with different topology filters. It would be better, though, if you could choose topology filters in a single Cookbook dynamically based on the alert contents. You can do this with inferred topology and the Workflow Engine.

This concludes the lab section.