back.gif

next.gif

 

 

Making a new CSO & their CSC:

 

What makes a CSO?

 

Customize-> Manage Changes -> Choose Add/Edit Custom SQL Objects from the dropdown. This opens up a form with the following details

1) SQL: Any user defined SQL which returns a result set.

2) Collection Interval: Interval in which this SQL is queried periodically. We recommend 5 mins which also happens to be the default value.

3) Servers: Coma separated names of the servers for which this SQL needs to be queried every Collection Interval.

4) Purging Interval: The data retention time & we recommend 7 days.

5) Key Column: CSOs work with a result set which has unique rows. A combination of 1 or more columns of the result set can be made as a key column as long as long as this key column identifies a unique row in the result set.

 

    add-edit-CSO.png

 

 

Making its CSC:

 

We create a CSC like any other monitor. Go to monitors/advisors page -> Add new monitor/advisor

 

Choose the type of counter as Custom SQL.

Type in the name of the group to which this counter is being added.

Enter the name of the counter being added.

Formula - A MySQL server parameter that would be needed to compute the value of this counter.

Value - This defines a function that computes the value. Here is a template

 

function() {

var sqlObject = MONyog.UserObject('<Name of your Custom SQL Object>');

if (!sqlObject || !sqlObject.isEnabled() || !MONyog.MySQL.Custom.Available)

return '(n/a)';

/* You will have to call select here to fetch the resultset. */

 

var resultSet = sqlObject.select();

var results = ''; /* results holds the resultset in the form of array of row(s).*/

 

/*Get column(s) for each row from the result set */

for (i in resultSet) {

if (resultSet.length > 0)

results += '<br>';

 

results += resultSet[i].<Column name in resultset> +

       '.' + resultSet[i].<Column name in resultset>;

}

if (results.length == 0)

results = 'None';

 

return results;

 }

 

DocText - Discription of Monitor/Advisor.

Advise Text - Advise text to the MOnitor/Advisor being added.

 

 

 

 

 

 

 

back.gif

next.gif