# Orca configuration file for orcallator files.

# Require at least this version of Orca.
require                 Orca 0.265

# base_dir is prepended to the paths find_files, html_dir, rrd_dir,
# and state_file only if the path does not match the regular
# expression ^\\?\.{0,2}/, which matches /, ./, ../, and \./.
base_dir                /usr/local/orca/var/orca/rrd/ldapallator

# rrd_dir specifies the location of the generated RRD data files.  If
# rrd_dir is a relative path, then it is made relative to base_dir if
# base_dir is set.
rrd_dir                 .

# state_file specifies the location of the state file that remembers
# the modification time of each source data file.  If state_file is a
# relative path, then it is made relative to base_dir is base_dir is
# set.
state_file              orca.state

# html_dir specifies the top of the HTML tree created by Orca.
html_dir                /usr/local/apache2/htdocs

# By default create .meta tag files for all PNGs or GIFs so that the
# web browser will automatically reload them.
expire_images           1

# Find files at the following times:
#    0:10 to pick up new orcallator files for the new day.
#    1:00 to pick up late comer orcallator files for the new day.
#    6:00 to pick up new files before the working day.
#   12:00 to pick up new files during the working day.
#   19:00 to pick up new files after the working day.
find_times              0:10 1:00 6:00 12:00 19:00

# This defines the email address of people to warn when a file that is
# being updated constantly stops being updated.  For mathematical
# expressions use the word `interval' to get the interval number for
# the data source.
warn_email              admin@company.com
late_interval           interval + 30

# These parameters specify which plots to generate.
generate_hourly_plot    1
generate_daily_plot     1
generate_weekly_plot    1
generate_monthly_plot   1
generate_quarterly_plot 1
generate_yearly_plot    1

# This sets the HTML markup that is placed at the very top of every
# web page and is primarly used to display the site's logo.
html_page_header        <h3>Welcome To The LDAP Monitoring Page</h3>

# This sets the text that is placed in the pages' <title></title>
# element and just after the html_page_header HTML markup text is
# placed on the page.
html_top_title          LDAP Status

# This sets the HTML markup that is placed at the bottom of every web
# page.
html_page_footer
  <font face="verdana,geneva,arial,helvetica">
    These plots brought to you by your local system administrator.
  </font>

# This defines where the find the source data files and the format of
# those files.  Notes about the fields:
# find_files
#   You'll notice that all but the first () has the form (?:...).
#   This tells Perl to match the expression but not save the matched
#   text in the $1, $2, variables.  Orca uses the matched text to
#   generate a subgroup name, which is used to place files into
#   different subgroups.  Here, only the hostname should be used to
#   generate a subgroup name, hence all the (?:...) for matching
#   anything else.
# interval
#   The interval here must match the interval used by orcallator to
#   record data.  Do not change this, as it has an effect on the
#   generated RRD data files.

group ldapallator {
find_files              /usr/local/orca/var/orca/ldapallator/(.*)/(?:ldapallator)-\d{4}-\d{2}-\d{2}(?:-\d{3,})?(?:\.(?:Z|gz|bz2))?
column_description      first_line
date_source             column_name TIMESTAMP
interval                600
filename_compare        sub {
                          my ($ay, $am, $ad) = $a =~ /-(\d{4})-(\d\d)-(\d\d)/;
                          my ($by, $bm, $bd) = $b =~ /-(\d{4})-(\d\d)-(\d\d)/;
                          if (my $c = (( $ay       <=>  $by) ||
                                       ( $am       <=>  $bm) ||
                                       (($ad >> 3) <=> ($bd >> 3)))) {
                            return 2*$c;
                          }
                          $ad <=> $bd;
                        }
}

plot {
title                   %g Total Connections
source                  ldapallator
data                    TOTAL_CONNECTIONS
data_type               derive
line_type               line2
legend                  Connections
y_legend                Connections
data_min                0
}

plot {
title                   %g LDAP Operations
source                  ldapallator
data                    INITIATED_OPERATIONS
data                    COMPLETED_OPERATIONS
data_type               derive
line_type               line2
legend                  Initiated Operations
legend                  Completed Operations
y_legend                Operations
data_min                0
}

plot {
title                   %g LDAP Operation Breakdown
source                  ldapallator
data                    BIND_OPERATIONS
data                    UNBIND_OPERATIONS
data                    ADD_OPERATIONS
data                    DELETE_OPERATIONS
data                    MODIFY_OPERATIONS
data                    COMPARE_OPERATIONS
data                    SEARCH_OPERATIONS
data                    MODRDN_OPERATIONS
data_type               derive
line_type               area
line_type               stack
line_type               stack
line_type               stack
line_type               stack
line_type               stack
line_type               stack
line_type               stack
line_type               stack
legend                  Bind Operations
legend                  Unbind Operations
legend                  Add Operations
legend                  Delete operations
legend                  Modify Operations
legend                  Compare Operations
legend                  Search Operations
legend                  Modrdn Operations
y_legend                Operations
data_min                0
}

plot {
title                   %g Bytes Sent
source                  ldapallator
data                    BYTES_SENT
data_type               derive
line_type               line2
legend                  Bytes Transmitted
y_legend                Bytes
data_min                0
}

plot {
title                   %g Entries Sent
source                  ldapallator
data                    ENTRIES_SENT
data_type               derive
line_type               line2
legend                  Entries Sent
y_legend                Entries
data_min                0
}

plot {
title                   %g Referrrals
source                  ldapallator
data                    REFERRALS_SENT
data_type               derive
line_type               line2
legend                  Referrals Sent
y_legend                Referrals
data_min                0
}

plot {
title                   %g Read/Write Waiters
source                  ldapallator
data                    WRITE_WAITERS
data                    READ_WAITERS
data_type               derive
line_type               line2
legend                  Write Waiters
legend                  Read Waiters
y_legend                Waiters
data_min                0
}
