Data Source Examples

Creating data source from scratch is an advance feature. You can either use the samples templates provided and tailor according to your needs, or create your own. Here are some of the examples for you to try out:

Using SQL Query

About this task

You want to be alerted when a job is pending for 5 days because of unavailable memory.

Procedure

  1. Enter a name and description and select the type as SQL Query.
  2. Write a SQL query for notifying you about the pending jobs.
  3. Add the Custom Data Input items and run the SQL Query.
    Figure 1. SQL Query example

Results

Create an alert based on this template. If a job is pending for 5 days due to unavailable memory, then you will receive an email.

Using Database Table

About this task

You want to be alerted when 2 users are logged on to a host.

Procedure

  1. Enter a name and description and select the Data Type as Table.
  2. Select Table Type and Table name appropriately.
  3. Define Data Source Metrics and Custom Data Input Items as shown in Figure 2.
  4. Build an expression - make use of these two metrics and custom data in the Data Source Items.
    Figure 2. Example using database Table
  5. Check the Syntax. Either OK or Bad Syntax result is displayed. Refer to the Cacti log if there are any errors.

Results

Create an alert based on this template. You will be notified when 2 users are logged on to a host.

Using a Script

About this task

You want to be alerted when a license has not been used for 15 days.

Procedure

  1. Enter a name and description and select the Data Type as Script.
  2. Write your script and input Custom Data Input items as shown in Figure 3.
    Figure 3. Example using a script
  3. Run the script. Either OK or Bad Syntax result is displayed. Refer to the Cacti log if there are any errors.

Results

Create an alert based on this template. You will be notified when a license is not used for 15 days.