square.gif Developer Reference

homeicon.gif Print Page commentsicon.gif

インサイトレポートの構成設定

構成ファイルは、/usr/local/groundwork/core/reports/etc/gwir.cfg にあり、インサイトレポートの CGI とデータロードプログラムによって使用される設定設定を含んでいます。デフォルトの内容と説明を下記に示します:

# 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 mysql database
dbusername = root
dbpassword =
dbname = dashboard
dbhost = localhost
#
#
# Version of Nagios. This is used to determine the format of the status and event logs.
# Should be 1 or 2
nagios_version = 2;
####################################################################################
#
# CGI parameters
#
####################################################################################
# Directory to place the generated graph image files
graphdirectory = /usr/local/groundwork/apache2/htdocs/reports
#
# Relative URL to access the generated graph image files
graphhtmlref = /reports
####################################################################################
#
# Nagios log data load parameters
#
####################################################################################
# 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/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 = 1
####################################################################################
# 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 JBoss Portal 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 = 1
#
# 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 = nagiosadmin
# Authorized password to access Nagios reports page.
nagios_password = nagiosadmin
# 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/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 = 1
# 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/reports/utils/log/dashboard_avail.log
# The directory where the Nagios report CGI is located
#
nagios_cgi_dir = /usr/local/groundwork/apache2/cgi-bin/nagios

データロードスクリプト

データ収集プロセスは Nagios のデータを分析して、Mysqlデータベースの dashboard にロードします。このプロセスをコントロールするのに二つのスクリプトがあります。

  1. dashboard_data_load.pl
    このスクリプトは nagios.log ファイルを読み、アラートと通報エントリを dashboard データベースに入れます。下記のオプションが使用できます。

  2. dashboard_avail_load.pl
    このスクリプトは、 Nagios CGI ユーザインタフェースからレポートページを開くため、http の get を実行します。このページからのデフォルトのレポート情報は、スクリプトで処理されて dashboard データベースの中に入れます。下記のオプションが使用できます。

レポート更新のスケジューリング

デフォルトでは、dashboard_data_load.pl スクリプトは、毎晩深夜12時に実行するようスケジュールされています。 dashboard_lwp_load.pl は、毎晩 1:00 AMに実行するようスケジュールされています。スケジュールを変更するには:

  1. rootのユーザIDで、GroundWork サーバへのセッションを開きます。

  2. crontab エントリを編集するためコマンドを投入します : crontab -u nagios -e

  3. vi エディタのセッションが開き、 Nagios のための crontab エントリが表示されます:

59 23 * * * /usr/local/groundwork/reports/utils/dashboard_data_load.pl
/usr/local/groundwork/reports/utils/log/dashboard_data_load.log 2><1
0 1 * * * /usr/local/groundwork/reports/utils/dashboard_lwp_load.pl >
/usr/local/groundwork/reports/utils/log/dashboard_avail_load.log 2><1

  1. しかるべきスケジュールとなるよう、crontab エントリを変更します。たとえば、11:59PM の実行をスケジュールする場合、下記のようにエントリを変更します:

59 23 * * * /usr/local/groundwork/reports/utils/dashboard_data_load.pl
/usr/local/groundwork/reports/utils/log/dashboard_data_load.log 2><1