Sei sulla pagina 1di 26

ADMIN Network & Security

SPONSORED BY

ANOTHER

10 Tools
More marvelous utilities
for configuring and
managing your
Terrific
FOR THE BUSY ADMIN
2017 EDITION

network
Find the perfect tool to
Rescue lost data
Roll back config changes
Correct Bash input
Visualize Ping statistics
Bonus articles
5 Log Monitoring Tools
Web Analytics without Google
www . admin - magazine . com US$ 7.95
Welcome ANOTHER 10 TERRIFIC TOOLS

ANOTHER
ADMIN

10 Tools Terrific
Network & Security

FOR THE BUSY ADMIN


2017 EDITION

Dear Readers:
Every system administrator needs a toolkit of simple, Magazine columnist Charly Khnast, includes useful
useful tools to help with practical tasks. ADMINs 10 utilities for security, performance monitoring, network
Terrific Tools series shines the spotlight on the best free troubleshooting, and more. Read on! We hope you find
tools for admins. This latest list, from the toolkit of Linux some tools for your own toolkit in this years collection.

ADMIN Special Table of Contents


Editor in Chief Joe Casad
Managing Editor R
 ita L Sooby
Etckeeper. . . . . . . 4 Socket Statistics. . . 9
Copy Editor A
 my Pettle
Track /etc changes in Git so you can A fast and easy tool for monitoring
Layout / Graphic Design Dena Friesen, Lori White
restore previous configurations. network stats.
Advertising
Ann Jesse, ajesse@linuxnewmedia.com
Phone: +1-785-841-8834 Prettyping and ddrescue. . . . . . . . . . 10
Read errors wont deter this helpful
Publisher Brian Osborn Asciiflow. . . . . . . . 5
data recovery tool.
Customer Service / Subscription Transform boring ping data into
For USA and Canada: colorful statistics.
Email: cs@linuxnewmedia.com Keepalived . . . . . . . . . 11
Phone: 1-866-247-2802 Configure a floating IP address for
(toll-free from the US and Canada) Dnstop. . . . . . . . . . 6 failover.
www.admin-magazine.com Monitor DNS traffic on your network.
While every care has been taken in the content of paping. . . . . . . . . . . . 12
the m
agazine, the publishers cannot be held The Fuck. . . . . . . . 7 Use this connectivity checker when
responsible for the accuracy of the information ping cant connect.
Correct your command-line
contained within it or any c onsequences arising
from the use of it. misspellings.
httpstat . . . . . . . . . . 13
Copyright & Trademarks 2017 Linux New Media
This simple tool wil help you discover
USA, LLC testssl.sh . . . . . . . 8 how long a web server takes to serve
Cover Illustration Nataliia Natykach, 123RF.com A handy script for testing SSL up an HTML page.
No material may be reproduced in any form certificates.
whatsoever in whole or in part without the written
permission of the p ublishers. It is assumed that all
correspondence sent, for example, letters, email, As a special bonus, were also including two more articles
faxes, photographs, articles, drawings, are s upplied
for publication or license to third parties on a non- with great tools for your personal admin toolkit:
exclusive worldwide basis by Linux New Media
unless otherwise stated in writing. Five Log Monitoring Tools. . . . . . . . . . . . . . . . . . . . . . . 14
All brand or product names are trademarks oftheir Anyone who wants to watch logfiles can use a full-featured monitoring tool like Nagios;
respective owners. Contact us if we havent
however, a lightweight alternative also sniffs out threats and takes much less time to set up.
credited your copyright; we will always correct any
oversight.
Web Analytics Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
ADMIN is published by Linux New Media USA,
LLC, 616 Kentucky St, Lawrence, KS 66044, USA.
If you are looking for an alternative to Google Analytics, try a free alternative such as Piwik,
Published in Europe by: Sparkhaus Media GmbH,
Open Web Analytics, or eAnalytics.
Zieblandstr. 1, 80799 Munich, Germany

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 3
ANOTHER 10 TERRIFIC TOOLS Etckeeper

The Sys Admins Daily Grind: Etckeeper

Fountain
of Youth
Track /etc changes in Git so you can restore previous configurations. By Charly Khnast

Etckeeper is part of many distribu-


tions and is otherwise available from
GitHub [1]. Of course, Git also needs
to be installed on the computer.
Anyone who hasnt used Git on their
system should configure a few funda-
mental settings:

git config global user.name "Charly"


