Nagiosの監視項目をグラフ化するプラグイン nagiosgraphをインストールしてみました。
nagiosgraph – data collection and graphing for nagios
http://nagiosgraph.sourceforge.net/
参考サイト
Steps to configure Nagiosgraph with Nagios Core
http://www.linuxfunda.com/2013/04/02/steps-to-configure-nagiosgraph-with-nagios-core/
- Nagiosgraphダウンロード
- 展開
- インストール環境チェック
- RRD Utilitiesインストール
- Perl GDモジュールインストール
- インストール環境チェック
- nagiosgraphインストール
- 設定ファイル読み込み
- Nagiosgraphにアクセス
- Nagiosgraphの環境設定の確認
- アクセス制限の設定
Nagiosgraphをダウンロードします
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 |
[root@host1 ~]# cd /usr/local/src [root@host1 src]# wget http://sourceforge.net/projects/nagiosgraph/files/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz --2013-08-22 16:19:32-- http://sourceforge.net/projects/nagiosgraph/files/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz sourceforge.net をDNSに問いあわせています... 216.34.181.60 sourceforge.net|216.34.181.60|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 302 Found 場所: http://sourceforge.net/projects/nagiosgraph/files/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz/download [続く] --2013-08-22 16:19:33-- http://sourceforge.net/projects/nagiosgraph/files/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz/download sourceforge.net|216.34.181.60|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 302 Found 場所: http://downloads.sourceforge.net/project/nagiosgraph/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz?r=&ts=1377155973&use_mirror=jaist [続く] --2013-08-22 16:19:33-- http://downloads.sourceforge.net/project/nagiosgraph/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz?r=&ts=1377155973&use_mirror=jaist downloads.sourceforge.net をDNSに問いあわせています... 216.34.181.59 downloads.sourceforge.net|216.34.181.59|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 302 Found 場所: http://jaist.dl.sourceforge.net/project/nagiosgraph/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz [続く] --2013-08-22 16:19:34-- http://jaist.dl.sourceforge.net/project/nagiosgraph/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz jaist.dl.sourceforge.net をDNSに問いあわせています... 150.65.7.130, 2001:df0:2ed:feed::feed jaist.dl.sourceforge.net|150.65.7.130|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 157955 (154K) [application/x-gzip] `nagiosgraph-1.4.4.tar.gz' に保存中 100%[======================================>] 157,955 787K/s 時間 0.2s 2013-08-22 16:19:35 (787 KB/s) - `nagiosgraph-1.4.4.tar.gz' へ保存完了 [157955/157955] |
1 2 3 4 5 6 7 8 |
[root@host1 src]# tar xvfz nagiosgraph-1.4.4.tar.gz nagiosgraph-1.4.4/ nagiosgraph-1.4.4/t/ nagiosgraph-1.4.4/t/09plugins.t (snip) nagiosgraph-1.4.4/debian/docs nagiosgraph-1.4.4/debian/control nagiosgraph-1.4.4/.perlcriticrc |
インストールに必要なプログラムやライブラリが整っているかチェックします
私の環境ではRRDs(RRD Utilities)とPerlのGDライブラリが無いと言われてしまいました
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@host1 src]# cd nagiosgraph-1.4.4 [root@host1 nagiosgraph-1.4.4]# ./install.pl --check-prereq checking required PERL modules Carp...1.04 CGI...3.15 Data::Dumper...2.121_08 File::Basename...2.74 File::Find...1.10 MIME::Base64...3.07 POSIX...1.09 RRDs... ***FAIL*** Time::HiRes...1.9717 checking optional PERL modules GD... ***FAIL*** checking nagios installation found nagios at /usr/local/nagios/bin/nagios checking web server installation found apache at /usr/sbin/httpd *** one or more problems were detected! |
RRD Utilitiesをインストールします
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 |
[root@host1 nagiosgraph-1.4.4]# yum info rrdutils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: ftp.iij.ad.jp * base: ftp.iij.ad.jp * centosplus: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * remi: rpms.famillecollet.com * updates: ftp.iij.ad.jp Available Packages Name : rrdutils Arch : noarch Version : 5.2.1 Release : 1.el5.rf Size : 21 k Repo : dag Summary : Utilities to deal with RRD files and graphs URL : http://rrdutils.sourceforge.net/ License : BSD Description: This is a set of tools intended to help creation and displaying of : RRD files. The RRD characteristics (data sources, consolidation : functions) and the graphs are described in a configuration file : that we can use to create new instances of a RRD, and to generate : the graphs for them. [root@host1 nagiosgraph-1.4.4]# yum install rrdutils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: ftp.iij.ad.jp * base: ftp.iij.ad.jp * centosplus: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * remi: rpms.famillecollet.com * updates: ftp.iij.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package rrdutils.noarch 0:5.2.1-1.el5.rf set to be updated --> Processing Dependency: perl(RRDs) for package: rrdutils --> Processing Dependency: rrdtool for package: rrdutils --> Running transaction check ---> Package perl-rrdtool.i386 0:1.4.7-1.el5.rf set to be updated ---> Package rrdtool.i386 0:1.4.7-1.el5.rf set to be updated --> Processing Dependency: ruby for package: rrdtool --> Processing Dependency: lua for package: rrdtool --> Running transaction check ---> Package lua.i386 0:5.1.4-2.el5.rf set to be updated ---> Package ruby.i386 0:1.8.5-31.el5_9 set to be updated --> Processing Dependency: ruby-libs = 1.8.5-31.el5_9 for package: ruby --> Processing Dependency: libruby.so.1.8 for package: ruby --> Running transaction check ---> Package ruby-libs.i386 0:1.8.5-31.el5_9 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: rrdutils noarch 5.2.1-1.el5.rf dag 21 k Installing for dependencies: lua i386 5.1.4-2.el5.rf dag 242 k perl-rrdtool i386 1.4.7-1.el5.rf dag 52 k rrdtool i386 1.4.7-1.el5.rf dag 906 k ruby i386 1.8.5-31.el5_9 updates 279 k ruby-libs i386 1.8.5-31.el5_9 updates 1.6 M Transaction Summary ================================================================================ Install 6 Package(s) Upgrade 0 Package(s) Total download size: 3.1 M Is this ok [y/N]: y Downloading Packages: (1/6): rrdutils-5.2.1-1.el5.rf.noarch.rpm | 21 kB 00:00 (2/6): perl-rrdtool-1.4.7-1.el5.rf.i386.rpm | 52 kB 00:00 (3/6): lua-5.1.4-2.el5.rf.i386.rpm | 242 kB 00:00 (4/6): ruby-1.8.5-31.el5_9.i386.rpm | 279 kB 00:00 (5/6): rrdtool-1.4.7-1.el5.rf.i386.rpm | 906 kB 00:03 (6/6): ruby-libs-1.8.5-31.el5_9.i386.rpm | 1.6 MB 00:01 -------------------------------------------------------------------------------- Total 327 kB/s | 3.1 MB 00:09 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : lua 1/6 Installing : ruby-libs 2/6 Installing : ruby 3/6 Installing : perl-rrdtool 4/6 Installing : rrdtool 5/6 Installing : rrdutils 6/6 Installed: rrdutils.noarch 0:5.2.1-1.el5.rf Dependency Installed: lua.i386 0:5.1.4-2.el5.rf perl-rrdtool.i386 0:1.4.7-1.el5.rf rrdtool.i386 0:1.4.7-1.el5.rf ruby.i386 0:1.8.5-31.el5_9 ruby-libs.i386 0:1.8.5-31.el5_9 Complete! |
今回はCPANでインストールしてみました
※実は仕組みを理解していないので、いろいろ調べながらできたかなってところです
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 |
[root@host1 nagiosgraph-1.4.4]# cpan cpan shell -- CPAN exploration and modules installation (v2.00) Enter 'h' for help. cpan[]> install GD Running install for module 'GD' Running make for L/LD/LDS/GD-2.50.tar.gz Fetching with LWP: ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/L/LD/LDS/GD-2.50.tar.gz Fetching with LWP: ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/L/LD/LDS/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/L/LD/LDS/GD-2.50.tar.gz ok Scanning cache /root/.cpan/build for sizes ..........................................----------------------------------DONE DEL(1/15): /root/.cpan/build/Bundle-CPAN-1.861 DEL(2/15): /root/.cpan/build/Params-Validate-1.08 DEL(3/15): /root/.cpan/build/Math-Calc-Units-1.07 DEL(4/15): /root/.cpan/build/Class-Accessor-0.34 DEL(5/15): /root/.cpan/build/Config-Tiny-2.14 DEL(6/15): /root/.cpan/build/Nagios-Plugin-0.36 DEL(7/15): /root/.cpan/build/ExtUtils-MakeMaker-6.72 DEL(8/15): /root/.cpan/build/Test-Harness-3.28 DEL(9/15): /root/.cpan/build/ExtUtils-CBuilder-0.280205 DEL(10/15): /root/.cpan/build/File-Temp-0.2301 DEL(11/15): /root/.cpan/build/Test-Simple-0.98 DEL(12/15): /root/.cpan/build/Data-Dumper-2.145 DEL(13/15): /root/.cpan/build/IO-Compress-2.062 DEL(14/15): /root/.cpan/build/IO-Zlib-1.10 DEL(15/15): /root/.cpan/build/Archive-Tar-1.92 CPAN.pm: Building L/LD/LDS/GD-2.50.tar.gz Use of uninitialized value in scalar assignment at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 1868. Use of uninitialized value in scalar assignment at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 1869. Use of uninitialized value in scalar assignment at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 1879. Use of uninitialized value in scalar assignment at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 1880. Notice: Type perl Makefile.PL -h for command-line option summary. Configuring for libgd version 2.0.33. Checking for stray libgd header files...none found. Included Features: GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33 GD library used from: /usr Checking if your kit is complete... Looks good Writing Makefile for GD Writing MYMETA.yml and MYMETA.json Use of uninitialized value in scalar assignment at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 2033. /usr/bin/perl GD/Image.pm.PLS GD/Image.pm Extracting Image.pm (with variable substitutions) cp GD/Polyline.pm blib/lib/GD/Polyline.pm cp qd.pl blib/lib/qd.pl cp GD/Image.pm blib/lib/GD/Image.pm cp GD.pm blib/lib/GD.pm AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD) cp GD/Simple.pm blib/lib/GD/Simple.pm cp GD/Polygon.pm blib/lib/GD/Polygon.pm cp GD/Group.pm blib/lib/GD/Group.pm /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap GD.xs > GD.xsc && mv GD.xsc GD.c gcc -c -I/usr/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -Wformat=0 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"2.50\" -DXS_VERSION=\"2.50\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" -DHAVE_JPEG -DHAVE_FT -DHAVE_XPM -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FONTCONFIG -DHAVE_FTCIRCLE GD.c GD.xs: In function ‘constant’: GD.xs:337: 警告: label ‘not_there’ defined but not used GD.c: In function ‘XS_GD__Image__newFromGif’: GD.xs:856: 警告: unused variable ‘truecolor’ GD.c: In function ‘XS_GD__Image_newFromGifData’: GD.xs:876: 警告: unused variable ‘truecolor’ GD.c: In function ‘XS_GD__Image_colorClosestAlpha’: GD.c:3104: 警告: unused variable ‘a’ GD.xs: In function ‘XS_GD__Image_stringFT’: GD.xs:2192: 警告: 真偽値として使われる代入のまわりでは、丸括弧の使用をお勧めします GD.xs:2196: 警告: 真偽値として使われる代入のまわりでは、丸括弧の使用をお勧めします GD.xs:2208: 警告: 真偽値として使われる代入のまわりでは、丸括弧の使用をお勧めします GD.xs:2216: 警告: 真偽値として使われる代入のまわりでは、丸括弧の使用をお勧めします GD.c: In function ‘XS_GD__Image_useFontConfig’: GD.xs:2298: 警告: unused variable ‘errormsg’ GD.c:3971: 警告: unused variable ‘image’ GD.c: トップレベル: GD.xs:62: 警告: ‘not_here’ defined but not used Running Mkbootstrap for GD () chmod 644 GD.bs rm -f blib/arch/auto/GD/GD.so LD_RUN_PATH="/usr/lib" gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib GD.o -o blib/arch/auto/GD/GD.so \ -L/usr/lib -L/usr/lib -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm -lgd \ chmod 755 blib/arch/auto/GD/GD.so cp GD.bs blib/arch/auto/GD/GD.bs chmod 644 blib/arch/auto/GD/GD.bs /usr/bin/perl "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont.PLS bdf_scripts/bdf2gdfont.pl Extracting bdf2gdfont.pl (with variable substitutions) cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl /usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/bdf2gdfont.pl Manifying blib/man1/bdf2gdfont.pl.1 Manifying blib/man3/GD::Polyline.3pm Manifying blib/man3/GD::Image.3pm Manifying blib/man3/GD::Simple.3pm Manifying blib/man3/GD.3pm Manifying blib/man3/GD::Polygon.3pm LDS/GD-2.50.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/GD.t ........ 1/12 Testing using png support. t/GD.t ........ ok t/Polyline.t .. ok All tests successful. Files=2, Tests=13, 1 wallclock secs ( 0.03 usr 0.04 sys + 0.13 cusr 0.10 csys = 0.30 CPU) Result: PASS LDS/GD-2.50.tar.gz /usr/bin/make test -- OK Running make install Manifying blib/man1/bdf2gdfont.pl.1 Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/GD/GD.so Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/GD/GD.bs Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD.pm Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/qd.pl Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/GD/autosplit.ix Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD/Polyline.pm Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD/Image.pm Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD/Polygon.pm Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD/Group.pm Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/GD/Simple.pm Installing /usr/share/man/man1/bdf2gdfont.pl.1 Installing /usr/share/man/man3/GD::Image.3pm Installing /usr/share/man/man3/GD::Polygon.3pm Installing /usr/share/man/man3/GD.3pm Installing /usr/share/man/man3/GD::Polyline.3pm Installing /usr/share/man/man3/GD::Simple.3pm Installing /usr/bin/bdf2gdfont.pl Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod LDS/GD-2.50.tar.gz /usr/bin/make install -- OK cpan> exit |
再度インストールの環境チェックを行ってみます
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@host1 nagiosgraph-1.4.4]# ./install.pl --check-prereq checking required PERL modules Carp...1.04 CGI...3.15 Data::Dumper...2.145 File::Basename...2.74 File::Find...1.10 MIME::Base64...3.07 POSIX...1.09 RRDs...1.4007 Time::HiRes...1.9717 checking optional PERL modules GD...2.50 checking nagios installation found nagios at /usr/local/nagios/bin/nagios checking web server installation found apache at /usr/sbin/httpd |
環境が整ったのでnagiosgraphをインストールします
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 |
[root@host1 nagiosgraph-1.4.4]# ./install.pl --install checking required PERL modules Carp...1.04 CGI...3.15 Data::Dumper...2.145 File::Basename...2.74 File::Find...1.10 MIME::Base64...3.07 POSIX...1.09 RRDs...1.4007 Time::HiRes...1.9717 checking optional PERL modules GD...2.50 checking nagios installation found nagios at /usr/local/nagios/bin/nagios checking web server installation found apache at /usr/sbin/httpd Destination directory (prefix)? [/usr/local/nagiosgraph] Location of configuration files (etc-dir)? [/usr/local/nagiosgraph/etc] Location of executables? [/usr/local/nagiosgraph/bin] Location of CGI scripts? [/usr/local/nagiosgraph/cgi] Location of documentation (doc-dir)? [/usr/local/nagiosgraph/doc] Location of examples? [/usr/local/nagiosgraph/examples] Location of CSS and JavaScript files? [/usr/local/nagiosgraph/share] Location of utilities? [/usr/local/nagiosgraph/util] Location of state files (var-dir)? [/usr/local/nagiosgraph/var] Location of RRD files? [/usr/local/nagiosgraph/var/rrd] Location of log files (log-dir)? [/usr/local/nagiosgraph/var] Path of log file? [/usr/local/nagiosgraph/var/nagiosgraph.log] Path of CGI log file? [/usr/local/nagiosgraph/var/nagiosgraph-cgi.log] URL of CGI scripts? [/nagiosgraph/cgi-bin] URL of CSS file? [/nagiosgraph/nagiosgraph.css] URL of JavaScript file? [/nagiosgraph/nagiosgraph.js] Path of Nagios performance data file? [/tmp/perfdata.log] URL of Nagios CGI scripts? [/nagios/cgi-bin] 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? [/usr/local/nagios/etc/nagios.cfg] Path of Nagios commands file? /usr/local/nagios/etc/objects/commands.cfg Modify the Apache configuration? [n] y configuration: ng_layout standalone ng_prefix /usr/local/nagiosgraph ng_etc_dir /usr/local/nagiosgraph/etc ng_bin_dir /usr/local/nagiosgraph/bin ng_cgi_dir /usr/local/nagiosgraph/cgi ng_doc_dir /usr/local/nagiosgraph/doc ng_examples_dir /usr/local/nagiosgraph/examples ng_www_dir /usr/local/nagiosgraph/share ng_util_dir /usr/local/nagiosgraph/util ng_var_dir /usr/local/nagiosgraph/var ng_rrd_dir /usr/local/nagiosgraph/var/rrd ng_log_dir /usr/local/nagiosgraph/var ng_log_file /usr/local/nagiosgraph/var/nagiosgraph.log ng_cgilog_file /usr/local/nagiosgraph/var/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/object/command.cfg modify_apache_config y apache_config_dir /etc/httpd/conf.d apache_config_file Continue with this configuration? [y] mkdir /usr/local/nagiosgraph mkdir /usr/local/nagiosgraph/etc copy etc/groupdb.conf to /usr/local/nagiosgraph/etc/groupdb.conf copy etc/nagiosgraph_fr.conf to /usr/local/nagiosgraph/etc/nagiosgraph_fr.conf copy etc/nagiosgraph_es.conf to /usr/local/nagiosgraph/etc/nagiosgraph_es.conf copy etc/nagiosgraph_de.conf to /usr/local/nagiosgraph/etc/nagiosgraph_de.conf copy etc/servdb.conf to /usr/local/nagiosgraph/etc/servdb.conf copy etc/rrdopts.conf to /usr/local/nagiosgraph/etc/rrdopts.conf copy etc/labels.conf to /usr/local/nagiosgraph/etc/labels.conf copy etc/access.conf to /usr/local/nagiosgraph/etc/access.conf copy etc/datasetdb.conf to /usr/local/nagiosgraph/etc/datasetdb.conf copy etc/hostdb.conf to /usr/local/nagiosgraph/etc/hostdb.conf copy etc/nagiosgraph.conf to /usr/local/nagiosgraph/etc/nagiosgraph.conf copy etc/map to /usr/local/nagiosgraph/etc/map copy etc/ngshared.pm to /usr/local/nagiosgraph/etc replace text in /usr/local/nagiosgraph/etc/nagiosgraph.conf move /usr/local/nagiosgraph/etc/nagiosgraph.conf-bak to /usr/local/nagiosgraph/etc/nagiosgraph.conf replace text in /usr/local/nagiosgraph/etc/nagiosgraph.conf move /usr/local/nagiosgraph/etc/nagiosgraph.conf-bak to /usr/local/nagiosgraph/etc/nagiosgraph.conf write stub to /usr/local/nagiosgraph/etc/nagiosgraph-nagios.cfg write stub to /usr/local/nagiosgraph/etc/nagiosgraph-commands.cfg write stub to /usr/local/nagiosgraph/etc/nagiosgraph-apache.conf mkdir /usr/local/nagiosgraph/cgi copy cgi/showhost.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/showhost.cgi move /usr/local/nagiosgraph/cgi/showhost.cgi-bak to /usr/local/nagiosgraph/cgi/showhost.cgi chmod 755 on /usr/local/nagiosgraph/cgi/showhost.cgi copy cgi/show.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/show.cgi move /usr/local/nagiosgraph/cgi/show.cgi-bak to /usr/local/nagiosgraph/cgi/show.cgi chmod 755 on /usr/local/nagiosgraph/cgi/show.cgi copy cgi/showconfig.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/showconfig.cgi move /usr/local/nagiosgraph/cgi/showconfig.cgi-bak to /usr/local/nagiosgraph/cgi/showconfig.cgi chmod 755 on /usr/local/nagiosgraph/cgi/showconfig.cgi copy cgi/showservice.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/showservice.cgi move /usr/local/nagiosgraph/cgi/showservice.cgi-bak to /usr/local/nagiosgraph/cgi/showservice.cgi chmod 755 on /usr/local/nagiosgraph/cgi/showservice.cgi copy cgi/showgroup.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/showgroup.cgi move /usr/local/nagiosgraph/cgi/showgroup.cgi-bak to /usr/local/nagiosgraph/cgi/showgroup.cgi chmod 755 on /usr/local/nagiosgraph/cgi/showgroup.cgi copy cgi/testcolor.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/testcolor.cgi move /usr/local/nagiosgraph/cgi/testcolor.cgi-bak to /usr/local/nagiosgraph/cgi/testcolor.cgi chmod 755 on /usr/local/nagiosgraph/cgi/testcolor.cgi copy cgi/showgraph.cgi to /usr/local/nagiosgraph/cgi replace text in /usr/local/nagiosgraph/cgi/showgraph.cgi move /usr/local/nagiosgraph/cgi/showgraph.cgi-bak to /usr/local/nagiosgraph/cgi/showgraph.cgi chmod 755 on /usr/local/nagiosgraph/cgi/showgraph.cgi mkdir /usr/local/nagiosgraph/bin copy lib/insert.pl to /usr/local/nagiosgraph/bin replace text in /usr/local/nagiosgraph/bin/insert.pl move /usr/local/nagiosgraph/bin/insert.pl-bak to /usr/local/nagiosgraph/bin/insert.pl chmod 755 on /usr/local/nagiosgraph/bin/insert.pl mkdir /usr/local/nagiosgraph/share copy share/nagiosgraph.css to /usr/local/nagiosgraph/share/nagiosgraph.css copy share/nagiosgraph.js to /usr/local/nagiosgraph/share mkdir /usr/local/nagiosgraph/doc copy AUTHORS to /usr/local/nagiosgraph/doc copy CHANGELOG to /usr/local/nagiosgraph/doc copy INSTALL to /usr/local/nagiosgraph/doc copy README to /usr/local/nagiosgraph/doc copy TODO to /usr/local/nagiosgraph/doc mkdir /usr/local/nagiosgraph/examples copy examples/map_1_4_3 to /usr/local/nagiosgraph/examples copy examples/nagiosgraph.2.css to /usr/local/nagiosgraph/examples copy examples/map_1_3 to /usr/local/nagiosgraph/examples copy examples/nagiosgraph-nagios.cfg to /usr/local/nagiosgraph/examples copy examples/map_1_4_4 to /usr/local/nagiosgraph/examples copy examples/nagiosgraph.1.css to /usr/local/nagiosgraph/examples copy examples/map_examples to /usr/local/nagiosgraph/examples copy examples/map_minimal to /usr/local/nagiosgraph/examples copy examples/map_mwall to /usr/local/nagiosgraph/examples copy examples/nagiosgraph-apache.conf to /usr/local/nagiosgraph/examples copy examples/nagiosgraph-commands.cfg to /usr/local/nagiosgraph/examples copy examples/nagiosgraph-logrotate to /usr/local/nagiosgraph/examples copy share/graph.gif to /usr/local/nagiosgraph/examples copy share/nagiosgraph.ssi to /usr/local/nagiosgraph/examples mkdir /usr/local/nagiosgraph/util copy utils/testentry.pl to /usr/local/nagiosgraph/util copy utils/upgrade.pl to /usr/local/nagiosgraph/util chmod 755 on /usr/local/nagiosgraph/util/testentry.pl chmod 755 on /usr/local/nagiosgraph/util/upgrade.pl mkdir /usr/local/nagiosgraph/var/rrd chmod 755 on /usr/local/nagiosgraph/var/rrd chown nagios,- on /usr/local/nagiosgraph/var/rrd touching /usr/local/nagiosgraph/var/nagiosgraph.log chmod 644 on /usr/local/nagiosgraph/var/nagiosgraph.log chown nagios,- on /usr/local/nagiosgraph/var/nagiosgraph.log touching /usr/local/nagiosgraph/var/nagiosgraph-cgi.log chmod 644 on /usr/local/nagiosgraph/var/nagiosgraph-cgi.log chown apache,- on /usr/local/nagiosgraph/var/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-20130822.1707 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-20130822.1712 move /usr/local/nagios/etc/objects/commands.cfg.tmp to /usr/local/nagios/etc/objects/commands.cfg move /usr/local/nagiosgraph/etc/nagiosgraph-apache.conf to /etc/httpd/conf.d/nagiosgraph.conf * Restart nagios to start data collection: /etc/init.d/nagios restart * Restart apache to enable display of graphs: /etc/init.d/apache 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 |
1 2 3 4 5 |
[root@host1 nagiosgraph-1.4.4]# /etc/init.d/nagios reload Running configuration check...done. Reloading nagios configuration...done [root@host1 nagiosgraph-1.4.4]# /etc/init.d/httpd reload httpd を再読み込み中: |
Nagiosgraphにアクセスしてみます。URLは下記になります
http://nagios.Server.ip/nagiosgraph/cgi-bin/show.cgi
右上のプルダウンメニューから機器名と監視項目を選択して[Update Graphs]をクリックすればグラフが表示されます
ただし直後はデータが無いのでグラフ線は表示されないですが…
モジュールや各種設定が確認できます
http://nagios.Server.ip/nagiosgraph/cgi-bin/showconfig.cgi
nagiosgraphへのアクセス制限を行います
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@host1 ~]# vi /etc/httpd/conf.d/nagiosgraph.conf [root@host1 ~]# cat /etc/httpd/conf.d/nagiosgraph.conf # enable nagiosgraph CGI scripts ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi" <Directory "/usr/local/nagiosgraph/cgi"> Options ExecCGI AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.1 Allow from 192.168.1. </Directory> # enable nagiosgraph CSS and JavaScript Alias /nagiosgraph "/usr/local/nagiosgraph/share" <Directory "/usr/local/nagiosgraph/share"> Options None AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.1 Allow from 192.168.1. </Directory> |
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 |
[root@host1 nagiosgraph-1.4.4]# ./install.pl --help options include: --install do the installation --check-prereq check pre-requisites --check-installation check the installation --dry-run --verbose | --silent --list-vars list recognized environment variables --layout (overlay | standalone | debian | redhat | suse | custom) --prefix path --etc-dir path --var-dir path --log-dir path --doc-dir path --nagios-cgi-url url --nagios-perfdata-file path --nagios-user userid --www-user userid examples: to install on an ubuntu system with nagios3: install.pl --layout debian to install on a redhat/fedora system with nagios3: install.pl --layout redhat to install on a suse system with nagios3: install.pl --layout suse to overlay with nagios at /usr/local/nagios: install.pl --layout overlay --prefix /usr/local/nagios to install at /opt/nagiosgraph: install.pl --layout standalone --prefix /opt/nagiosgraph to install without prompts for automated or unattended installations, specify one or more environment variables. |