構成ファイルは、/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 にロードします。このプロセスをコントロールするのに二つのスクリプトがあります。
dashboard_data_load.pl
このスクリプトは nagios.log ファイルを読み、アラートと通報エントリを dashboard データベースに入れます。下記のオプションが使用できます。
-c <構成ファイル>
レポートロードプロセスのための設定を含む構成ファイルです。デフォルトは、/usr/local/groundwork/core/reports/etc/gwir.cfg です。
-a <ディレクトリ>
このログディレクトの全ファイルを読みます。 全ファイルを読むのは、通常、アーカイブディレクトリで使用します。たとえば、 /usr/local/groundwork/nagios/var/archives は Nagios アーカイブディレクトリの全ファイルを処理するでしょう。
-C <NAGIOS コンタクトグループのファイル>
コンタクトグループ定義を含む Nagios 構成ファイルです。これがセットさせていなくても、このプログラムは実行しますが、通知先コンタクトのレポートは正しく機能しません。
デフォルトは /usr/local/groundwork/nagios/etc/contactgroups.cfg です。
-f <NAGIOS ログファイル>
この Nagios ログファイルを読みます。デフォルトは /usr/local/groundwork/nagios/var/nagios.log です。
-L <出力ログ>
このプログラムからのステータスメッセージを含むログファイルです。 デフォルトは /usr/local/groundwork/nagios/var /dashboard.log です。
-H <NAGIOS ホストグループの構成ファイル>
ホストグループの定義を含む Nagios 構成ファイルです。これがセットさせていなくても、このプログラムは実行しますが、ホストグループレポートは正しく機能しません。
デフォルトは /usr/local/groundwork/nagios/etc /hostgroups.cfg です。
-d
デバッグモード。ログファイルに追加メッセージがログされます。
-h or -help
ヘルプのメッセージが表示されます。
dashboard_avail_load.pl
このスクリプトは、 Nagios CGI ユーザインタフェースからレポートページを開くため、http の get を実行します。このページからのデフォルトのレポート情報は、スクリプトで処理されて dashboard データベースの中に入れます。下記のオプションが使用できます。
-c <configuration file>
レポートを入れるプロセスのために設定を含む構成ファイル。デフォルトは /usr/local/groundwork/etc/gwir.cfg です。
-L <OUTPUT LOG>
このプログラムからのステータスメッセージを含むログファイルです。 デフォルトは /usr/local/groundwork/core/reports/etc/gwir.cfg です。
-s <YYYYMMDD>
開始日 (デフォルトは、昨日の 00 時)
-e <YYYYMMDD>
終了日 (デフォルトは、昨日の 24 時)
-d
デバッグモード。ログファイルに追加メッセージがログされます。
デフォルトでは、dashboard_data_load.pl スクリプトは、毎晩深夜12時に実行するようスケジュールされています。 dashboard_lwp_load.pl は、毎晩 1:00 AMに実行するようスケジュールされています。スケジュールを変更するには:
rootのユーザIDで、GroundWork サーバへのセッションを開きます。
crontab エントリを編集するためコマンドを投入します : crontab -u nagios -e
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
しかるべきスケジュールとなるよう、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