Here you can configure which template will be used for which check command. More...
Public Member Functions | |
__construct ($id=false) | |
constructor | |
get_properties () | |
Fetches the properties for the current object type. | |
get_object_by_name ($name) | |
returns an object as identified by its nagios-name | |
get_object () | |
Loads an object from database and populates $this->obj with it. | |
delete_object () | |
Delete object after validating that it is safe to do so. | |
save_object ($user=true) | |
Writes the $this->obj to the database if it validates properly. | |
get_objects_for_user ($obj_type=false) | |
Thin wrapper for returning user's objects of an optionally specified type. | |
get_object_name () | |
Returns the name of the object in question. | |
get_cmd_bar_links () | |
Make sure the controller is used instead of the generic delete.php. | |
Static Public Member Functions | |
static | object_exists ($obj_type, $id) |
Check if an object of the specified type and id exists. | |
Data Fields | |
$properties | |
This object's properties (required vars, allowed values etc). | |
$type = 'graph_template' | |
The type name of this object - must be overridden. | |
Static Protected Member Functions | |
static | get_pnp_template_name ($check) |
Given a check name, returns the path to where a user should stick their template for it. | |
Static Protected Attributes | |
static | $base = '/opt/monitor/op5/pnp/' |
Base path to PNP. | |
static | $dist = 'templates.dist/' |
Directory of distributed templates. | |
static | $user = 'templates/' |
Directory of user-provided templates. |
Here you can configure which template will be used for which check command.
Normally, the graphs use a template that matches the name of your check command, or the template "default" if nothing else exists.
This page simplifies setting up better templates for those checks that don't already have good defaults.
Better templates might compact multiple datasources into one single, easy-to-understand graph, format domain-specific information better, or attempt to predict when thresholds will be breached.
For creating your own templates, please see http://docs.pnp4nagios.org/pnp-0.6/tpl
When you have configured your Graph template, the graph will be visible in the Graphs UI within seconds. This means that you do not need to apply your changes when dealing with Graph templates, they are changed as soon as you save them.
graph_template_class::delete_object | ( | ) |
Delete object after validating that it is safe to do so.
.. Delete exactly one object of the type $obj_type match topic value against topic to work around pressing 'reload'
This method is adapted from previous version to use object variables and NOT to print anything - only return true or array with messages to the user to be handled by the gui.
This method calls banish_object() to do the actual deletion (mostly). Call banish_object() straight away if you want to force the deletion.
Error or success messages can be retrieved from get_deletion_message()
Reimplemented from object_class.
graph_template_class::get_cmd_bar_links | ( | ) |
Make sure the controller is used instead of the generic delete.php.
Reimplemented from object_class.
graph_template_class::get_object | ( | ) |
Loads an object from database and populates $this->obj with it.
Reimplemented from object_class.
static graph_template_class::object_exists | ( | $ | obj_type, | |
$ | id | |||
) | [static] |
Check if an object of the specified type and id exists.
Objects 'exist' if they're mentioned in the Object_Index_Table for their class. This can mean that they exist in limbo if the programmer added it via the 'add_to_object_index_table()' function, but we need to live with that.
$obj_type | string; Object type to check for | |
$id | integer; Id of the object to find |
Reimplemented from object_class.
graph_template_class::save_object | ( | $ | user = true |
) |
Writes the $this->obj to the database if it validates properly.
$user | false if this change isn't made by a user. If not, no validation will be performed, and the change won't show up in the changelog. |
Reimplemented from object_class.
graph_template_class::$properties |
array( 'var_index' => array( 'check' => 'select', 'graph_template' => 'select', ), 'required' => array( 'check', 'graph_template', ), 'label' => array( 'check' => 'Check command', 'graph_template' => 'Graph template', ), 'special' => array( 'check' => 'command', 'graph_template' => array(), ), 'default' => array( 'graph_template' => 'default', ), 'topic' => 'check', )
This object's properties (required vars, allowed values etc).
Reimplemented from object_class.