Skip to content

mateusjdev/network-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Check

A lightweight Go-based utility designed for Linux servers to monitor network interface IP changes and verify internet connectivity. It provides notifications via your Terminal or Telegram.


Features

  • IP Monitoring: Detects changes in IP addresses in network interfaces.
  • Connectivity Validation: Verifies internet access for each specific interface address.
  • Telegram Integration: Supports remote alerts via Telegram bot (Token & Chat ID).
  • Cross-Platform: Easily build for various architectures using the included Taskfile.

Installation & Setup

1. Configuration

The program requires a configuration file located at a specific path. Create and edit the following file:

Path: /usr/local/etc/network-check.toml

Example Configuration:

interface = "eth0" # Linux network interface.

[connection]
domains = [ "google.com" ] # Domain wich will be pinged to check network connectivity.

[dns] # This will check if one of the domain ip match a interface IP.
domains = [ "mydomain.com" ]
interval = 3600 # Each run checks if this interval has passed from last check, if not, dns check will be ignored.

[log.telegram] # Telegram notification, remove to ignore
token = "token"
chatId = 0123456789

2. Building the Project

This project uses Task to manage builds. You can compile the binary for your specific architecture using the following commands:

Target Platform Command
Linux (64-bit) task build-linux-amd64
Linux (ARM) task build-linux-arm
Windows (64-bit) task build-windows-amd64

Usage

Once configured and built, run the binary:

./network-check

The application will check your interfaces. If an IP change is detected and the domain IP address is not in the interface address, an alert will be sent to your terminal output and your Telegram chat.


Requirements

  • Go (1.21 or higher recommended)
  • Task (for running build scripts)
  • Linux/Windows environment

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Languages