Configuring Insight Reports

Configuring Insight Reports

This section reviews configuration for the GroundWork Monitor Event Console application.

1.0 The Configuration File

The configuration file located in /usr/local/groundwork/core/reports/etc/gwir.cfg contains the settings used by the Insight Report CGIs and data load programs. The default contents and descriptions are shown here:

#
# gwir.cfg	v2.2		2012-09-05
#
# Copyright 2007-2012 GroundWork Open Source, Inc. ("GroundWork")
# All rights reserved. This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

#
#	Configuration file for Nagios reports.
#	This file is used by the following programs:
#	dashboard_data_load.pl	- Updates the reports database with Nagios log data.
#	dashboard_lwp_load.pl	- Updates the reports database with Nagios availability report data.
#	nagios_alarms1.pl	- CGI program that generates the alerts report page.
#	nagios_notifications1.pl - CGI program that generates the notifications report page.
#	nagios_outages1.pl	- CGI program that generates the outage report page.
#


#################################################################################
#
#	Global properties
#
#################################################################################
#
#	Database parameters.  Used to connect to the Status Viewer database.
dbusername = ir
dbpassword = FILL_IN_HERE
dbname = dashboard
dbhost = localhost
dbtype = postgresql
#
#
# Version of Nagios. This is used to determine the format of the status and event logs.
# Should be 1 or 2, although we use Nagios 3.X now -- perhaps this needs updating.
nagios_version = 2;

###############################################################################
#
#	CGI parameters
#
###############################################################################
#
#	Directory to place the generated graph image files
graphdirectory = /usr/local/groundwork/core/reports/htdocs/reports
#
#	Relative URL to access the generated graph image files
graphhtmlref = /reports

###############################################################################
#
#	Nagios log data load parmaeters
#
###############################################################################
#
#	The main nagios.cfg configuration file.  The data load program will read this file to get
#	all the other nagios configuration files that are reference.  All the reference files will
#	then be read to identify host group directives.  The host group and host members are identified
#	and used in the reports.
nagios_cfg_file = /usr/local/groundwork/nagios/etc/nagios.cfg

#
#	Nagios event log file. This is read by the event feeder and contains an entry
#	for nagios actions.  The  HOST ALERT, HOST NOTIFICATION, SERVICE ALERT and
#	SERVICE NOTIFICATION event logs are read and inserted into the status viewer database.
nagios_event_log = /usr/local/groundwork/nagios/var/nagios.log

#
#	This is the log file for the dashboard_data_load.pl program.
#	Debug and informational messages will be contained here
dashboard_data_log = /usr/local/groundwork/core/reports/utils/log/dashboard_data.log

#
#	Debug setting for the dashboard data load program
#	Set to 1 to write debug messages to the dashboard_data_log file
dashboard_data_debug = 0

#################################################################################
#
#	Nagios availability data load parameters
#	There are two methods for getting this data.
#	-  The lwp method uses Perl LWP to open a browser to the Nagios availability
#	   reports.
#	-  The avail method execute the report cgi local and read the output. This is the
#	   default method since it will work if Guava Single Sign authorization is on.
#
#################################################################################
#
#	Debug flag for status feeder. Set to 1 to write debug messages to the feeder_status_log file
dashboard_lwp_debug = 0

#
#	LWP method - IP Address of the nagios server. Used to call the Nagios availability report cgi
nagios_server_address = localhost
nagios_server_port = 80

#
#	LWP method - Nagios security realm. This is on the userid/password dialog box when accessing a secure Nagios page.
nagios_realm = Nagios Access

#	LWP method - Authorized user ID to access Nagios reports page.
nagios_user = admin

# Authorized password to access Nagios reports page.
nagios_password = admin

#	This is the log file for the dashboard_lwp_load.pl program.
#	Debug and informational messages will be contained here
dashboard_lwp_log = /usr/local/groundwork/core/reports/utils/log/dashboard_lwp.log

