Linux 系统环境下面配置SmokePing
最近需要监控一些机器来测试网络情况,以前我都是用cacti里面的一个模板---Advanced Ping 但是我个人觉得这个好像不太好控制。于是找了一个软件叫SmokePing。感觉还不错。BSD下面安装就简单多了,基本上装上就能用了。Linux下面配置相对来说要麻烦一些。具体如下:
首先,肯定是按官方的文档来安装需要的插件和模块,模块主要是perl,因为SmokePing是用perl开发出来的,所以需要的都是perl模板,插件都是根据不同的监控需求来使用了。安装就不多说了。
其次,配置SmokePing
下载好SmokePIng的包,放到/usr/local目录下面,解压出来。重新命名为smokeping
进入/usr/local/smokeping
配置主要是在etc目录下面的config文件 这个是SmokePIng的主配置文件,相关参数都是在这个里面做的。
这个config文件的配置我在另一篇文章里已经说了,这里就不多说了。
我们来说说linux下面其它的配置:
主要的错误:httpd-error.log里面的,如下:
[Tue Nov 17 23:15:26 2009] [error] [client 192.168.0.13] speedy_backend[30803]: perl_parse error
[Tue Nov 17 23:15:27 2009] [error] [client 192.168.0.13] speedy[30801]: Cannot spawn backend process
[Tue Nov 17 23:15:27 2009] [error] [client 192.168.0.13] Premature end of script headers: smokeping.cgi
[root@Nagios logs]# tail error_log
[Tue Nov 17 23:17:10 2009] [error] [client 192.168.0.199] speedy_backend[30838]: perl_parse error
[Tue Nov 17 23:17:11 2009] [error] [client 192.168.0.199] speedy[30836]: Cannot spawn backend process
[Tue Nov 17 23:17:11 2009] [error] [client 192.168.0.199] Premature end of script headers: smokeping.cgi
[Tue Nov 17 23:17:12 2009] [error] [client 192.168.0.199] [Tue Nov 17 23:17:12 2009] smokeping.cgi: Can't locate Smokeping/Config.pm in @INC (@INC contains: /home/oetiker/checkouts/smokeping/trunk/software/lib /usr/pack/rrdtool-1.3.0-rp/lib/perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/5.8.8/Smokeping.pm line 12.
[Tue Nov 17 23:17:12 2009] [error] [client 192.168.0.199] [Tue Nov 17 23:17:12 2009] smokeping.cgi: BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.8/Smokeping.pm line 12.
[Tue Nov 17 23:17:12 2009] [error] [client 192.168.0.199] [Tue Nov 17 23:17:12 2009] smokeping.cgi: Compilation failed in require at /usr/local/smokeping/htdocs/smokeping.cgi line 12.
[Tue Nov 17 23:17:12 2009] [error] [client 192.168.0.199] [Tue Nov 17 23:17:12 2009] smokeping.cgi: BEGIN failed--compilation aborted at /usr/local/smokeping/htdocs/smokeping.cgi line 12.
这个主要是有几个地方没有配置好:
A、在htdocs目录下面的smokeping.cgi文件 里面对于lib目录的配置和其它目录的配置
B、在bin目录下面的smokeping文件 也是相关目录的配置。
Apache相关配置
一个是httpd.conf里面关于smokeping的cgi配置和目录权限配置
#### Configure for smpkeping ####
#ScriptAlias /smokeping.cgi "/usr/local/smokeping/htdocs/smokeping.cgi"
ScriptAlias /smokeping/cgi-bin "/usr/local/smokeping/htdocs"
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
#ScriptAlias /tr.cgi /usr/local/smokeping/htdocs/tr.cgi
Alias /smokeping "/usr/local/smokeping/htdocs/"
AddHandler cgi-script cgi
Options ExecCGI
AllowOverride None
#AddHandler cgi-script cgi
Order Allow,Deny
Allow from all
#Allow from 192.168.0.0
大概就是这样子的了。基本上不会有问题了。呵呵
阅读(1774) | 评论(0) | 转发(0) |