How To Install iwatch on Debian 10

Learn how to install iwatch on Debian 10 with this tutorial. iwatch is realtime filesystem monitoring program using inotify

Introduction

In this tutorial we learn how to install iwatch on Debian 10.

What is iwatch

iwatch is:

inotify (inode notify) is a Linux kernel subsystem that monitors events in filesystems and reports those events to applications in real time.

inotify can be used to monitor individual files or directories. When a directory is monitored, inotify will return events for the directory itself and for files inside the directory.

iWatch is a Perl wrap to inotify to monitor changes in specific directories or files, sending alarm to the system administrator (or other destination) in real time. It can:

  • Send notifications via email about changes.
  • Take programmable actions immediately, as emit alerts via XMPP (jabber) messengers, WhatsApp or execute a local program or script.
  • Act as HIDS (Host-based Intrusion Detection System) or an integrity checker, complementing the firewall system in networks and improving the security.

iWatch can run as a simple command, as well a daemon.

A good example of iWatch usage is to monitor the pages directory in webservers to notify, in real time, about defacements or file insertions. Other example is to synchronize configuration files between machines, when they are changed, as in DHCP servers acting in failover mode. You also use to synchronize files, via rsync when these files are changed.

There are three methods to install iwatch on Debian 10. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install iwatch Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install iwatch using apt-get by running the following command:

sudo apt-get -y install iwatch

Install iwatch Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install iwatch using apt by running the following command:

sudo apt -y install iwatch

Install iwatch Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install iwatch using aptitude by running the following command:

sudo aptitude -y install iwatch

How To Uninstall iwatch on Debian 10

To uninstall only the iwatch package we can use the following command:

sudo apt-get remove iwatch

Uninstall iwatch And Its Dependencies

To uninstall iwatch and its dependencies that are no longer needed by Debian 10, we can use the command below:

sudo apt-get -y autoremove iwatch

Remove iwatch Configurations and Data

To remove iwatch configuration and data from Debian 10 we can use the following command:

sudo apt-get -y purge iwatch

Remove iwatch configuration, data, and all of its dependencies

We can use the following command to remove iwatch configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge iwatch

Dependencies

iwatch have the following dependencies:

References

Summary

In this tutorial we learn how to install iwatch package on Debian 10 using different package management tools: apt, apt-get and aptitude.