NDSN is an application designed to monitor the status of devices on the network. When the device status changes, you can be notified via your Telegram bot. In addition, NDSN logs events to a csv file, which allows you to analyze past events using tools such as: pandas, MS Excel, LibreOffice Calc and others.
-
You need to create a Telegram Bot. Link to official Telegram documentation How Do I Create a Bot?. In the main.py you need to insert your unique telegram bot token (line 14) and your chat id (line 15). This is necessary for the application to be able to send a message to the Telegram bot and this message will be displayed only to the unique user with the specified chat id.
-
You need to make changes to the devices.py. This file consists of a dictionary whose key is the device's IP address and whose value is another dictionary that contains information about the device's name and location.
Each time after adding a new device to the devices.py you need to restart the program if it is currently running.
-
For the application to work correctly you need to install dependencies from the file requirements.txt
To do this, you need to execute the command:
python3 -m pip install -r requirements.txt
After starting the application you will see in the terminal a list of online and a list of offline ip-addresses of devices from the devices.py at the moment of program start.
In the future, you will receive a notification from the Telegram Bot when the status of your device changes.
Now the ping_log.csv file has appeared in the root folder of the project. We can look at the changes that were added to this file using python and pandas.
By default, events for the last 5 days from the current date are displayed. You can specify your own value "days", to do this you need to execute:
python3 log_list_to_html.py --days=n
Where n - is the count of days from the current date for which you want to receive the report.
Example: