nagiosのインストールがほぼほぼ出来てきたのですが、やはり見栄えがもう少し!ということで、nagiosでグラフ表示を行うことにしました。
ということで、nagiosgraphを追加します。
nagiosgraphを以下の方法でダウンロードしてきます。
1 2 3 4 |
# cd /home # mkdir nagiosgraph # cd nagiosgraph # wget https://downloads.sourceforge.net/project/nagiosgraph/nagiosgraph/1.5.2/nagiosgraph-1.5.2.tar.gz |
ところが、環境によってはダウンロード出来ないことがあるようです。
私の環境では、2度ほど躓きまして、結局WinSCPを使ってWindows PC転送することになりました(^^ゞ
ダウンロードが完了したら、いつもの調子で展開します。
1 2 |
# tar xvf nagiosgraph-1.5.2.tar.gz # cd nagiosgraph-1.5.2 |
ここまでは簡単ですねw
ここで、インストールの方法をWebで検索する前に、インストール方法が記載されているINSTALLファイルを覗いてみます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# more INSTALL ------------------------ License: OSI Artistic License nagiosgraph Installation Author: (c) 2005 Soren Dossing ------------------------ Author: (c) 2008 Alan Brenner, Ithaka Harbors Author: (c) 2010 Matthew Wall Installation can be done automatically using the install.pl script, or manually by copying and modifying files. Install Pre-Requisites ---------------------- To see which pre-requisites are installed: install.pl --check-prereq To install pre-requisites: Debian/Ubuntu sudo apt-get install libcgi-pm-perl librrds-perl libgd-gd2-perl Redhat/Fedora/CentOS sudo yum install perl-rrdtool perl-GD Mac OS X Homebrew |
見てみると、install.pl –check-prereqなる文字列が・・・
インストール前の事前チェックを行う機能がnagiosgraphには備えられているようなので、取りあえず、チェックしてみます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# ./install.pl --check-prereq checking required PERL modules Carp...1.11 CGI... ***FAIL*** Data::Dumper...2.124 Digest::MD5...2.39 File::Basename...2.77 File::Find...1.14 MIME::Base64...3.08 POSIX...1.17 RRDs... ***FAIL*** Time::HiRes... ***FAIL*** checking optional PERL modules GD... ***FAIL*** Nagios::Config... ***FAIL*** checking nagios installation found nagios exectuable at /usr/local/nagios/bin/nagios found nagios init script at /etc/init.d/nagios checking web server installation found apache executable at /usr/sbin/httpd found apache init script at /etc/init.d/httpd *** one or more problems were detected! |
「FAIL」の文字が見受けられます(TT)
幾つかインストールを行う必要がありそうです。
CGIはperl-CGI
RRDsはrrdtool-perl
Time::HiResはperl-Time-HiRes
GDはperl-GDが必要です。
ということで、yumでインストール開始します。
1 |
# yum install perl-CGI rrdtool-perl perl-Time-HiRes perl-GD |
もう一度インストール前の確認を行います。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# ./install.pl --check-prereq checking required PERL modules Carp...1.11 CGI...3.51 Data::Dumper...2.124 Digest::MD5...2.39 File::Basename...2.77 File::Find...1.14 MIME::Base64...3.08 POSIX...1.17 RRDs...1.3008 Time::HiRes...1.9721 checking optional PERL modules GD...2.44 Nagios::Config... ***FAIL*** checking nagios installation found nagios exectuable at /usr/local/nagios/bin/nagios found nagios init script at /etc/init.d/nagios checking web server installation found apache executable at /usr/sbin/httpd found apache init script at /etc/init.d/httpd |
Nagios::Configの項目にFAILが見受けられます。
最新版のNagiosを使用しているので、一旦無視して作業を進めます。
インストール対象がCentOS(RedHat系)なので、以下のオプションを追加してインストールを実行します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# ./install.pl --layout redhat checking required PERL modules Carp...1.11 CGI...3.51 Data::Dumper...2.124 Digest::MD5...2.39 File::Basename...2.77 File::Find...1.14 MIME::Base64...3.08 POSIX...1.17 RRDs...1.3008 Time::HiRes...1.9721 checking optional PERL modules GD...2.44 Nagios::Config... ***FAIL*** checking nagios installation found nagios exectuable at /usr/local/nagios/bin/nagios found nagios init script at /etc/init.d/nagios checking web server installation found apache executable at /usr/sbin/httpd found apache init script at /etc/init.d/httpd Destination directory (prefix)? [/] /usr/local/nagiosgraph Location of configuration files (etc-dir)? [/etc/nagiosgraph] Location of executables? [/usr/libexec/nagiosgraph] Location of CGI scripts? [/usr/lib/nagiosgraph/cgi-bin] Location of documentation (doc-dir)? [/usr/share/doc/nagiosgraph] Location of examples? [/usr/share/nagiosgraph/examples] Location of CSS and JavaScript files? [/usr/share/nagiosgraph/htdocs] Location of utilities? [/usr/share/nagiosgraph/util] Location of state files (var-dir)? [/var/spool/nagiosgraph] Location of RRD files? [/var/spool/nagiosgraph/rrd] Location of log files (log-dir)? [/var/log/nagiosgraph] Path of log file? [/var/log/nagiosgraph/nagiosgraph.log] Path of CGI log file? [/var/log/nagiosgraph/nagiosgraph-cgi.log] Base URL? [/nagiosgraph] URL of CGI scripts? [/nagiosgraph/cgi-bin] URL of CSS file? [/nagiosgraph/nagiosgraph.css] URL of JavaScript file? [/nagiosgraph/nagiosgraph.js] URL of Nagios CGI scripts? [/nagios/cgi-bin] Path of Nagios performance data file? [/tmp/perfdata.log] username or userid of Nagios user? [nagios] username or userid of web server user? [apache] Modify the Nagios configuration? [n] y Path of Nagios configuration file? [/etc/nagios/nagios.cfg] /usr/local/nagios/etc/nagios.cfg Path of Nagios commands file? [/etc/nagios/objects/commands.cfg] /usr/local/nagios/etc/objects/commands.cfg Modify the Apache configuration? [n] y Path of Apache configuration directory? [/etc/httpd/conf.d] configuration: ng_prefix /usr/local/nagiosgraph ng_etc_dir /etc/nagiosgraph ng_bin_dir /usr/libexec/nagiosgraph ng_cgi_dir /usr/lib/nagiosgraph/cgi-bin ng_doc_dir /usr/share/doc/nagiosgraph ng_examples_dir /usr/share/nagiosgraph/examples ng_www_dir /usr/share/nagiosgraph/htdocs ng_util_dir /usr/share/nagiosgraph/util ng_var_dir /var/spool/nagiosgraph ng_rrd_dir /var/spool/nagiosgraph/rrd ng_log_dir /var/log/nagiosgraph ng_log_file /var/log/nagiosgraph/nagiosgraph.log ng_cgilog_file /var/log/nagiosgraph/nagiosgraph-cgi.log ng_url /nagiosgraph ng_cgi_url /nagiosgraph/cgi-bin ng_css_url /nagiosgraph/nagiosgraph.css ng_js_url /nagiosgraph/nagiosgraph.js nagios_cgi_url /nagios/cgi-bin nagios_perfdata_file /tmp/perfdata.log nagios_user nagios www_user apache modify_nagios_config y nagios_config_file /usr/local/nagios/etc/nagios.cfg nagios_commands_file /usr/local/nagios/etc/objects/commands.cfg modify_apache_config y apache_config_dir /etc/httpd/conf.d apache_config_file Continue with this configuration? [y] y mkdir /usr/local/nagiosgraph mkdir /etc/nagiosgraph move /etc/nagiosgraph/nagiosgraph_de.conf to /etc/nagiosgraph/nagiosgraph_de.conf.20151215170149 copy etc/nagiosgraph_de.conf to /etc/nagiosgraph/nagiosgraph_de.conf move /etc/nagiosgraph/nagiosgraph.conf to /etc/nagiosgraph/nagiosgraph.conf.20151215170149 copy etc/nagiosgraph.conf to /etc/nagiosgraph/nagiosgraph.conf move /etc/nagiosgraph/datasetdb.conf to /etc/nagiosgraph/datasetdb.conf.20151215170149 copy etc/datasetdb.conf to /etc/nagiosgraph/datasetdb.conf move /etc/nagiosgraph/labels.conf to /etc/nagiosgraph/labels.conf.20151215170149 copy etc/labels.conf to /etc/nagiosgraph/labels.conf move /etc/nagiosgraph/servdb.conf to /etc/nagiosgraph/servdb.conf.20151215170149 copy etc/servdb.conf to /etc/nagiosgraph/servdb.conf move /etc/nagiosgraph/nagiosgraph_es.conf to /etc/nagiosgraph/nagiosgraph_es.conf.20151215170149 copy etc/nagiosgraph_es.conf to /etc/nagiosgraph/nagiosgraph_es.conf move /etc/nagiosgraph/access.conf to /etc/nagiosgraph/access.conf.20151215170149 copy etc/access.conf to /etc/nagiosgraph/access.conf move /etc/nagiosgraph/hostdb.conf to /etc/nagiosgraph/hostdb.conf.20151215170149 copy etc/hostdb.conf to /etc/nagiosgraph/hostdb.conf move /etc/nagiosgraph/nagiosgraph_fr.conf to /etc/nagiosgraph/nagiosgraph_fr.conf.20151215170149 copy etc/nagiosgraph_fr.conf to /etc/nagiosgraph/nagiosgraph_fr.conf move /etc/nagiosgraph/groupdb.conf to /etc/nagiosgraph/groupdb.conf.20151215170149 copy etc/groupdb.conf to /etc/nagiosgraph/groupdb.conf move /etc/nagiosgraph/rrdopts.conf to /etc/nagiosgraph/rrdopts.conf.20151215170149 copy etc/rrdopts.conf to /etc/nagiosgraph/rrdopts.conf move /etc/nagiosgraph/map to /etc/nagiosgraph/map.20151215170149 copy etc/map to /etc/nagiosgraph/map copy etc/ngshared.pm to /etc/nagiosgraph replace text in /etc/nagiosgraph/nagiosgraph.conf move /etc/nagiosgraph/nagiosgraph.conf-bak to /etc/nagiosgraph/nagiosgraph.conf replace text in /etc/nagiosgraph/nagiosgraph.conf move /etc/nagiosgraph/nagiosgraph.conf-bak to /etc/nagiosgraph/nagiosgraph.conf write stub to /etc/nagiosgraph/nagiosgraph-nagios.cfg write stub to /etc/nagiosgraph/nagiosgraph-commands.cfg write stub to /etc/nagiosgraph/nagiosgraph-apache.conf mkdir /usr/lib/nagiosgraph/cgi-bin copy cgi/showconfig.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/showconfig.cgi move /usr/lib/nagiosgraph/cgi-bin/showconfig.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/showconfig.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/showconfig.cgi copy cgi/showhost.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/showhost.cgi move /usr/lib/nagiosgraph/cgi-bin/showhost.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/showhost.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/showhost.cgi copy cgi/show.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/show.cgi move /usr/lib/nagiosgraph/cgi-bin/show.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/show.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/show.cgi copy cgi/testcolor.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/testcolor.cgi move /usr/lib/nagiosgraph/cgi-bin/testcolor.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/testcolor.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/testcolor.cgi copy cgi/showservice.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/showservice.cgi move /usr/lib/nagiosgraph/cgi-bin/showservice.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/showservice.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/showservice.cgi copy cgi/showgraph.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/showgraph.cgi move /usr/lib/nagiosgraph/cgi-bin/showgraph.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/showgraph.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/showgraph.cgi copy cgi/export.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/export.cgi move /usr/lib/nagiosgraph/cgi-bin/export.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/export.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/export.cgi copy cgi/showgroup.cgi to /usr/lib/nagiosgraph/cgi-bin replace text in /usr/lib/nagiosgraph/cgi-bin/showgroup.cgi move /usr/lib/nagiosgraph/cgi-bin/showgroup.cgi-bak to /usr/lib/nagiosgraph/cgi-bin/showgroup.cgi chmod 755 on /usr/lib/nagiosgraph/cgi-bin/showgroup.cgi mkdir /usr/libexec/nagiosgraph copy lib/insert.pl to /usr/libexec/nagiosgraph replace text in /usr/libexec/nagiosgraph/insert.pl move /usr/libexec/nagiosgraph/insert.pl-bak to /usr/libexec/nagiosgraph/insert.pl chmod 755 on /usr/libexec/nagiosgraph/insert.pl mkdir /usr/share/nagiosgraph/htdocs move /usr/share/nagiosgraph/htdocs/nagiosgraph.css to /usr/share/nagiosgraph/htdocs/nagiosgraph.css.20151215170149 copy share/nagiosgraph.css to /usr/share/nagiosgraph/htdocs/nagiosgraph.css copy share/nagiosgraph.js to /usr/share/nagiosgraph/htdocs mkdir /usr/share/doc/nagiosgraph copy AUTHORS to /usr/share/doc/nagiosgraph copy CHANGELOG to /usr/share/doc/nagiosgraph copy INSTALL to /usr/share/doc/nagiosgraph copy README to /usr/share/doc/nagiosgraph copy TODO to /usr/share/doc/nagiosgraph mkdir /usr/share/nagiosgraph/examples copy examples/nagiosgraph.2.css to /usr/share/nagiosgraph/examples copy examples/nagiosgraph-commands.cfg to /usr/share/nagiosgraph/examples copy examples/nagiosgraph-nagios.cfg to /usr/share/nagiosgraph/examples copy examples/graphed-service.cfg to /usr/share/nagiosgraph/examples copy examples/map_examples to /usr/share/nagiosgraph/examples copy examples/map_1_4_5 to /usr/share/nagiosgraph/examples copy examples/nagiosgraph.1.css to /usr/share/nagiosgraph/examples copy examples/map_mwall to /usr/share/nagiosgraph/examples copy examples/insert.sh to /usr/share/nagiosgraph/examples copy examples/map_1_4_3 to /usr/share/nagiosgraph/examples copy examples/nagiosgraph-apache.conf to /usr/share/nagiosgraph/examples copy examples/map_minimal to /usr/share/nagiosgraph/examples copy examples/graphed-host.cfg to /usr/share/nagiosgraph/examples copy examples/map_1_3 to /usr/share/nagiosgraph/examples copy examples/nagiosgraph-logrotate to /usr/share/nagiosgraph/examples copy examples/map_1_4_4 to /usr/share/nagiosgraph/examples copy share/graph.gif to /usr/share/nagiosgraph/examples copy share/nagiosgraph.ssi to /usr/share/nagiosgraph/examples mkdir /usr/share/nagiosgraph/util copy utils/testentry.pl to /usr/share/nagiosgraph/util copy utils/flat2hier.pl to /usr/share/nagiosgraph/util chmod 755 on /usr/share/nagiosgraph/util/testentry.pl chmod 755 on /usr/share/nagiosgraph/util/flat2hier.pl mkdir /var/spool/nagiosgraph/rrd chmod 755 on /var/spool/nagiosgraph/rrd chown nagios,- on /var/spool/nagiosgraph/rrd touching /var/log/nagiosgraph/nagiosgraph.log chmod 644 on /var/log/nagiosgraph/nagiosgraph.log chown nagios,- on /var/log/nagiosgraph/nagiosgraph.log touching /var/log/nagiosgraph/nagiosgraph-cgi.log chmod 644 on /var/log/nagiosgraph/nagiosgraph-cgi.log chown apache,- on /var/log/nagiosgraph/nagiosgraph-cgi.log append to /usr/local/nagios/etc/nagios.cfg copy /usr/local/nagios/etc/nagios.cfg to /usr/local/nagios/etc/nagios.cfg.tmp move /usr/local/nagios/etc/nagios.cfg to /usr/local/nagios/etc/nagios.cfg-20151215.1701 move /usr/local/nagios/etc/nagios.cfg.tmp to /usr/local/nagios/etc/nagios.cfg append to /usr/local/nagios/etc/objects/commands.cfg copy /usr/local/nagios/etc/objects/commands.cfg to /usr/local/nagios/etc/objects/commands.cfg.tmp move /usr/local/nagios/etc/objects/commands.cfg to /usr/local/nagios/etc/objects/commands.cfg-20151215.1701 move /usr/local/nagios/etc/objects/commands.cfg.tmp to /usr/local/nagios/etc/objects/commands.cfg move /etc/nagiosgraph/nagiosgraph-apache.conf to /etc/httpd/conf.d/nagiosgraph.conf * Check the nagios configuration: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg * Restart nagios to start data collection: /etc/init.d/nagios restart * Restart apache to enable display of graphs: /etc/init.d/httpd restart * To enable graph links and mouseovers, see README sections: Displaying Per-Service and Per-Host Graph Icons and Links Displaying Graphs in Nagios Mouseovers |
こんな感じで取りあえずのインストールは完了。
次回につづく。。。