4.1.9 Creating a New Graph: An Example

This section documents the steps to create a graph. Before creating a graph, review the preceding sections of this chapter as Graphs and Rules use similar components. And for an overview that's specific to graphs, see Section 4.1.2, “Overview of Graph Creation”

This example creates a graph that checks and compares disk usage, by displaying the usage and total available disk space over time.

Begin by navigating to the Graphs tab and clicking the Import/Export link. Then note the Custom Rule/Graph Import button. This is where the XML file that we create will be imported.

A definition to check disk space usage may look like the following:


<?xml version="1.0"?>
<com_mysql_merlin_server_graph_Design>
    <version>1.0</version> 
    <uuid>a57c2bba-ea9b-102b-b396-94aca32bee29</uuid>
    <name>my filename usage test</name>
    <rangeLabel>MB</rangeLabel>
    <series>
        <label>used</label>
        <expression>used_fs/1024/1024</expression>
    </series>
    <series>
        <label>total size</label>
        <expression>total_fs/1024/1024</expression>
    </series>
    <variables>
        <name>used_fs</name>
        <dcItem>
            <nameSpace>os</nameSpace>
            <className>fs</className>
            <attribName>fs_used</attribName>
        </dcItem>
        <instance>/</instance>
    </variables>
    <variables>
        <name>total_fs</name>
        <dcItem>
            <nameSpace>os</nameSpace>
            <className>fs</className>
            <attribName>fs_total</attribName>
        </dcItem>
        <instance>/</instance>
    </variables>
</com_mysql_merlin_server_graph_Design>

Upon successfully loading a graph, a popup notification may say "1 graph imported" and this graph will immediately show up within the Graphs dashboard (like every other graph) under the name defined within the definition, which is "my filename usage test" in the example above.