In Linux, there are many tools to get information from a network. From some more complex as others less. However, knowing about these tools is important to use them in any situation. In this post, we present you with a tool that helps to obtain basic information about a network. This tool is called Darkstat.
Darkstat is a tool for obtaining basic information from a computer network. Especially, if this is a local type. It is quite simple to use because it does not have many features. After all, that is not the main objective of the application.
With Darkstat you can get some information about the connected computers, as well as their IP and MAC addresses. Also, you can get graphs showing network activity and traffic in and out of the network.
Install Darkstat on Debian, Ubuntu, and derivates
Being a fairly small and useful tool, it is found in the Debian, Ubuntu and derivative repositories such as Linux Mint or ElementaryOS.
So to install it, just open a terminal and run the following command:
:~$ sudo apt install darkstat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
darkstat
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 60.0 kB of archives.
After this operation, 172 kB of additional disk space will be used.
Get:1 http://mirrors.advancedhosters.com/ubuntu bionic/universe amd64 darkstat amd64 3.0.719-1build1 [60.0 kB]
Fetched 60.0 kB in 3s (23.1 kB/s)
Preconfiguring packages ...
Selecting previously unselected package darkstat.
(Reading database ... 102680 files and directories currently installed.)
Preparing to unpack .../darkstat_3.0.719-1build1_amd64.deb ...
Unpacking darkstat (3.0.719-1build1) ...
Setting up darkstat (3.0.719-1build1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.39) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Darkstat, as well as many other applications, are handled as a system service to be started. In the case of Debian, this is already done during the installation, but it is convenient to know that using systemctl you can start, restart or stop the service.
Getting the basic information about a network with Darkstat
The first thing to do is to take a look at the application configuration file. This file is /etc/darkstat/init.cfg
and has a structure like the following:
:~$ sudo nano /etc/darkstat/init.cfg
# Turn this to yes when you have configured the options below.
START_DARKSTAT=no
# Don't forget to read the man page.
# You must set this option, else darkstat may not listen to
# the interface you want
INTERFACE="-i eth0"
#DIR="/var/lib/darkstat"
#PORT="-p 666"
#BINDIP="-b 127.0.0.1"
#LOCAL="-l 192.168.0.0/255.255.255.0"
# File will be relative to $DIR:
#DAYLOG="--daylog darkstat.log"
# Don't reverse resolve IPs to host names
#DNS="--no-dns"
#FILTER="not (src net 192.168.0 and dst net 192.168.0)"
# Additional command line Arguments:
# OPTIONS="--syslog --no-macs"
This file has to be modified a little before starting to work.
First of all, for all the settings in this file to be interpreted, this line must be changed:
START_DARKSTAT=no
For this one:
START_DARKSTAT=yes
Next, the network interface to be monitored must be established. That is to say, which is the network interface through which the information will be obtained.
In my case, the network interface is enp0s3
and not eth0
. Then that line would look like this:
INTERFACE="-i enp0s3"
Next, we need to establish a port for Darkstat. For the time being, I will leave 666 as the default. Of course, you can change this, but make sure you open this port in the firewall.
PORT="-p 666"
And to be accessible from a local network, you have to tell it the IP address of the host where Darkstat is installed.
LOCAL="-l 192.168.250.13/255.255.255.0"
Then, the file would look like this:
So, save the changes and close the file.
Restart the Darkstat service to apply the changes. And check the service status.
:~$ sudo systemctl restart darkstat :~$ sudo systemctl status darkstat ● darkstat.service - LSB: start darkstat monitoring system at boot time Loaded: loaded (/etc/init.d/darkstat; generated) Active: active (exited) since Thu 2020-04-16 14:21:30 UTC; 5min ago Docs: man:systemd-sysv-generator(8) Tasks: 0 (limit: 767) CGroup: /system.slice/darkstat.service Apr 16 14:21:29 osradar systemd[1]: Starting LSB: start darkstat monitoring system at boot time… Apr 16 14:21:30 osradar darkstat[2315]: * please change the value of START_DARKSTAT in /etc/darkstat/init.cfg, in order to start darkstat Apr 16 14:21:30 osradar systemd[1]: Started LSB: start darkstat monitoring system at boot time.
Then open your web browser and go to the IP address of the computer where Darkstat is installed followed by the port. In my case it’s
http://192.168.250.13:666
And you will see the following image:
If you go to the host tab, you will see much more information about the network.
So you can get some information about the network and host on your local network thanks to Darkstat.
A fairly simple application but one that can be useful at some point.
Conclusion
Sometimes we are in a network and we need some information about it or the connected nodes. This information is not necessarily complex and then installing other more complex applications is not necessarily the best solution.
So today with Darkstat you can have basic and simple information in a fast way.
Please share this post and join our Telegram channel.
It is not autorun after boot. Could you check please?
It keeps failing to start at boot……