The Cacti Manual
Prev | Chapter 20. Command Line Scripts | Next

# Reapply Suggested Names to Graphs

For a general understanding of suggested names used with data queries, please see the Section called Associated Graph Templates in Chapter 12>. Be aware, that changes to the `Suggested Names` section of a data query will not automatically be propagated to all existing graphs. This is, where poller_graphs_reapply_names.php drops in. Calling the script with the parameter `--help` yields

    shell>php -q poller_graphs_reapply_names.php --help
    Cacti Reapply Graph Names Script 1.0, Copyright 2004-2013 - The Cacti Group

    usage: poller_graphs_reapply_names.php -id=[host_id|All][host_id1|host_id2|...] [-s=[search_string] [-d] [-h] [--help] [-v] [--version]

    -id=host_id   - The host_id or 'All' or a pipe delimited list of host_id's
    -s=search_str - A graph template name or graph title to search for
    -d            - Display verbose output during execution
    -v --version  - Display this help message
    -h --help     - Display this help message

Assume a situation, where the suggested names where changed for the standard data query named `SNMP - Get Mounted Partitions`. In this case, you will want to rework all graphs for this data query only. A verbose run will yield

    shell>php -q poller_graphs_reapply_names.php -id=All -d -s="Used space"
    WARNING: Do not interrupt this script.  Interrupting during rename can cause issues
    DEBUG: There are '6' Graphs to rename
    DEBUG: Graph Name 'Localhost - Used Space - Memory Buffers' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - Memory Buffers'
    DEBUG: Graph Name 'Localhost - Used Space - Real Memory' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - Real Memory'
    DEBUG: Graph Name 'Localhost - Used Space - Swap Space' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - Swap Space'
    DEBUG: Graph Name 'Localhost - Used Space - /' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - /'
    DEBUG: Graph Name 'Localhost - Used Space - /sys' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - /sys'
    DEBUG: Graph Name 'Localhost - Used Space - /boot' starting
    DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - /boot'

Please notice my miss-spelling of the word "Space". The `-s=` option is not case sensitive.

Prev | Home | Next
Empty Poller Output Table | Up | Copy Local Cacti Users