Discord-Notifier-unRAID-Network
This write up is to add the ability for discordnotifier.com to monitor your docker containers to know if they are running as well as to see if your server is still accessible by the internet. This script will send a ping on predetermined intervals, if discordnotifier does not receive a signal w/in 15 minutes it will start pinging your discord channel every 15 minutes until a new single resets it.
In order for this to work you'll need to have python3 installed on your server
- First we need to install NerdPack to install python3
- Navigate to the AppStore on your unRAID server, type in the search box NerdPack and install
- Once NerdPack is installed you'll be able to access it through unRAID's settings package
- Now that you're in NerdPack's settings type in the search box python
- Select the toggle to install and click Apply
Since unRAID loads everything up into memory and if we install any extras needed for this to run it will only run for that one instance of the server running, if you reboot your server you'll have to manually reinstall any required packages
Now we need to install **Requirements**
- If you do not already have CA Custom Scripts navigate to the unRAID's AppStore and install just the same as NerdPack
- The options for Custom Scripts can be found under unRAID's settings page as well
- Now we need to install requirements
- Click on Custom Scripts
- Click new script
- Copy and paste this text into the new page
#!/bin/bash python3.8 -m pip install requests
- Click Apply
- Click run script
- On the drop down box to the right select the option to have this script run on first array start up
Now lets install the actual python3 script that will communicate to discordnotifier.com
- Open Customer Scripts again
- Select new script
- Copy and paste this code into the new page
settings = { 'api':'API KEY
', # discordnotifier.com api key 'radarr_api':'API KEY
', # API key for Radarr, found in Settings > General 'radarr_hostname':'Server IP
', # Ex: localhost or 10.1.0.2, this is the hostname for Radarr 'radarr_port':'7878', 'sonarr_api':'API KEY
', # API key for Sonarr, found in Settings > General 'sonarr_hostname':'Server IP
', # Ex: localhost or 10.1.0.3, this is the hostname for Sonarr 'sonarr_port':'8989', 'bazarr_hostname':'Server IP
', # Ex: localhost or 10.1.0.4, this is the hostname for Bazarr 'bazarr_port':'6767', 'self_upcheck_hostname':'Network Notifier', # Ex: plex, this is the name you want to see in the notification 'network_upcheck_hostname':'Optional', # Ex: plex,10.1.0.1|radarr,10.1.0.2|sonarr,10.1.0.3 }
- Edit the variables as needed to meet the requirements of your server
- Click Apply
- Now we need to run this script on a set schedule with chron
- On the drop down box for schedule select Custom
- Copy and paste the chron schedule below into the field provided
*/5 * * * * This will run the script every 5 minutes
- Click run script to make sure everything is working properlly