Smokeping unter Red Hat Linux: Unterschied zwischen den Versionen
K Textersetzung - „<source“ durch „<syntaxhighlight“ |
|||
| (6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
Hier eine Anleitung wie man unter Red Hat Linux bzw. CentOS das Tool Smokeping zum Laufen bekommt. Ich habe dies anhand eines Red Hat Linux 6 64bit durchgeführt. | |||
Hier eine Anleitung wie man unter Red Hat Linux das Tool Smokeping zum | |||
== Abhängigkeiten erfüllen == | == Abhängigkeiten erfüllen == | ||
Es wird das EPEL Repository benötigt! | Es wird das EPEL Repository benötigt! Mehr Infos wie man dies nutzt findet man hier: | ||
* http://fedoraproject.org/wiki/EPEL | |||
Zuerst müssen die Abhängigkeiten für smokeping installiert werden: | Zuerst müssen die Abhängigkeiten für smokeping installiert werden: | ||
< | <syntaxhighlight lang=bash> | ||
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 | 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 | ||
</ | </syntaxhighlight> | ||
dann den apache Server in den Autostart befördern: | dann den apache Server in den Autostart befördern: | ||
< | <syntaxhighlight lang=bash> | ||
chkconfig httpd on | chkconfig httpd on | ||
</ | </syntaxhighlight> | ||
Nun noch ein paar PERL Module via cpan nachinstallieren: | Nun noch ein paar PERL Module via cpan nachinstallieren: | ||
< | <syntaxhighlight lang=bash> | ||
cpan | cpan | ||
</ | </syntaxhighlight> | ||
dann im cpan: | dann im cpan: | ||
<pre> | <pre> | ||
| Zeile 24: | Zeile 23: | ||
Das neuste Paket bekommt ihr hier: | Das neuste Paket bekommt ihr hier: | ||
* http://oss.oetiker.ch/smokeping | * http://oss.oetiker.ch/smokeping | ||
< | <syntaxhighlight lang=bash> | ||
cd /usr/src/ | cd /usr/src/ | ||
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz | wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz | ||
| Zeile 37: | Zeile 36: | ||
mkdir /opt/smokeping/var | mkdir /opt/smokeping/var | ||
chmod o-r /opt/smokeping/etc/smokeping_secrets.dist | chmod o-r /opt/smokeping/etc/smokeping_secrets.dist | ||
</ | </syntaxhighlight> | ||
== Konfiguration == | == Konfiguration == | ||
< | <syntaxhighlight lang=bash> | ||
cd /opt/smokeping | cd /opt/smokeping | ||
cp bin/smokeping_cgi htdocs/smokeping.cgi | cp bin/smokeping_cgi htdocs/smokeping.cgi | ||
mv etc/config.dist etc/config | mv etc/config.dist etc/config | ||
</ | </syntaxhighlight> | ||
Ich werde hier nur auf die Basics eingehen, die Konfiguriert werden sollten, alle weiteren Einstellungen kann man in der Dokumentation von smokeping nachlesen: | Ich werde hier nur auf die Basics eingehen, die Konfiguriert werden sollten, alle weiteren Einstellungen kann man in der Dokumentation von smokeping nachlesen: | ||
| Zeile 59: | Zeile 58: | ||
imgurl = cache | imgurl = cache | ||
cgiurl = http:// | cgiurl = http://YOURSERVERIP/smokeping/smokeping.cgi | ||
</pre> | </pre> | ||
<code>*** Alerts ***</code> | <code>*** Alerts ***</code> | ||
| Zeile 136: | Zeile 135: | ||
</pre> | </pre> | ||
Anschließend muss der Apache neugestartet werden: | Anschließend muss der Apache neugestartet werden: | ||
< | <syntaxhighlight lang=bash> | ||
apachectl configtest | apachectl configtest | ||
apachectl restart | apachectl restart | ||
</ | </syntaxhighlight> | ||
Nun sollte unter folgender URL ein erster Preview möglich sein: | Nun sollte unter folgender URL ein erster Preview möglich sein: | ||
* http://IPorSERVERNAME/smokeping/smokeping.cgi | * <nowiki>http://IPorSERVERNAME/smokeping/smokeping.cgi</nowiki> | ||
== Test und Init Skript == | == Test und Init Skript == | ||
Der erste Test kann nun wie folgt erfolgen, hier sollte nun einmalig ein smokeping Durchlauf stattfinden. | Der erste Test kann nun wie folgt erfolgen, hier sollte nun einmalig ein smokeping Durchlauf stattfinden. | ||
< | <syntaxhighlight lang=bash>./bin/smokeping --config=/opt/smokeping/etc/config --debug</syntaxhighlight> | ||
der folgende Aufruf startet smokeping | der folgende Aufruf startet smokeping | ||
< | <syntaxhighlight lang=bash> | ||
./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log | ./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log | ||
</ | </syntaxhighlight> | ||
Läuft alles wie gewollt, kann man das folgende INIT Script verwenden. Als vorlage diente hier das original [http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script INIT Script von Michel Tokic].<br> | Läuft alles wie gewollt, kann man das folgende INIT Script verwenden. Als vorlage diente hier das original [http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script INIT Script von Michel Tokic].<br> | ||
<code>/etc/init.d/smokeping</code> | <code>/etc/init.d/smokeping</code> | ||
< | <syntaxhighlight lang=bash> | ||
</ | </syntaxhighlight> | ||
nun noch in den Autostart und starten: | nun noch in den Autostart und starten: | ||
< | <syntaxhighlight lang=bash> | ||
chkconfig --add smokeping | chkconfig --add smokeping | ||
chkconfig smokeping on | chkconfig smokeping on | ||
/etc/init.d/smokeping start | /etc/init.d/smokeping start | ||
</ | </syntaxhighlight> | ||
mit dem folgenden Befehl kann der Autostart geprüft werden: | mit dem folgenden Befehl kann der Autostart geprüft werden: | ||
< | <syntaxhighlight lang=bash> | ||
chkconfig --list smokeping | chkconfig --list smokeping | ||
</ | </syntaxhighlight> | ||
<pre>smokeping 0:off 1:off 2:on 3:on 4:on 5:on 6:off</pre> | <pre>smokeping 0:off 1:off 2:on 3:on 4:on 5:on 6:off</pre> | ||
Die folgenden Optionen sind beim init Script verfügbar: | Die folgenden Optionen sind beim init Script verfügbar: | ||
| Zeile 183: | Zeile 182: | ||
== Quellen == | == Quellen == | ||
* http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html | * http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html | ||
{{#related:Smokeping Docker Installation}} | |||
{{#related:Smokeping unter Debian/Ubuntu Linux}} | |||
{{#related:Netzwerk Traffic unter Linux anzeigen}} | |||
[[Kategorie:Linux]] | [[Kategorie:Linux]] | ||
[[Kategorie:RedHat]] | [[Kategorie:RedHat]] | ||
[[Kategorie:Monitoring]] | |||
[[Kategorie:Netzwerk]] | |||
Aktuelle Version vom 1. Januar 2021, 21:19 Uhr
Hier eine Anleitung wie man unter Red Hat Linux bzw. CentOS das Tool Smokeping zum Laufen bekommt. Ich habe dies anhand eines Red Hat Linux 6 64bit durchgeführt.
Abhängigkeiten erfüllen
Es wird das EPEL Repository benötigt! Mehr Infos wie man dies nutzt findet man hier:
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
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:
/etc/smokeping/config
*** General ***
*** General *** owner = YOURName contact = yourmail@domain.tld mailhost = localhost imgcache = /opt/smokeping/htdocs/cache imgurl = cache cgiurl = http://YOURSERVERIP/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 follow_redirects = yes include_redirects = yes # 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:
- http://IPorSERVERNAME/smokeping/smokeping.cgi
Test und Init Skript
Der erste Test kann nun wie folgt erfolgen, hier sollte nun einmalig ein smokeping Durchlauf stattfinden.
./bin/smokeping --config=/opt/smokeping/etc/config --debug
der folgende Aufruf startet smokeping
./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log
Läuft alles wie gewollt, kann man das folgende INIT Script verwenden. Als vorlage diente hier das original INIT Script von Michel Tokic.
/etc/init.d/smokeping
nun noch in den Autostart und starten:
chkconfig --add smokeping
chkconfig smokeping on
/etc/init.d/smokeping start
mit dem folgenden Befehl kann der Autostart geprüft werden:
chkconfig --list smokeping
smokeping 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Die folgenden Optionen sind beim init Script verfügbar:
/etc/init.d/smokeping usage: /etc/init.d/smokeping (start|stop|restart|status|strace_debug|help) start - start smokeping stop - stop smokeping restart - restart smokeping if running or start if not running status - show status if smokeping is running or not help - this screen