git config global user.email U Figure 1: If someone has configured something in /etc, Git notices the difference when comparing with the
"charly@example.com" repository.
git config global core.editor "vim"
the # end section [...] etckeeper Date: Wed May 11 14:18:50 2016 +0200
Because I execute the etckeeper and line: main.cf changed
git commands with sudo, these set-
tings prevent the root user from being # end section managed by etckeeper Its important to realize that this pro-
entered as a committer. ghostscript/* cess implements versioning theres
no backup! Etckeeper and Git help you
Preserving Youth Now, however, all the data from / comprehend changes in configuration
etc/ since the first commit is already files and roll them back if necessary,
To begin, I need to initialize the new in the repository, so I have to remove but thats a lot for anyone whos con-
repository, then I save all /etc files in the undesired files manually: figured something incorrectly. n
it for the first time:
sudo git rm r cached ghostscript/* Info
cd /etc [1] Etckeeper:
sudo etckeeper init To demonstrate, I change a little [https://github.com/joeyh/etckeeper]
sudo etckeeper commit "Initial etc commit" something in /etc/postfix/main.cf;
in fact, sudo git status shows that Charly Khnast
Some distributions, such as Ubuntu, Git notices the difference when com- Charly Khnast is a Unix operating system
execute this step automatically when paring the data with the repository administrator at the Data Center in Moers,
installing Etckeeper. In this case, I see (Figure 1). I can now check in the Germany. His tasks include firewall and DMZ
output like: new version: security and avail-
ability. He divides his
> On branch master sudo git commit a m "main.cf changed" leisure time into hot,
> nothing to commit, working directory clean wet, and eastern sec-
An overview of all actions is provided tors, where he enjoys
Sometimes I dont want all the data with sudo git log command: cooking, freshwater
in /etc/ in the repository, so I tell Git aquariums, and
which directories Etckeeper should commit9695e06a8175bd5cf485316f20d8fb 6d6fcc1e49 learning Japanese,
ignore in the .gitignore file right after Author: Charly <charly@example.com> respectively.

4 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Prettyping and Asciiflow ANOTHER 10 TERRIFIC TOOLS

The sys admins daily grind:


Prettyping and Asciiflow

Block
Heroes
Transform boring ping data into colorful statistics. By Charly Khnast

One weapon for command-line using nocolor. Prettyping passes select boxes, lines, arrows, text, and
warriors is Prettyping [1], a shell on to ping any parameters that it so on, and then simply draw on the
script that wraps around the isnt familiar with. blank sheet using the mouse (Figure
ping command. It reads 2). Once you are happy with your
its tasks, keeps a re- work, you just press the export sym-
cord of run times and Everything <--|__ASCII__| bol and hey, presto the finished
packet losses, and ASCII graphic appears in your clip-
shows at the command If you read RFCs, you will occasion- board. Asciiflow also has an import
line in block graphics the aver- ally see small ASCII graphics that function. My verdict on it: \o/. n
age values since starting the show connections more compactly
tool and for the past 60 seconds than is possible with sentences. Au-
(Figure 1). thors typically painstakingly create Info
The script runs on any system with such charts with boxes and arrows [1] Prettyping:
Bash and Awk (i.e., also on OS X with ASCII symbols, such as plus [http://denilson.sa.nom.br/prettyping/]
and probably also in the new Linux and minus signs, (back-)slashes, and [2] Asciiflow: [http://asciiflow.com]
environment on Windows 10). Pret- pipes. Naturally, at some point, vari-
typing detects whether it is running ous ASCII graphic victims have writ-
in a terminal and how wide the ter- ten tools but none are as easy and
minal is, then scales the output ac- intuitive to use as Asciiflow [2].
cordingly. If you think the output is Asciiflow is a website that at first
a little too clownish, you can switch looks like a blank sheet of graph pa-
to a more staid monochrome display per. In a toolbar at the top, you can

Figure 2: A few boxes drawn in Asciiflow often say


Figure 1: Its a colorful world folks: Prettyping visualizing ping statistics in the terminal. more than a thousand words.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 5
ANOTHER 10 TERRIFIC TOOLS Dnstop

The sys admins daily grind: Dnstop

Save the Day


Monitor DNS traffic on your network. By Charly Khnast

Most distributions include dnstop. asking for .xyz domains but hey ho, In my short observation period, this
If you prefer to build it yourself, you if I press 2 or 3, I can extend the view was all of them, thankfully:
will find the source code online [1], to include the second and third levels.
but make sure you download and code Count %
build the matching Libpcap [2] first. Frequent and Rare
I launched the tool on the computer
hosting my DNS cache with the fol-
Resource Records Noerror 23987 100.0

lowing command: Pressing T takes you to another If I use dnstop for evaluations at
practical statistic. It shows you what work and then save them some-
dnstop l 3 eth0 resource record types are most fre- where I need to think about data
quently requested. It is unsurpris- protection. To avoid problems from
The l 3 parameter tells dnstop to ing to see requests for A (IPv4) and the outset, I tend to launch the tool
explore name requests up to the third AAAA records (IPv6) topping the with a for anonymize. Then, dn-
level. For a request like www.linux- list (Figure 2). Well back in the field, stop replaces the client IP addresses
magazine.com, com is the first or top- is the A6 record, which comes from with consecutive numbers, while
level domain, linux-magazine is thus the early days of IPv6 and is about as all the other evaluations work as
the second-level domain, and www is widespread as gas streetlamps today. expected. n
the third level. Other fairly sparsely represented re-
When I press the 1 button on a com- cords include DNSKEY, which come
puter running the command listed from DNSSEC (DNS Security). In con- Info
above, I can see which top-level trast to A6 IPv6, DNSSEC is increasing [1] Dnstop: [http://dns.measurementfactory.
domains are most frequently queried steadily but still not well established. com/tools/dnstop/]
(Figure 1). What I am interested in Pressing R (for Result) shows you [2] Libpcap: [https://github.com/
here is which device on my network is how many requests were successful. thetcpdumpgroup/libpcap]

Figure 1: Pressing the 1 key displays statistics with the requested top-level domains. Figure 2: Pressing T shows you the Resource Record overview. The A records
It comes as little surprise that .com tops the list, but who is looking for .xyz? typical of IPv4 have a two-thirds majority.

6 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
The Fuck ANOTHER 10 TERRIFIC TOOLS

The sys admins daily grind: The Fuck

Expletives
Not Deleted
Correct your command-line misspellings. By Charly Kuhnast

As early as 1998, Sean Dreil- actually or of course (slap


inger created the first statistics forehead). This alias saves me
on swear words in Linux [1]. profanity provides a relief much suppressed cursing after
It showed evidence of a sharp
increase of the word fuck in
denied even to prayer. forgetting to sudo.
However, The Fuck can do far
kernel 2.1.5. Vidar Holen [2] Mark Twain more; it can even prevent you
delved even deeper into the from shooting yourself in the
murky depths (Figure 1). He foot with more complex Git
found evidence of almost 50 inci- cd .. [enter/^/V/ctrl+c] commands. Ergo, the world needs
dences of fuck, many incidences much more of The Fuck to make it a
of shit, and even 180 incidences of and you just need to confirm by more polite place. n
bastard. pressing Enter. Of course, cd.. is a
How often Linus has raised a warn- very simple example. Many users
ing middle finger against hardware will already have created aliases for Info
vendors such as Nvidia is unfortu- these typical errors. Incidentally, my [1] Linux kernel fuck count:
nately unknown; however, contem- favorite alias is [http://durak.org/sean/pubs/kfc/]
porary historians have probably only [2] Linux kernel swear counts:
investigated the kernel mailing list alias doch='sudo $(history p !1)' [https://www.vidarholen.net/contents/
quantitatively. wordcount/]
where doch, in this case, roughly [3] The Fuck:
Damned Shell! translated into English, could mean [https://github.com/nvbn/thefuck]

Cursing has made its way out of the


kernel to other system components; a
good example of this in many ways is
The Fuck [3], a semi-automatic cor-
rection function for shell input. The
tool, written in Python 3 is installed
as follows:

sudo apt install python3 python3dev


git clone https://github.com/nvbn/thefuck
cd thefuck
sudo ./setup.py install

After installing, if you make a typing


error, such as forgetting the space
in cd .., you first see the standard
-bash: cd..: command not found.
However, if you then type fuck, The Figure 1: Kernel versions are shown on the x axis, and incidence of words on the y axis. Top to bottom: crap
Fuck suggests the correct command, (blue line), shit (green), penguin (teal), fuck (red), bastard (violet).

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 7
ANOTHER 10 TERRIFIC TOOLS testssl.sh

The sys admins daily grind: testssl.sh

A Key Role
A handy script for testing SSL certificates. By Charly Khnast

Web servers with SSL certificates will testssl P <address> the whole arsenal of test routines
likely be the rule. The administrators (Figure 1).
responsibility for keeping track of which Listing 2 shows the strongest en-
SSL and TLS settings are up to date on cryption method the server was able Aha
which servers tends to grow proportion- to negotiate. The script additionally
ally. I have found a trusty helper for this helps me discover whether the server Finally, a tip from the developer of
task, testssl.sh [1], a shell script with supports HTTP/2 with: testssl.sh: If you additionally install
many capabilities. For example, typing the aha [2] tool, you can easily con-
testssl.sh Y <address> vert the console output to HTML:
testssl U https://<server>
It might then respond with Ser- testssl.sh <address> | aha > U

runs scan tests for popular exploits vice detected: HTTP HTTP2/ALPN /<Path>/servertest.html
like Heartbleed, Poodle, and Crime http/1.1 (offered).
(see output in Listing 1), and I can The tests are not restricted to HTTPS. After wrapping this up in a small
trigger each test option individually. I can test a mail server like this: shell script, I can then use cron to
To discover whether a server is vul- check the TLS and SSL status of my
nerable for Logjam, I would just type: testssl.sh starttls smtp <address> servers on a weekly basis. n

testssl.sh logjam <address> which gives me an equally good


quality of analysis as for the web Info
To test whether the server offers protocol and it is very exhaustive [1] Testssl.sh:
its ciphers in a defined order (from in this case. If you dont specify any [https://github.com/drwetter/testssl.sh]
strong to weak), I type: parameters testssl.sh runs through [2] Aha: [https://github.com/theZiz/aha]

Listing 1: testssl U https://< server>


01 Service detected: HTTP
02 Testing vulnerabilities
03
04 Heartbleed (CVE20140160) not vulnerable (OK) (timed out)
05 CCS (CVE20140224) not vulnerable (OK)
06 Secure Renegotiation (CVE20093555) not vulnerable (OK)
07 Secure ClientInitiated Renegotiation not vulnerable (OK)
08 CRIME, TLS (CVE20124929) not vulnerable (OK)
09 [...]

Listing 2: testssl P <address>


01 Testing server preferences
02
03 Has server cipher order? yes (OK)
04 Negotiated protocol TLSv1.2
05 Negotiated cipher ECDHERSAAES256GCMSHA384, 256 bit ECDH
06 Cipher order
07 [A long list of ciphers offered]
Figure 1: Testssl.sh even checks mail server certificates.

8 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Socket Statistics ANOTHER 10 TERRIFIC TOOLS

The sys admins daily grind: socket statistics

Short Cut
A fast and easy tool for monitoring network stats. By Charly Khnast

A bunch of parameters control the socket. I need to use root privileges for
behavior of netstat. Administrators this; otherwise, p has no effect.
can also happily combine options so process is
that some netstat calls look like an Numbers, Please! on port 25. Logical
armadillo has rolled across the key- links are also okay:
board. With ss (like socket statistics), A further default is that ss translates
there is an even more specific tool the port numbers from the /etc/ser # ss t4 dport = :443 or dport = :80
for this purpose. It comes from the vices file into names. I can switch ESTAB 0 0 10.0.0.201:53389 10.0.0.118:http
iproute2 package [1] just like its sib- this off using n (for numeric). If I
lings bridge, rtacct, rtmon, tc, ctstat, want the tool to resolve the IP ad- ccze [2] sorted the coloration in
lnstat, nstat, routef, routel, rtstat, dresses concerned into names, I just Figure 1, but grc [3] or rainbow [4]
and ip. add an r. Using 4 and 6, I can limit would have managed it, too. n
Because a running Linux uses several it to one of the two TCP/IP versions.
hundred or more ports, ss comes with I find it useful to filter by source
plenty of filters. I mostly need the t (sport) and destination port (dport). Info
and u parameters, which restrict the For example, [1] Iproute2: [http://www.linuxfoundation.
results to TCP or UDP sockets. Other org/collaborate/workgroups/networking/
parameters limit the list to raw, Da- # ss natp6 sport = :25 iproute2]
tagram Congestion Control Protocol LISTEN 0 100 :::25 :::* U [2] Ccze: [http://freecode.com/projects/ccze/]
(DCCP), package, and Unix domain users:(("master",27452,13)) [3] Grc: [http://kassiopeia.juls.savba.sk/
sockets. ~garabik/software/grc.html]
Caution: The tool only displays TCP shows whether the mail server is [4] Rainbow:
sockets for existing connections by listening via IPv6 (yes) and which [https://github.com/nicoulaj/rainbow]
default (es
tablished or
close_wait). If I
also want to see
sockets in the
lists status as
I usually do I
have to type
ss ta. If I only
want the tool
to pay attention
to listening TCP
sockets and sup-
press all others,
I use ss lt. If
I add p here,
I can also see
which process
opened the Figure 1: The socket collector ss, color-supported here, too, provides a good overview.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 9
ANOTHER 10 TERRIFIC TOOLS ddrescue

The sys admins daily grind:


ddrescue and DDRescue-GUI

Recovery
Needed
Read errors wont deter this helpful data recovery tool. By Charly Khnast

Krrr, krrr ! At least things are creating an image with all the data that on my test Ubuntu using these three
clear-cut when a hard disk gives up can be accurately read. In the following steps:
the ghost: You toss the offending disk, example, /dev/sdd1 is a partition with
get a new one, and put the backup on read errors on a USB flash drive: sudo addaptrepository ppa:hamishmb/myppa
it. However, those undead data me- sudo aptget update
dia that trick people into continuing sudo ddrescue n /dev/sdd1 U sudo aptget install fym ddrescuegui
working on them with no idea of the /home/charly/stick.img logfile.log
potential impact are a real pain. As Figure 1 shows, the interface is
I recently determined that an SDHC The second, more time-consuming businesslike and functional. The
card in my camera saves one out of phase involves using the tool to sort GUI sets the important parameters,
20 images (on average) as a colorful through the faulty blocks and save as but not all of them by far. Although
mess of pixels. I do know that mem- much data from them as possible. The I hope no one will need to use
ory cards give up the ghost sooner or command is just the same as before, ddrescue permanently, the GUI is
later. However, I didnt realize that except you leave out the n parameter. nevertheless a real help. n
my camera could save to two cards In the wake of ddrescue, there is still
simultaneously a feature I stupidly an armada of other parameters that Info
didnt use. But, Im all the wiser now. control the tools behavior. [1] ddrescue:
What if really important data is There is also a GUI [2] that you can [http://www.gnu.org/software/ddrescue/]
stored on a haywire device that you use to make some quick, useful de- [2] DDRescue-GUI:
just cant get rid of? This is where fault settings. I installed it quickly [https://launchpad.net/ddrescuegui]
ddrescue [1] comes in. The tool is al-
ready quite ancient, but its developers
look after it untiringly and adapt it to
new types of data media. (It should
not be confused with the even older
dd_rescue.) Ddrescue is officially
named GNU ddrescue; the packages
on Debian and derivatives are there-
fore dubbed gddrescue.
The tool is included with many popu-
lar distributions. The first two letters
subtly indicate a relationship with dd,
and ddrescue actually generates a data
mediums or partitions image. Unlike
dd, however, it cant be stopped by read
errors; instead, it stubbornly saves ev-
erything that it can get its teeth into.

Two-Speed Transmission
Administrators usually use ddrescue in Figure 1: The genuinely helpful front end for ddrescue is DDRescue-GUI, which graphically implements the
two phases. The first phase involves important parameters.

10 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Keepalived ANOTHER 10 TERRIFIC TOOLS

The sys admins daily grind: Keepalived

Fit Without a
Pacemaker
Configure a floating IP address for failover. By Charly Khnast

Services without which nothing whereas the other only gets the IP if [2] Corosync:
works are clear candidates for dop- the master is down. The VRRP (Vir- [http://corosync.github.io/corosync/]
pelgngers on my network. If the tual Router Redundancy Protocol) is [3] Keepalived: [http://www.keepalived.org
master fails, or if I just need to shut used to swap states.
down the server for maintenance, To be able to bind services to an IP Listing 1: keepalived.conf
I want the service automatically to address that does not (yet) exist on 01 ! Configuration File for keepalived
start on the second server and to be the system, I need to make some 02
available on the same IP address as changes to /etc/sysctl.conf: 03 global_defs {
before, if possible. 04 notification_email {
To do this, the IP address needs to sudo echo "net.ipv4.ip_nonlocal_bind = U 05 charly@kuehnast.com
migrate quickly and without much 1" >> /etc/sysctl.conf 06 }
overhead to the backup machine. sudo sysctl p 07 notification_email_from ha_test@kuehnast.com
08 smtp_server localhost
Addresses like this are known as
09 smtp_connect_timeout 30
floating IPs. The migration helpers Now I can launch Keepalived by
10 }
here are Pacemaker [1] and Coro- typing:
11
sync [2]. These tools cant do much 12 vrrp_instance VI_1 {
more than facilitate the move, how- sudo service keepalived start 13 state MASTER
ever, so the solution seems a little 14 interface eth0
over the top for a simple failover The floating IP appears on the server 15 virtual_router_id 51
scenario. with the higher priority value. If I 16 priority 100
A more streamlined solution called shut down the master, I can see from 17 advert_int 1
Keepalived [3] is part of the default the Syslog on the secondary machine 18 authentication {
toolset in most distributions. I just that it quickly assumes the master 19 auth_type PASS
installed Keepalived and jumped in role (Figure 1). 20 auth_pass meinpasswort
feet first. What I found were two 21 }
servers with IP addresses 10.0.0.1 and 22 virtual_ipaddress {
23 10.0.0.100
10.0.0.2. My floating IP of choice is Info
24 }
10.0.0.100. [1] Pacemaker:
25 }
[http://clusterlabs.org/wiki/Pacemaker]
Minor Difference
The /etc/keepalived/keepalived.conf
configuration file looks like Listing 1.
It differs on the two machines only
in one aspect: the priority (line 16).
I need to configure a smaller num-
ber on one of the machines than on
the other to define the master. This Figure 1: A glance at the Syslog on the slave machine shows that it has become the master after a failure of
server gets the floating IP by default, the production machine.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 11
ANOTHER 10 TERRIFIC TOOLS paping

The sys admins daily grind paping

A Better ping
Use this connectivity checker when ping cant connect. By Charly Kuhnast

Hi there! Anybody home? Quite of- <no_of_checks>, I can define how of- apps? No way: The open source
ten, admins need to make sure that ten Paping checks out the target. tool has apparently reached the
at least the physical connection be- end of its design cycle no-
tween two computers is still up or Give Him a Break! body has touched the C++
back up. Obviously, ping is the tool code for two years, but that is
of choice when it comes to proving If you know that your target re- not surprising for such
or refuting accessibility. However, sides on a particularly slow or fast a simple tool.
there are cases in which a firewall line, you might want to tune the t If your Linux
blocks the ICMP ping. Anyone with a <timeout_in_msec> parameter; that is, distribution
modicum of knowledge can save the the time in which Paping abandons does not include
energy they would otherwise waste its task. Without the option, the tool Paping in its reposi-
cussing and instead type: throws in the towel after 1 second tories, you can grab the
(1,000ms). source or Linux version
nmap p <port> Purists who find the attractive built for 32- and 64-bit
output shown in Figure 1 too psy- systems [1].
Dont cheer too soon, though, be- chedelic, or cave dwellers sitting Firewall in the way during
cause often an intrusion prevention in front of terminals or dot matrix ping testing? I dont care! n
system blocks the Nmap signature of printers, can use the nocolor op-
the workaround. tion. This kicks Paping back into the
Paping [1] establishes a connection monochrome era. Info
to a configurable port and immedi- So, will Papings programmer Mike [1] Paping:
ately terminates it again. This works Lovell be building an API for Android [https://code.google.com/p/paping/]
almost anywhere. It measures the
round-trip time in milliseconds, just
like ping. The simplest form of the
call is very intuitive:

paping <target>

The tool can handle optional param-


eters, too (Figure 1); a typical call
looks like:

paping www.google.com p 80 c 4

The p parameter specifies theTCP


port to target 80 in this case
whichwill return the expected Figure 1: Paping pinging port 80 on Googles web server. No matter what lies in between, the web server will
results for a web server. By using c respond after an average of 48ms in this case.

12 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
httpstat ANOTHER 10 TERRIFIC TOOLS

The sys admins daily grind: httpstat

My Point of View
This simple tool wil help you discover how long a web server takes to serve up https:// for web pages secured with
TLS.
an HTML page. By Charly Khnast
Figure 1 shows httpstat measuring an
unencrypted call. Four milliseconds for
a DNS reply is a really good value, but I
Httpstat is a Python script that wraps If the Python installer pip is present cheated: The name of the site is cached
itself around cURL. Apart from Py- on your system, you also can pick up on my local Dnsmasq. As soon as my
thon 2 or 3 and cURL, it has no other the script and call it with: computer has to turn to my providers
dependencies. You can retrieve it from DNS, the value rises to 80-200ms. The
the GitHub repository and call it using: pip install httpstat TCP handshake is 22ms, which is about
httpstat <URL> par for the course.
wget https://raw.githubusercontent.com/ U The time the server needs to create the
reorx/httpstat/master/httpstat.py Although you can leave an http:// page (Server Processing) shows whether
python httpstat.py <URL> out of the URL, you cannot omit the web server has some tuning poten-
tial that I have not tapped. My example
is not representative, because instead
of HTML, the server simply outputs
301 Moved Permanently, which means
I should have called the page using
HTTPS. A browser would do that inde-
pendently, but not cURL.
Figure 2 requests the same page using
HTTPS. The lookup and TCP values re-
main the same, but the TLS Handshake
takes forever for this static page. The
value can go up to several seconds for a
big site with a large volume of dynamic
content and advertising banners.
Httpstat is not controllable using
command-line parameters because
Figure 1: The page that httpstat requests via HTTP, and receives quickly, is only an error message in reality. they would be fielded by cURL; how-
ever, you can influence the tool with
environment variables. The line

export HTTPSTAT_SHOW_SPEED=true

tells httpstat to show how quickly the


web page is delivered (e.g., speed_
download: 219.6 KiB/s, speed_upload:
0.0 KiB/s). The httpstat website [1]
explains all of the variables and has
links to the httpstat implementation
in Go, Bash, and PHP. n

Info
[1] httpstat:
Figure 2: When requested using HTTPS, the HTML page obviously takes longer to appear. [https://github.com/reorx/httpstat]

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 13
ANOTHER 10 TERRIFIC TOOLS Five Log Monitoring Tools

Five lean tools for monitoring logfiles

Small Supervisor
Anyone who wants to watch logfiles can use a
full-featured monitoring tool like Nagios; however,
a lightweight alternative also sniffs out threats
and takes much less time to set up. By Tim Schrmann

as LOGalyze [1], Logcheck [2], the Raspberry Pi, as well as on servers


Logwatch [3], MultiTail [4], and with few selected services.
A systems SwatchDog [5] can help you here. All candidates use one or more log-
logfiles not Unlike with large monitoring solutions files and filter out important messages
only record failed like Nagios and Icinga, the minor vari- according to predefined rules. As an
login attempts by users, ants focus on analyzing logfiles. They option, they can send the result by
but they also log program er- use fewer resources and can be set up email to the administrator or output
rors and information about attacks. much more quickly. They are there- it on the command line. Admins can
Admins therefore should keep a fore ideally suited for use on weak also add their own filter rules, usually
continuous eye on them. Tools such hardware and embedded devices like in the form of regular expressions.

Table 1: Tools for Logfile Monitoring


Name LOGalyze Logcheck Logwatch MultiTail SwatchDog
URL http://www.logalyze.com http://logcheck. https://sourceforge. https://www.vanheus- https://sourceforge.net/
alioth.debian.org net/projects/logwatch/ den.com/multitail/ projects/swatch/
Tested version 4.1.4 1.3.18 7.4.3 6.4.2 3.2.4
License GNU GPLv2 GNU GPLv2 MIT license GNU GPLv2 GNU GPLv2
Filtering / with yes / no yes / yes yes / no yes / yes yes / yes
regular expressions
Notification by email yes yes yes no (via external pro- yes
gram)
Permanent yes yes yes yes yes
monitoring of a log
Lead Image nlshop1, 123RF.com

Unique processing of no no yes no yes


a complete log
Information about no yes (limited) yes (limited) no no
security problems
Summary / statistics yes no yes no no
GUI yes no no no no

14 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Five Log Monitoring Tools ANOTHER 10 TERRIFIC TOOLS

critical errors, for example, in a con-


cise report (Figure 1).
Admins can also create their own
statistics and reports by clicking the
corresponding criteria in the user
interface. LOGalyze then generates
either a PDF or CSV file on this basis.
Admins can either download these
files or have them sent by email.
They can also search the logfiles
for terms. LOGalyze may not allow
regular expressions, but it does link
several search terms using operators
like AND and OR. It stores frequently
required search queries to allow
quick retrieval later via mouse click
(Figure 2). LOGalyze provides plenty
of predefined searches which, among
other things, quickly list all the errors
from the syslog.

Figure 1: LOGalyze displays statistics directly in the web interface as a pie, bar, or line chart. Here it is clear
Logcheck
that the number of events dropped in recent times.
The Debian project currently looks
Sometimes the developer provides be quickly booted using a prepared after Logcheck [2], which is available
a set of oft-needed rules. Powerful script. under GPLv2. It independently as-
tools may also put together a report Initially, administrators can create sesses logfiles for problems, security
about the state of the system and in- one or more collectors in the user vulnerabilities, and possible intrusion
dicate security problems. However, a interface. These collectors retrieve the attempts. After its started, Logcheck
comparison of the above candidates log data via the network or from a accesses the syslog and the auth.log
shows that these functions are not a file. Admins can switch each collector by default. However, you can use the
matter of course (Table 1). on or off individually. LOGalyze then tool on other logfiles.
generates statistics and reports from Logcheck compares all records added
LOGalyze the imported data and summarizes all since the last test with a load of pre-

LOGalyze [1] comes from the Hungar-


ian company Zuriel Ltd. The formerly
proprietary tool may now be available
under GPLv2, but the developers are
still keeping the source code under
lock and key. The latest version 4.1.4
was released in December 2016, but it
only fixes minor bugs from the almost
four-year-old previous version. LOGa-
lyze therefore still relies on Oracles
Java runtime environment in the
completely outdated version 1.6.
A short and concise guide in PDF
format provides a description of the
installation. Administrators can con-
figure LOGalyze using a supplied
web application that requires one of
the application servers Apache Tom-
cat, Jetty, GlassFish, or JBoss. The
hopelessly outdated Tomcat 6.0.35
from 2011 is included with the in-
stallation package; however, it can Figure 2: LOGalyze has found three events for the ubuntu computer.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 15
ANOTHER 10 TERRIFIC TOOLS Five Log Monitoring Tools

starts, it accesses all the logs known


to it and checks all the events from
the last 24 hours in them. Admins can
extend or shorten this observation pe-
riod at their discretion.
Unlike with the competitor Logcheck,
Logwatch generates a concise sum-
mary (Figures 5 and 6) from the read
events. A separate section is devoted
to each of the services running on the
system, and the information displayed
there is based on the respective ser-
vice. For example, Logwatch lists all
the packages installed in the past 24
hours for the package manager dpjk.
If Logwatch was unable to meaning-
fully interpret an event, the tool sim-
ply attaches this event to the report as
an attachment.
Figure 3: Ubuntu users can start Logcheck with the help of the logcheck user. The o parameter outputs The administrator informs Logwatch
the events in the terminal. The outputs can be quite confusing. about numerous configuration files,
about which services are running
set filtering rules. Depending on the imports all configuration files. The on the system, and about in which
result, the tool either moves directly developers kindly provide a package logfiles the services usually store
to the next entry or classifies it as an with several of these configuration their information. In turn, the con-
important system event, security is- files. However, the rules contained in figuration files are distributed across
sue, or warning. Logcheck then sends this Logcheck database only cover a several subdirectories. Logwatch
all the events from the last three few basic errors and particularly im- provides finished configuration files
categories in an email to the adminis- portant attack patterns. for many important and well-known
trator or writes them in the standard Most distributions have Logcheck in system services, and some distribu-
output (Figure 3). their repositories. On Debian systems, tors supplement them with additional
Administrators can choose between a cron job initiates Logcheck every services. Thanks to these specifica-
three filter levels to maintain an over- hour, and the attentive tool is auto- tions, Logwatch scours more logfiles
view: The highest, called paranoid, matically activated at every system immediately after the installation
is intended for particularly safety- startup. Any suitable command-line than its competitor Logcheck.
relevant systems with a few selected program assumes the responsibility A specialized Perl script analyzes a
services. In this filter level, Logcheck for sending emails the task is as- services logfiles. For example, the /
provides an especially large number signed to Sendmail by default. usr/share/logwatch/scripts/services/
of detailed messages that it would dpkg script processes the logfiles of the
discard in the other levels. The Server Logwatch package manager dpkg. If Logwatch
level is the default, and there are the Like Logcheck, Logwatch [3] is wait- is to analyze an individually compiled
least messages in the Workstation ing to be installed in the repositories service for the administrator, it needs
level. Logcheck sends warnings about of most major distributions. The tool to be able to write an evaluation script
security issues and attacks in each is available under the MIT license in Perl. A detailed how-to included
filter level. To ensure that the tool and requires Perl 5.8. Once Logwatch with Logwatch helps here.
only reports each system event once,
it remembers the last position in the
logfiles to be assessed with the help
of the Perl script Logtail.
All filter rules are available as regular
expressions, so that admins can add
their own, as desired (Figure 4). To
provide a better overview, all of the
expressions for a service, such as the
Apache web server, are moved to
a separate configuration file. When Figure 4: Among other things, in the Server filter level, Logcheck discards all the events that correspond to
started, Logcheck automatically these regular expressions in the /etc/logcheck/ignore.d.server/sudo file.

16 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Five Log Monitoring Tools ANOTHER 10 TERRIFIC TOOLS

features were added over the course


of time, in particular filter and moni-
toring functions for logfiles.
The admins can thus filter the flood
of information using regular expres-
sions. If a regular expression applies,
MultiTail launches an external pro-
gram upon request. You can be sent
email notifications, for example. Al-
ternatively, MultiTail works like a vi-
sual pipe in that it writes the filtered
information in files or forwards it to
other processes. MultiTail can even
act as a syslog server itself and accept
outputs from other programs upon
request such as netstat.
The tool also highlights the row con-
cerned and attracts attention via a
beeper. An admin can highlight indi-
vidual events in specific colors using
regular expressions. For example, you
can highlight in red all rows starting
with Error. MultiTail also automati-
cally converts inputs. It converts IP
addresses into the appropriate do-
main name, converts signal numbers
into names, and supplies each date in
the local format.
However, administrators need to set
up MultiTail completely on their own.
Unlike Logcheck or Logwatch, the
Figure 5: Logwatch can also generate the summary in text form tool does not have any pre-made reg-
ular expressions. Admins also need
The analysis scripts import the events MultiTail to manually configure the forwarding
from the logfiles, generate a sum- MultiTail [4] presents the ends of and sending of emails. MultiTail is
mary, and pass it on to Logwatch. Ul- several text files in only one (termi- included with all major distributions
timately, the tool sends the collected nal) window (Figure 7). Additional and is available under GPLv2. The
results in an email, writes them to
a file, or delivers them via stdout.
In the past, Logwatch presented all
information on a simple HTML page
upon request (Figure 6). The final
report also contains some system in-
formation, for example, the available
disk space.
Admins can also dictate the detail
of Logwatchs report. There are a
total of 10 detail levels available. The
individual evaluation scripts deter-
mine which (additional) information
each level of detail produces. The
distributions generally start Logwatch
via cron job once at night and send
the generated report via email. The
tool delegates the actual sending to
Sendmail or another, freely selectable
command-line program. Figure 6: or as a HTML file with rather small font.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 17
ANOTHER 10 TERRIFIC TOOLS Five Log Monitoring Tools

This configuration file uses Swatch-


Dogs own syntax Listing 1 shows
a simple example. According to the
instructions shown there, SwatchDog
needs to search for the keywords
warning and error. Administrators can
use a regular expression for specify-
ing the search pattern.
SwatchDog then performs all the ac-
tions that follow in the indented list.
For example, echo outputs the corre-
sponding line from the logfile on the
console, while mail sends the mes-
sage by email with the subject line
Error occurred to tim@example.com.
SwatchDog also calls any programs
(exec) and forwards the affected event
via pipe (pipe command). Perl experts
can store Perl code, which the tool
executes.
Figure 7: Admins can determine the order of the logfiles themselves in MultiTail. They just need to depict two Users start SwatchDog on the com-
logfiles one above the other. mand line by default. Administra-
tors need to create a suitable cron
Listing 1: Configuration File .swatchrc manufacturer. However, job or systemd units themselves.
01 watchfor /warning|error/ in most distributions, it Unlike with Logwatch, SwatchDog
02 echo is in the swatch package, does not provide an example con-
03 mail addresses=tim\@example.com, subject=error occurred
and the man page is the figuration. Users should therefore
only documentation. initially plan a bit of time to write a
tool also comes with a detailed man- The tool itself consists of a small Perl suitable configuration file.
ual in HTML format. script that assesses the logfiles stated
via parameter (Figure 8). Swatch- Learn to Love the Dog
SwatchDog Dog either goes through all the rows
contained in the files or continu- The choice of the appropriate tool
The Simple Log Watcher, Swatch for ously monitors the file. In the latter massively depends on the specific
short [5], began as a small watchdog case, SwatchDog can be started as a requirements and your personal pro-
tool that monitored a syslog for activi- daemon and thus move to the back- gramming skills. None of the five
ties. The program, which is available ground. Upon request, the tool also candidates can replace a full-scale
under GPLv2, now digests any logfiles. accepts log data via a pipe. monitoring system, let alone an intru-
Formally, the command-line tool is In any case, you can specify in a con- sion detection system. In any case,
called SwatchDog to avoid any confu- figuration file for which events the administrators need to interpret the
sion with a well-known Swiss watch tool needs to perform which actions. sent system events themselves. See
the Old Comrades box for some
other alternatives.
LOGalyze provides a GUI and can
also be remotely operated via your
browser. However, anyone who wants
to use the tool should remember
the tools age. The supplied Tomcat
version also needs to be replaced as
quickly as possible. Admins also need
to be able to figure out for themselves
how to use LOGalyze.
Logcheck can be put into operation
particularly quickly. Anyone who
masters regular expressions can re-
duce the flood of data using quickly
Figure 8: SwatchDog checks the whole /var/logs/auth.log file once here based on the examine parameter. added and customized filtering rules.

18 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Five Log Monitoring Tools ANOTHER 10 TERRIFIC TOOLS

While Logcheck only sends the na- services using Logwatch, they need an eye on several logfiles and only
ked events to the admin, Logwatch Perl scripts. want to trigger actions in certain
provides the admin with a summary. MultiTail is worthwhile for admin- cases. Sending emails and forward-
If admins want to monitor their own istrators who literally want to keep ing filtered events may be possible;
however, to do so admins need to
write suitable regular expressions
and manually configure MultiTail.
The tool is therefore useful as a very
good supplement to Logcheck and
Logwatch.
Finally, SwatchDog is comparable to
Logwatch: It can be set up quickly
but requires knowledge of regular
expressions. Additionally, it only re-
ports individual events specified by
the administrator. n

Info
Figure 9: As this diagram of Petit shows, a lot of events were entered in the first five minutes of the log recording. [1] LOGalyze: [http://www.logalyze.com]
[2] Logcheck:
Old Comrades [http://logcheck.alioth.debian.org]
Anyone searching the Internet for other Petit [8] is about the same age, but it is still [3] Logwatch: [https://sourceforge.net/
alternatives to the featured tools will auto- in the repositories of Ubuntu. The tool uses projects/logwatch/]
matically stumble upon a few representatives language analysis methods to curb the flood [4] MultiTail:
that are now obsolete. The Logdigest [6] of data, especially in system logs. This allows [https://www.vanheusden.com/multitail/]
tool works like Logcheck, but has been on administrators to, for example, list all words [5] SwatchDog:
ice since 2009. LogSurfer [7] is pretty that occur particularly frequently in a logfile. In [https://sourceforge.net/projects/swatch/]
similar to SwatchDog, but can also group addition, the tool draws a graph that presents [6] Logdigest: [https://sourceforge.net/
similar events. In addition, LogSurfer is the number of messages in a given period of projects/logdigest/]
written in C and should therefore work time (Figure 9). The hash function, which keeps
[7] LogSurfer:
much more quickly. However, the most track of similar messages in the log, is also
[http://www.crypt.gen.nz/logsurfer/]
recent version of the tool was released in interesting. It allows the viewer to immediately
September 2011. see which errors occur most frequently. [8] Petit:
[http://crunchtools.com/software/petit/]
ANOTHER 10 TERRIFIC TOOLS Web Analytics Tools

Traffic analysis tools for websites

Data for Breakfast


If you are looking for an alternative to Google Analytics, try a free ticle looks at Piwik, Open Web Analyt-
ics [7], and eAnalytics [8] (Table 1).
alternative such as Piwik, Open Web Analytics, or eAnalytics. From a technical point of view, the
By Ferdinand Thommes web analytics tools either prepare
web server logfiles, or special tags
Admins who wanted details of the Good to Know integrated into the HTML web pages
visitors to their websites in the early giving the admin statistics and graph-
years of the Internet had to labori- Site operators are often interested in ics for a quick overview and access to
ously read the web servers logs. The where the visitors come from, what all necessary key indicators. Although
first log file analysis applications ap- they are looking for, what items they the server-based method analyzes the
peared 20 years ago. Analog [1], We- click on, and how long they remain logfiles of the web server, developers
balizer [2] and AWStats [3], which on the site. It can also be useful to of the client-based variant add tracking
date from this period, are still occa- know when they leave the site. Ad- pixels into the source code of the web
sionally in use (see the Simple Web mins want to know what browsers page to determine the key indicators.
Analytics Tools box). and operating systems visitors to the Although none of the two methods fully
In 2005, Google launched Google site use, which files and documents represents the actual traffic of a website,
Analytics (GA) [4], a website analy- they download and with what band- the client-based system of counting pix-
sis service that is hugely popular width, and how many visitors sub- els, combined with the controversial use
today. Open source tools such as scribe to newsletters or RSS feeds. of cookies, is currently just about win-
Piwik [5] picked up on this trend Web shop operators are interested ning the accuracy stakes.
towards graphical web analytics, but in how many visitors add goods to
moved its focus to the customers their shopping carts, to then purchase Privacy Issues
own server. them, or possibly not. If a website
With the help of web analytics, site hosts advertising for third parties, Because they evaluate cookies and
operators collect and evaluate data web analysis is essential, because ac- store the visitors IP addresses, web
on the surfing habits of their visi- cess figures and similar factors deter- analytics tools always face a difficult
tors. The access data are of interest mine the prices for advertisers. legal situation. For example, Germa-
not only for commercial reasons; nys Telemedia Act (TMG) [9] allows
the companies behind the sites also Open Access you to create user profiles if the user
often seek to better understand their does not object to the purposes of
Lead Image bowie15, 123RF.com

customers and their interests. The The market offers many different web advertising and market research. Such
following applies: The closer an op- analytics tools. They include around a profile is only allowed to contain an
erator knows the visitors and their 150 commercial, typically proprietary anonymized IP address in addition to
preferences, the better the operator applications, aimed at larger corporate the data on the use of the website. IP
can optimize its offerings to suit the websites. There are also some free and addresses are typically automatically
target group. partly also open source tools. This ar- truncated to this end.

20 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Web Analytics Tools ANOTHER 10 TERRIFIC TOOLS

Simple Web Analytics Tools which was launched in 2005, and


which 50 percent of all websites
Many system administrators are quite happy active development. The script, implemented employ. It is clearly the top dog. In
with the simpler, resource-friendly log evalua- entirely in Perl, uses logfile analysis on web, contrast to the applications covered in
tions provided by statistics tools. mail, and FTP servers to produce its reports this article, the data collected by GA
The oldest open source tools include Analog as HTML pages. Simple bar charts graphically leaves users computers and heads to
developed in 1995 and Webalizer first released enhance the results.
the United States, where data protec-
in 1997. Both applications are still regularly GoAccess [6] (Figure 1) gives the admin the
tion provisions are not as stringent as
updated today. The tools evaluate the logs ability to output and continuously update anal-
in Germany and the rest of Europe.
several times a day, when run by the admin or yses in real time in a terminal or in a browser.
For example, GA delivers the un-
a cron job. AWStats is also a simple analysis GoAccess can handle virtually any log format
abridged IP address to the parent com-
program. It has generated statistics about used by Apache, Nginx, Amazon S3, Elastic
pany. Also, the website visitor may not
web page visits since 2000 and is still under Load Balancing, CloudFront, and others.
necessarily be informed of the fact that
Google is collecting its data. Browser
add-ons like Ghostery or NoScript can
disable GA [10] to provide protection
against unwanted data collection. GA
doesnt cost anything up to a traffic
volume of 10 million hits a month, but
it only delivers certain data following
a 24-hour delay. Also, the user has to
agree to Googles using the data for its
own purposes.

Piwik
Piwik (Figure 2) is growing in popu-
larity around the world. Users have
downloaded the cross-platform inde-
pendent, open source program, which
is written in PHP, almost three million
times since 2008. Fans of GA will
most likely find the functions they are
familiar with from Google in Piwik,
Figure 1: GoAccess demo application in the browser. Site visitors are offered an opt-out
in an IFrame, and Piwik respects the
The TMG also requires the service must have an option to object to the browsers Do Not Track feature.
provider to inform the user in a pri- creation of user profiles. Piwik collects data with tracking pix-
vacy statement on the website of Probably the most controversial and els, JavaScript, log analysis, and cook-
whether, to what extent, and for what at the same time most successful tool ies, and stores these in a MySQL da-
purpose it processes the IP address. for website traffic analysis pages is tabase. Access is via a web interface.
And, the TMG stipulates that users the Google Analytics online service, The latest version, 3.0.1, introduces a

Table 1: Three Web Statistics Tools at a Glance


Piwik Open Web Analytics (OWA) eAnalytics
Platforms Cross-Platform Cross-Platform Debian/Ubuntu
License GPLv3 and others GPLv2 AGPLv3
Under development since 2009 2009 2011
Language PHP PHP Java and others
Methods JavaScript tags, log analysis, tracking pixels JavaScript tags, log analysis, tracking pixels eAnalytics tag, tracking pixels
Functions Visitors (visitors, unique visitors), Visitors (visitors, unique visitors), operating Visitors (visitors, unique visitors),
operating system, browser version, system, downloads, browser version, IP operating system, downloads,
downloads, IP address (pseudonymization address, geo location by country, page browser version, IP address
capable), geolocation by city, page impressions, referrer, heat maps (pseudonymization capable, can be
impressions, referrer, plugins switched off), geolocation by city,
page impressions, referrer, plugins

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 21
ANOTHER 10 TERRIFIC TOOLS Web Analytics Tools

new user interface on the basis of Ma- information on the countries of origin thus ensures data protection. There
terial Design and Angular 1.4. Piwik is and the browsers and operating systems are also corresponding apps for the
available under the GPLv3, but partly used. Referrers tell the operator which iOS and Android platform. Last but
also under the BSD license. website sent a visitor to their offering. not least, users will find a detailed
The tool relies on plugins to implement list of features with in-depth expla-
Data Collection its functions; you can add or remove nations [11] on the project website.
these as needed. Piwik supports real- Admins can use plugins to extend the
Piwik Web Analytics collects relevant time updates, shows developments already abundant wealth of features
data such as visitor counts, keywords, and trends, offers campaign and target that Piwik comes with out the box.
referrers, and much more. This data tracking for online stores, and is multi- A recent addition is the premium pl-
tool prepares the data in a graphically client capable for multiple websites. ugins, of which the project recently
appealing way and delivers the results Thanks to the configurable dashboard, presented three [12]. Admins need
in the form of reports. These include admins can manage all their sites at to store Piwik software on the server
statistics on page views and unique a glance. A tool for aliasing the IP ad- and then install the system in a
visits. The visitor analysis also provides dresses is also part of the package and browser. If needed, you can integrate

Figure 2: Piwik is the best known and functionally the most similar open source alternative to Google Analytics.

Figure 3: Piwik can be combined with various web applications, for example, WordPress.

22 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Web Analytics Tools ANOTHER 10 TERRIFIC TOOLS

Figure 4: You can try out Open Web Analytics with the aid of an online demo.

Piwik via enhancements in WordPress Open Web Analytics competitors need to load as exten-
(Figure 3), MediaWiki, Magento, sions. They help admins analyze
Joomla, vBulletin, and more than 60 Under development since 2009, Open mouse movements on web pages.
other applications. Web Analytics (OWA) is not as well OWA uses a PHP front end with a
A demo version is available [13] on known as Piwik, but it keeps pace MySQL back end and collects statis-
the project website. Piwik Pro sees with Piwik and GA in terms of its tics by integrating a JavaScript into
the application run in the cloud [14]. feature set, even outpacing them in the target site (Figure 5). Admins
Piwik is under active development places (Figure 4). For example, it can evaluate the results using Ja-
and has a fairly lively community. offers integrated heat maps, which vaScript, but also directly via PHP
ANOTHER 10 TERRIFIC TOOLS Web Analytics Tools

or REST-based APIs. OWA supports eAnalytics eAnalytics preconfigures 10 dash-


WordPress or MediaWiki pages, and a boards that can be extended using
third-party extension exists for Drupal. eAnalytics (Figure 6) is not well widgets. At the same time, it offers
The OWA framework is released un- known internationally, but is popular 55 interactive reports. You can install
der the GPLv2 license and is also suit- in Germany. The analysis tool, re- version 1.1.3 directly on the server as
able for campaign and e-commerce leased by Integrated Analytics GmbH a Debian package; the current version
tracking. Users can define reports and five years ago as open source, is de- is optimized for Ubuntu 14.04. Source
dashboards that go beyond the stan- signed for medium-sized enterprises. code is available on SourceForge, but
dard selection to suit their needs. The It seeks to make the technologies only for the older version 0.9.2 [17].
application lets you integrate vari- used in large-scale companies afford- eAnalytics collects data with a JavaS-
ous web pages, which the OWA user able for firms with fewer resources. cript tool named eAnalytics Tag [18],
can aggregate or view individually. The focus is on merging data. eAna- which the server operator needs to
It handles many administrative tasks lytics seeks to meaningfully link data additionally integrate [19]. One ad-
directly at the command line of the from web analytics with enterprise vantage of the web analytics software
server instead of in the browser. data from CRM systems, data min- is that admins can distribute it to sev-
The integrated event queuing is a ing and warehousing, and marketing eral machines in environments with
unique feature among the applica- systems. many servers. For example, you can
tions presented here. If the database The company offers support and man- set up a separate server for the Tags
cannot process peak visiting times aged services for eAnalytics and will component. You can explore eAnalyt-
quickly enough, it first writes the data build enterprise-specific extensions if ics upfront via a VMware image [20].
to a simple logfile (Flat File Based necessary. eAnalytics provides a simple
Event Queuing, [15]) and then parses user opt-out like Piwik. At the same Conclusions
it via a PHP call: time, it honors Do Not Track requests
from the browser. IP addresses can be Fundamentally, the tools examined
/path/to/php5 cli.php cmd=processEventQueue pseudonymized in the configuration or here Piwik, OWA, and eAnalytics
not collected in the first place. do approximately the same thing as
Piwik offers a similar function in the The software is released under the GA. Given appropriate hardware, the
form of Queued Tracking [16], which AGPLv3 license. Data from the tags of candidates can be used for websites
was added in the form of a plugin in the page, external data from Google with several million page views a
2015. But, in this case, the software AdWords, a proprietary Twitter exten- day. The clear advantage is that all
writes its data to a Redis instance rather sion, and company-specific data serve three keep the data on your own serv-
than directly to a classic database. as the data sources. ers. This makes it easy for admins to

Figure 5: OWA collects statistics on referrers as shown here by integrating JavaScript into the landing page.

24 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I W W W. A D M I N - M AGA Z I N E .CO M
Web Analytics Tools ANOTHER 10 TERRIFIC TOOLS

comply with European data protection two other candidates. Although both [11] Piwik features:
regulations. published their latest versions in the [http://piwik.org/features/]
Whether hosting locally is an ad- last twelve months, growth is far [12] Premium plugins:
vantage or a disadvantage for you more restrained all told, and there are [https://piwik.org/blog/2016/11/premium
is something you have to decide for fewer developers on board. If you are pluginsnowavailablemarketplace/]
yourself. But if you want to install, interested in the integration of the ac- [13] Piwik demo: [http://demo.piwik.org]
update, and maintain the applica- quired data with your business data, [14] Piwik hosting: [http://piwik.org/hosting/]
tions yourself, you will need powerful eAnalytics is the obvious choice; [15] Event queuing: [http://www.
hardware in contrast to a scenario however, this unfortunately means openwebanalytics.com/?cat=9&paged=3]
with GA. Piwik and eAnalytics, at doing without access to the source [16] Queued tracking: [https://plugins.piwik.
least, offer supervised hosting. code for the current versions. n org/QueuedTracking]
If you completely reject GA, but do not [17] eAnalytics on SourceForge:
have sufficiently powerful hardware Info [https://sourceforge.net/projects/
for the mainline programs featured [1] Analog: [https://en.wikipedia.org/wiki/ eanalytics/]
here, you can turn as an alternative to Analog_(program)] [18] eAnalytics Tag:
lean logfile analysis programs such as [2] Webalizer: [http://www.webalizer.org] [http://eanalytics.de/resources/
AWStats, Webalizer, or Analog. These [3] AWStats: [http://www.awstats.org] download/eanalyticsdownload.html]
may not provide the same wealth of [4] Google Analytics: [19] Tagging Guide: [http://eanalytics.de/
information as the analytic applica- [https://analytics.google.com] uploads/media/eAnalytics_Page_Tag-
tions, but they do still prepare the data [5] Piwik: [https://piwik.org] ging_Guide_english_V1_7.pdf]
in a clear-cut and graphically appeal- [6] GoAccess: [https://goaccess.io] [20] VMware image:
ing way. They are fine if you only need [7] Open Web Analytics: [http://eanalytics.de/resources/
an approximate overview. [http://openwebanalytics.com] download/eanalyticsdownload.html]
Piwik has the edge in terms of popu- [8] eAnalytics: [http://eanalytics.de]
larity, dissemination, and developer [9] Telemedia Act (in German): [http://www. Author
community, which improves reliabil- gesetzeiminternet.de/tmg/__15.html] Ferdinand Thommes lives and works as a
ity and allows for long-term planning. [10] Google Analytics opt-out: [https://tools. Linux developer, freelance writer, and tour
The situation is not so clear with the google.com/dlpage/gaoptout] guide in Berlin.

Figure 6: eAnalytics is open source software from Germany. The figure shows the default view; the latest version of the software is available as a package for Ubuntu 14.04.

W W W. A D M I N - M AGA Z I N E .CO M 1 0 T E R R I F I C TO O L S FO R T H E B U SY A D M I N : 20 1 7 E D I T I O N S P O N S O R E D BY L P I 25

Potrebbero piacerti anche