-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring
The default path for ntfy-resources-usage configuration file is located in /usr/bin/ntfy-resources-usage.
If it does not exist there, try to reinstall ntfy-resources-usage or create a new config file manually with the parameters below.
Ultimately, you can also try to edit the script itself, which path is by default /usr/bin/ntfy-resources-usage. If not there, you can also locate it by executing whereis ntfy-resources-usage.
Note that editing the script is not recommended and /etc/ntfy-resources-usage/ntfy-resources-usage.conf will overwrite the parameters.
Editing requires root access, which can be achieved by appending sudo or doas at the start of the editing command or logging as root.
DEVICE_NAME is a variable containing the name of your computer which will be sent in the title of the notification. By default, it contains the hostname of your device using the hostname command, $(hostname).
DEVICE_NAME="DEVICE"NTFY_TOPIC is a variable containing the URI to the ntfy server. By default, it comes with the official server domain, with no topic. Putting a topic is required to send notifications. See how to create a topic in the usage page.
NTFY_TOPIC="ntfy.sh/notification_topic"NTFY_PRIORITY is a variable containing the priority level the notifications will be sent. The user can set the app to not get disturbed at a sepecific priority. A lower priority may not distrub the user while a higher level will do.
Levels:
| CODENAME | min |
low |
default |
high |
urgent/max
|
|---|---|---|---|---|---|
| DETAIL | Lowest | Low | Medium | High | Highest |
Lowest level is min and highest is urgent or max.
NTFY_PRIORITY="low"RAM_TITLE is a variable containing the title ntfy-resources-usage should send to ntfy.sh when running out of memory. By default, it contains the name of the device and a "Running out of memory" message.
RAM_TITLE="$DEVICE_NAME: Running out of memory"DISK_TITLE is a variable containing the title ntfy-resources-usage should send to ntfy.sh when running out of storage. By default, it contains the name of the device and a "Running out of memory" message.
DISK_TITLE="$DEVICE_NAME: Running out of storage"RAM_MSG is a variable containing the message ntfy-resources-usage should send to ntfy.sh when running out of memory. By default, it contains the name of the device and a "is running out of memory: " which will be folowed by "[free memory] out of [total memory]"
RAM_MSG="$DEVICE_NAME is running out of memory: "DISK_MSG is a variable containing the message ntfy-resources-usage should send to ntfy.sh when running out of storage. By default, it contains the name of the device and a "is running out of storage: " which will be folowed by "[free storage] out of [total storage]"
DISK_MSG="$DEVICE_NAME is running out of storage: "MIN_RAM_RATIO is a variable containing the minimum ratio of free memory out of total memory ntfy-resources-usage needs to send a notification. When the ratio ntfy-resources-usage calculated is lower then MIN_RAM_RATIO, ntfy-resources-usage will send a warning.
The ratio value can be set between 1 and 100.
MIN_RAM_RATIO="20"MIN_DISK_RATIO is a variable containing the minimum ratio of free storage out of total storage ntfy-resources-usage needs to send a notification. When the ratio ntfy-resources-usage calculated is lower then MIN_DISK_RATIO, ntfy-resources-usage will send a warning.
The ratio value can be set between 1 and 100.
MIN_DISK_RATIO="20"DELAY_TIME is a variable containing the delay time between resources checks.
A higher value means a higher wait time between checks and if too high, the plugin may not report at a convenient time.
A lower time means a lower wait time between checks and if too low, the plugin may report too much notifications, leading to ping spam and server abuse.
The time is calculated in seconds, but with the power of math, typing only the minutes can be easily approached.
Whatever your choice, don't forget to comment and uncomment the necessary variables, or you may end up rewriting unwanted values to the variables. Comments are lines starting with '#'. Removing the '#' will uncomment the line.
DELAY_TIME="$((5 * 60))" # for minutes
## minutes----^ ^---1 minute in seconds #
## 5 times 60 equals 300
#DELAY_TIME="300" # use only seconds
## seconds-^ #DEBUG is a variable containing a true/false boolean for whether to print debug info or not.
By default it comes commented. If you want to print debug info, uncomment by removing the '#' before 'DEBUG'
DEBUG="true"For details on how to use ntfy-resources-usage, see the usage wiki page.