20.2.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 20.2.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 Configuration, Advisors page, and click the Import/Export link. Then note the Custom Rule/Graph/Data Items Import section. 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" in the MySQL Enterprise Monitor User Interface.

This also creates a new Advisor with the same title, which is unscheduled by default. Go to Configuration, Advisors, Graphing to locate and enable this new Advisor.

This graph will eventually show up within the appropriate graphs page (like every other graph) under the name defined within the definition, which is "my filename usage test" in the example above.