#
#	Debug flag for status feeder. Set to 1 to write debug messages to the feeder_status_log file
dashboard_avail_debug = 0

#	This is the log file for the dashboard_lwp_load.pl program.
#	Debug and informational messages will be contained here
dashboard_avail_log = /usr/local/groundwork/core/reports/utils/log/dashboard_avail.log

#	The directory where the Nagios report CGI is located
#
nagios_cgi_dir = /usr/local/groundwork/nagios/sbin
1.1 Data Load Scripts

The data gathering process analyzes Nagios data and loads it into the database dashboard. There are two scripts that control this process.

  1. dashboard_data_load.pl
    This script reads the nagios.log file and loads alert and Notification entries into the dashboard database. The following options are available.
    • -c <configuration file> — Configuration file containing the settings for the report load process. Default is: /usr/local/groundwork/core/reports/etc/gwir.cfg
    • -a <DIRECTORY> — Read all files in this log directory. Typically used to read all log files in an archive directory. For example, /usr/local/groundwork/nagios/var/archives will process all files in the Nagios archive directory.
    • -C <NAGIOS CONTACT GROUP CONFIG FILE> — Nagios config file containing Contact Group definitions. This program will run if this is not set, however the Notification Contact reports will not work properly. The default is: /usr/local/groundwork/nagios/etc/contactgroups.cfg
    • -f <NAGIOS LOG FILE> — Read this Nagios log file. The default is: /usr/local/groundwork/nagios/var/nagios.log
    • -L <OUTPUT LOG> — Log file containing status messages from this program. The default is: /usr/local/groundwork/nagios/var /dashboard.log
    • -H <NAGIOS HOST GROUP CONFIG FILE> — Nagios config file containing Host Group definitions. This program will run if this is not set, however Host Group reports will not work properly. The default is: /usr/local/groundwork/nagios/etc /hostgroups.cfg
    • -d — Debug mode. Will log additional messages to the log file.
    • -h or -help — Displays help message.
  2. dashboard_avail_load.pl
    This script executes an http get to open the report page from the Nagios CGI user interface. The detailed report information from this page is processed by the script and loaded into the dashboard database. The following options are available.
    • -c <configuration file> — Configuration file containing the settings for the report load process. Default is: /usr/local/groundwork/core/reports/etc/gwir.cfg
    • -L <OUTPUT LOG> — Log file containing status messages from this program. The default is: /usr/local/groundwork/feeder/log/dashboard_lwp.log
    • -s <YYYYMMDD> — Start day (Default to yesterday, 00 hours)
    • -e <YYYYMMDD> — End day (Default to yesterday, 24 hours)
    • -d — Debug mode. Will log additional log messages in the output log file.
1.2 Scheduling Report Updates

By default, the dashboard_data_load.pl script is scheduled to run every night at midnight. The dashboard_lwp_load.pl script is scheduled to run every day at 1:00 AM. To modify the schedule:

  1. Open a session to the GroundWork server using ID root.
  2. Issue the command to edit crontab entries:
    crontab -u nagios -e
  3. A vi editor session will open showing the crontab entries for Nagios. Look for the following entries:
    59 23 * * * /usr/local/groundwork/core/reports/utils/dashboard_data_load.pl
    /usr/local/groundwork/core/reports/utils/log/dashboard_data_load.log 2><1
    0 1 * * * /usr/local/groundwork/core/reports/utils/dashboard_lwp_load.pl >
    /usr/local/groundwork/core/reports/utils/log/dashboard_avail_load.log 2><1
  4. Change the crontab entry to the appropriate schedule. For example, to schedule an execution at 11:59pm, change the entry to the following:
    59 23 * * * /usr/local/groundwork/core/reports/utils/dashboard_data_load.pl
    /usr/local/groundwork/core/reports/utils/log/dashboard_data_load.log 2><1
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.