Zum Inhalt springen

Smokeping unter Red Hat Linux

Aus LHlab Wiki
Warnung Work in Progress

Diese Seite wird erst noch aufgebaut. Bitte noch keine Änderungen vornehmen, ohne mit dem ursprünglichen Author zu sprechen!
Vielen Dank

Hier eine Anleitung wie man unter Red Hat Linux das Tool Smokeping zum laufen bekommt.

Abhängigkeiten erfüllen

Es wird das EPEL Repository benötigt!

Zuerst müssen die Abhängigkeiten für smokeping installiert werden:

yum install httpd php php-common perl perl-CPAN perl-YAML rrdtool rrdtool-perl perl-libwww-perl perl-Socket6 perl-FCGI perl-CGI perl-Net-Telnet fping curl perl-Net-OpenSSH perl-Net-DNS perl-Test-Simple perl-CGI-SpeedyCGI perl-IO-Socket-SSL perl-LDAP

dann den apache Server in den Autostart befördern:

chkconfig httpd on

Nun noch ein paar PERL Module via cpan nachinstallieren:

cpan

dann im cpan:

Config::Grammar

Installation Smokeping

Das neuste Paket bekommt ihr hier:

cd /usr/src/
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
tar -xzvf smokeping-2.6.8.tar.gz
cd smokeping-2.6.8
./configure --prefix=/opt/smokeping
make install
ln -s /opt/smokeping/etc /etc/smokeping
mkdir /opt/smokeping/htdocs/cache
chmod 777 -R /opt/smokeping/htdocs/cache
mkdir /opt/smokeping/data
mkdir /opt/smokeping/var
chmod o-r /opt/smokeping/etc/smokeping_secrets.dist

Nun kann das Webinterface installiert werden. Hierfür kopieren wir einfach die Webfiles in unseren vhost folder:

mv /opt/smokeping/htdocs /srv/httpd/vhosts/yourdomain.tld/htdocs/smokeping

Konfiguration

cd /opt/smokeping
cp bin/smokeping_cgi htdocs/smokeping.cgi
mv etc/config.dist etc/config

Ich werde hier nur auf die Basics eingehen, die Konfiguriert werden sollten, alle weiteren Einstellungen kann man in der Dokumentation von smokeping nachlesen:
* http://oss.oetiker.ch/smokeping/doc/smokeping_config.en.html

/etc/smokeping/config
*** General ***

*** General ***
owner    = SHE
contact  = yourmail@domain.tld
mailhost = localhost

imgcache = /opt/smokeping/htdocs/cache
imgurl   = cache

cgiurl   = http://212.21.169.190/smokeping/smokeping.cgi

*** Alerts ***

*** Alerts ***
to = yourmail@domain.tld
from = smokealert@hostname.tld

*** Probes ***

*** Probes ***

+ FPing

binary = /usr/sbin/fping

+ DNS
binary = /usr/bin/dig
lookup = domain-to-lookup.com
pings = 5
step = 180

+ Curl
# probe-specific variables
binary = /usr/bin/curl
step = 60
# a default for this target-specific variable
urlformat = http://%host%/

*** Targets ***

# Ping Tests
+ PING
probe = FPing
menu = Ping Tests
title = Ping Tests

++ SERVER1
menu = Server1
title = Ping Latency Server1
host = server1.domain.tld

# HTTP Tests
+ HTTP
probe = Curl
menu = HTTP Tests
title = Ping Tests

++ SERVER1
menu = Server1
title = HTTP Latency Server1
host = server1.domain.tld

# DNS Tests
+ DNS
probe = DNS
menu = DNS Latency
title = DNS Latency

++ SERVER1
host = server1.domain.tld

Nun sollte noch das Smokeping CGI über den Apache verfügbar gemacht werden. Hierfür sollte man folgende Zeilen der Apache Konfiguration anhängen. Will man das Ganze nur für einen vhost verfügbar machen, sollte man dies in der Vhost Konfiguration einfügen, ansonsten kann man einfach eine Datei /etc/httpd/conf.d/smokeping.conf mit dem folgenden Inhalt anlegen.

    ScriptAlias /smokeping/smokeping.cgi /opt/smokeping/htdocs/smokeping.cgi
    Alias /smokeping /opt/smokeping/htdocs
    <Directory /opt/smokeping/htdocs>
        Options -Indexes ExecCGI FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Allow from all
    </Directory>

Anschließend muss der Apache neugestartet werden:

apachectl configtest
apachectl restart

Nun sollte unter folgender URL ein erster Preview möglich sein:

Test und Init Skript

./bin/smokeping --config=/opt/smokeping/etc/config --debug

der folgende Aufruf startet smokeping

./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log

Quellen