Nms-templates

From I Will Fear No Evil
Jump to navigation Jump to search

NMS Templates for API

Since I cannot know how people are going to want to use or leverage the system a template system is in place to support or extend how the NMS behaves. Currently all API templates reside in <root>/templates. The most common area where this seems like it will be used is for working with metrics. Getting them pretty so we can save the data seems to be the hardest thing we can do. Both RRDTool and Graphite are particular in how they want their metric data. Making this a template system allows for dealing with the oddities of different checks.

Structure

Each of the different template types are in their own directory. Graphite, rrd, render, etc. Several directories are stubs, such as email, and ticketing.. This is intentional right now, as the code has not been written, but will have to exist sooner or later :)

Examples

The skeleton directory has some basic examples of how to create templates. This is currently focused on metrics, but other examples will be put in place when more templates are created going forward. Additionally, there are notes.txt files floating about in different directories with more details on the planned logic, or the reason I was going a certain direction. This may change over time however. Thats the nice thing about templates, we can do that easily to munge the data in the way we need on a case-by-case basis.


NMS Templates for GUI

The NMS GUI is a strange little beast currently. I want uniformity acrosss the site but still allow support for additional "things". The only simple solution I have found so far is using a directory where if the files exist load them, otherwise use the shared files. This seems to work well, and still allow for things such has event pages to have different details or different menus to display when appropriate.

Structure

includes is the storage directory where the override files live. If they are there, they will be loaded, otherwise we go up one directory to the shared folder and load the default pages from there. This SHOULD guarentee some kind of consistency across the pages and allow for easier troubleshooting. At least that is my hope. Additionally with the debugger function being able to be called anywhere, we should be able to more quickly isolate oddball stuff seen within the GUI.

Examples

There is a directory called template under public which is what all other pages should be based off of so we can confirm consistency. It follows the logic used in the other pages, and allows for fast creation of new page "classes" (directories based on subject).