smokeping

install LTperf

package dependances

EPEL

[root@LTperf ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@LTperf ~]# yum install epel-release-latest-7.noarch.rpm

si autre pb de repo par rapport a nos repo internes cobbler, on peux bypasser en redefinissant les repos standards :

<code>
[root@localhost yum.repos.d]# cat centos-out.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
protect=1

#released updates 
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
protect=1 

exemple de repos: https://www.centos.org/docs/5/html/yum/sn-yum-maintenance.htmlhttp://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os

</code>

fping et perl-cgi depuis epel

[root@LTperf ~]#  yum install fping  perl-CGI-SpeedyCGI

packages dependances

[root@LTperf ~]#  yum install mod_fcgid httpd httpd-devel rrdtool perl-CGI-SpeedyCGI fping rrdtool-perl perl perl-Sys-Syslog perl-CPAN perl-local-lib perl-Time-HiRes

autres perl*

[root@localhost smokeping-2.6.11]# yum install bind-libs bind-utils cronie cronie-anacron crontabs exim file gpm-libs nagios-common nagios-of-plugins nagios-plugins nagios-plugins-disk nagios-plugins-load nagios-plugins-nrpe nagios-plugins-ntp nagios-plugins-perl nagios-plugins-procs nagios-plugins-swap nagios-plugins-users nrpe ntp ntpdate perl-Class-Accessor perl-Config-Tiny perl-Math-Calc-Units perl-Module-Implementation perl-Module-Runtime perl-Nagios-Plugin perl-Params-Classify perl-Params-Validate perl-Try-Tiny perl-Test-Simple perl-parent perl-version perl perl-Module-Pluggable perl-Pod-Escapes perl-Pod-Simple perl-libs perl-version sudo vim-common vim-enhanced which

dev tools

[root@LTperf ~]# yum groupinstall "Development tools"

smokeping tar.gz

[root@LTperf ~]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
[root@LTperf ~]# tar -zxvf smokeping-2.6.11.tar.gz

[root@LTperf ~]# cd smokeping-2.6.11/setup/
[root@LTperf setup]# ./build-perl-modules.sh 
Connexion vers raw.githubusercontent.com (raw.githubusercontent.com)|185.31.19.133|:443...connecté.
requête HTTP transmise, en attente de la réponse...200 OK
Longueur: 303905 (297K) [text/plain]
Sauvegarde en : «/root/smokeping-2.6.11/thirdparty/bin/cpanm»

100%[================================================================================================================================>] 303 905     --.-K/s   ds 0,03s   

2016-02-18 09:20:26 (9,31 MB/s) - «/root/smokeping-2.6.11/thirdparty/bin/cpanm» sauvegardé [303905/303905]

--> Working on FCGI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/FCGI-0.77.tar.gz ... OK
Configuring FCGI-0.77 ... OK
Building FCGI-0.77 ... OK
...
==> Found dependencies: Net::HTTP
--> Working on Net::HTTP
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Net-HTTP-6.09.tar.gz ... OK
Configuring Net-HTTP-6.09 ... OK
Building Net-HTTP-6.09 ... OK
Successfully installed Net-HTTP-6.09 (upgraded from 6.06)
Building libwww-perl-6.15 ... OK
Successfully installed libwww-perl-6.15 (upgraded from 6.05)
2 distributions installed
[root@LTperf smokeping-2.6.11]#  mkdir /opt/smokeping
[root@LTperf smokeping-2.6.11]# ls
aclocal.m4  CHANGES    configure.ac  CONTRIBUTORS  doc  htdocs  LICENSE      Makefile.in   README  thirdparty
bin         configure  conftools     COPYRIGHT     etc  lib     Makefile.am  PERL_MODULES  setup   TODO
[root@LTperf smokeping-2.6.11]# cp -r thirdparty /opt/smokeping/

[root@LTperf smokeping-2.6.11]# ./configure --prefix=/opt/smokeping
[root@LTperf smokeping-2.6.11]# make install
Making install in bin
make[1] : on entre dans le répertoire « /root/smokeping-2.6.11/bin »
make[2] : on entre dans le répertoire « /root/smokeping-2.6.11/bin »
 /usr/bin/mkdir -p '/opt/smokeping/bin'
 /usr/bin/install -c smokeinfo smokeping smokeping_cgi tSmoke '/opt/smokeping/bin'
make  install-exec-hook
make[3] : on entre dans le répertoire « /root/smokeping-2.6.11/bin »
[ xERL5LIB != x ] && cd "/opt/smokeping/bin" && /usr/bin/perl -i -p -e 's{^#!.*}{#!/usr/bin/perl}; s{.*# PERL5LIB}{use lib (split /:/, q{}); # PERL5LIB}' smokeinfo smokeping smokeping_cgi tSmoke
...
...
make[2] : on quitte le répertoire « /root/smokeping-2.6.11 »
make[1] [root@LTperf conf]# /etc/init.d/smokeping start
ERROR: /opt/smokeping/bin/../etc/config, line 128: File '/opt/smokeping/etc/smokeping_secrets' is world-readable or writable, refusing it
/etc/init.d/smokeping start: smokeping could not be started: on quitte le répertoire « /root/smokeping-2.6.11 »

en complement edition de certain fichier de parametrage: smokemail tmail


[root@LTperf conf]# mkdir /opt/smokeping/cache
[root@LTperf conf]# mkdir /opt/smokeping/data
[root@LTperf conf]# mkdir /opt/smokeping/var
[root@localhost smokeping-2.6.11]# cp /opt/smokeping/etc/smokeping_secrets.dist /opt/smokeping/etc/smokeping_secrets
[root@localhost smokeping-2.6.11]# chmod 600 /opt/smokeping/etc/smokeping_secrets
[root@LTperf conf]#  chmod 600 /opt/smokeping/etc/smokeping_secrets
[root@LTperf conf]# chmod 600 /opt/smokeping/etc/smokeping_secrets.dist
[root@LTperf conf]#  mkdir /opt/smokeping/img
[root@LTperf conf]#  chown -R apache:apache /opt/smokeping/img
[root@LTperf conf]# chown -R apache:apache /opt/smokeping/cache
[root@LTperf conf]#  ln -s /opt/smokeping/htdocs /var/www/html/smokeping
[root@LTperf conf]#  ln -s /opt/smokeping/img /var/www/html/smokeping
[root@LTperf conf]# ln -s /opt/smokeping/cache /var/www/html/smokeping
[root@LTperf conf]#  chown -R apache:apache /var/www/html/smokeping
[root@localhost smokeping-2.6.11]# cp /opt/smokeping/etc/tmail.dist /opt/smokeping/etc/tmail
[root@localhost smokeping-2.6.11]# cp /opt/smokeping/etc/smokemail.dist /opt/smokeping/etc/smokemail
[root@localhost smokeping-2.6.11]# vim /opt/smokeping/etc/smokemail
[root@localhost smokeping-2.6.11]# vim /opt/smokeping/etc/tmail

apache

configuration apache pour definir l'usage de .cgi et la location smokeping

[root@LTperf conf]# diff httpd.conf httpd.conf.orig
164,165c164
< #    DirectoryIndex index.html
< DirectoryIndex index.html index.html.var smokeping.fcgi
---
>     DirectoryIndex index.html
295c294
<     AddHandler cgi-script .cgi
---
>     #AddHandler cgi-script .cgi

[root@LTperf conf]# cat /etc/httpd/conf.d/smokeping.conf 
<Directory "/var/www/html/smokeping">
    Options +ExecCGI
</Directory>

on renome le smokeping.fcgi.dish pour le directory index en *.fcgi

[root@LTperf smokeping]# cd /opt/smokeping/htdocs
[root@LTperf htdocs]# cp smokeping.fcgi.dist smokeping.fcgi
[root@LTperf conf]# systemctl start httpd.service 

Lancement

1er lancement manuel pour verifier la config et creer le fichier de log

[root@LTperf smokeping]# ./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log
Note: logging to syslog as local0/info.
Daemonizing ./bin/smokeping ...
[root@LTperf smokeping]# ls
bin  cache  data  etc  htdocs  img  lib  share  smoke.log  thirdparty  var
[root@LTperf smokeping]# tail -f smoke.log 
Thu Feb 18 09:54:22 2016 - No targets defined for probe EchoPingIcp, skipping.
Thu Feb 18 09:54:22 2016 - No targets defined for probe Curl, skipping.
Thu Feb 18 09:54:22 2016 - No targets defined for probe EchoPingHttp, skipping.
Thu Feb 18 09:54:22 2016 - No targets defined for probe EchoPingSmtp, skipping.
Thu Feb 18 09:54:22 2016 - No targets defined for probe EchoPingDNS, skipping.
Thu Feb 18 09:54:22 2016 - No targets defined for probe EchoPingWhois, skipping.
Thu Feb 18 09:54:22 2016 - EchoPingLDAP: probing 1 targets with step 300 s and offset 73 s.
Thu Feb 18 09:54:22 2016 - Child process 14066 started for probe FPing.
Thu Feb 18 09:54:22 2016 - FPing: probing 24 targets with step 300 s and offset 77 s.
Thu Feb 18 09:54:22 2016 - All probe processes started successfully.

puis lancement par script

[root@LTperf smokeping]# /etc/init.d/smokeping start
/etc/init.d/smokeping start: smokeping started