Collects sensors with statuses: down, down (acknowleged), down (partial), or unknown and can be further filtered with exclusion groups. This data will be formatted into an Opsgenie alert so it can be viewed inside a Slack channel via the Opsgenie/Slack integration. If the script errors out, it will notify specified Slack channels.
Note: If you have any questions or comments you can always use GitHub discussions, or email me at farinaanthony96@gmail.com.
This script is ideal for a daily checkup before production hours begin. This enables our team to tackle any issues that crop up with customer devices before our customer's day begins. That way, we ensure device reliability, stability, and efficiency for our customers.
- Python 3.12+
- loguru
- python-dotenv
- requests
-
Environment variables need to be set to specify Opsgenie API token, Opsgenie team IDs/user IDs/escalation IDs/schedule IDs/title/tags for the alert, PRTG access, PRTG exclusion substrings for probes/groups/devices/sensors, logger configurations, Slack access, and Slack channel IDs for errors.
-
Simply run the script using Python:
python PRTG_Offline_Sensor_Reporter.py
Should be able to run on any machine with a Python interpreter. This script was only tested on a Windows machine running Python 3.12.2.
The code provided in this project is an open source example and should not be treated as an officially supported product. Use at your own risk. If you encounter any problems, please log an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request ツ
-
version 1.0.1 - 2024/05/10
- Fixed Slack error output bug
- Fixed incorrect name for log files
- Corrected Slack API token
- Support new location for Slack API token
-
version 1.0.0 - 2024/05/06
- (initial public release)
- Script has internally existed for about 2 years
Anthony Farina <farinaanthony96@gmail.com>