Skip to content

Manta's remote service pinger and "Is it up?" dashboard.

License

Notifications You must be signed in to change notification settings

TritonDataCenter/manta-madtom

Repository files navigation

manta-madtom

This repository is part of the Triton Manta project. For contribution guidelines, issues, and general documentation, visit the main Manta project page.

Madtom is the mantified node-checker, so that we have a "pretty" UI for seeing which components in the system are currently up.

Active Branches

There are currently two active branches of this repository, for the two active major versions of Manta. See the mantav2 overview document for details on major Manta versions.

  • master - For development of mantav2, the latest version of Manta. This is the version used by Triton.
  • mantav1 - For development of mantav1, the long term support maintenance version of Manta.

Repository

bin/            Commands available in $PATH.
boot/           Configuration scripts on zone setup.
deps/           Git submodules and/or commited 3rd-party deps should go
                here. See "node_modules/" for node.js deps.
docs/           Project docs (restdown)
lib/            Source files.
node_modules/   Node.js deps, either populated at build time or commited.
                See Managing Dependencies.
sapi_manifests/ SAPI manifests for zone configuration.
smf/manifests   SMF manifests.
test/           Test suite.
tools/          Miscellaneous dev/upgrade/deployment tools and data.
Makefile
package.json    npm module info (holds the project version)
README.md

Setup

git clone https://github.com/TritonDataCenter/manta-madtom.git
cd manta-madtom
make all

Development

You first need to generate a hosts configuration file. If you are working in a build zone, you should navigate the filesystem to find the etc/config.json file relative to the project's source code. If you are working off of an image that has been built and deployed, you will find the file in /opt/smartdc/madtom/etc/config.json. Once you have the file and have recreated it in your project directory under etc/config.json (which you'll have to make), you can run the following command to generate a hosts file of components you'd like to see on the madtom dashboard:

$ ./bin/generate_hosts_config.js -c etc/config.json \
    -f /var/tmp/madtom-hosts.json

Please note that if you use different file paths than those shown here, your tests for generate_hosts_config will break (unless you change those variables' values).

You'll also want to copy one of the configuration templates in the sapi\_manifests directory to a new file and fill in any required properties. For example, you might copy ./sapi\_manifests/madtom\_coal/template to etc/checker-coal.json if you are using CoaL, and the corresponding checker-lab file for developing on a lab setup.

Then fire up the madtom server (which is a very thin shim over the node-checker server):

$ node ./server.js -c ./etc/checker-{env}.json \
  -c /var/tmp/madtom-hosts.json | bunyan

Note that the order of -c is significant. Finally, point your browser at:

http://{localhost or your IP}:8080

You may have to set up SSH tunneling or an NFS server from your development environment depending on where you need to access the browser.

You should see the status of all processes running in CoaL or your lab environment.

Testing

To run the tests use the command make test. As of April 2017, these tests enforce the arguments set by the command line interface. In order to test whether or not the configuration file is generated properly despite upstream issues, you will have to manually run system-level integration tests.

Before commiting/pushing run make prepush and get a code review.