## This is an exemplary documentation file that mainly serves as a syntax explanation. ## For a list of available options and checks, please refer to `man autosuspend.conf` or the online documentation. [general] interval = 300 idle_time = 900 suspend_cmd = /usr/bin/systemctl suspend wakeup_cmd = sh -c 'echo 0 > /sys/class/rtc/rtc0/wakealarm && echo {timestamp:.0f} > /sys/class/rtc/rtc0/wakealarm' woke_up_file = /var/run/autosuspend-just-woke-up lock_file = /var/lock/autosuspend.lock lock_timeout = 30 # Can be used to call a command before suspending, either with scheduled wake up or not. # notify_cmd_wakeup = su myuser -c notify-send -a autosuspend 'Suspending the system. Wake up at {iso}' # notify_cmd_no_wakeup = su myuser -c notify-send -a autosuspend 'Suspending the system.' # Basic activity check configuration. # The check class name is derived from the section header (Ping in this case). # Remember to enable desired checks. They are disabled by default. [check.Ping] enabled = true hosts = 192.168.1.4,192.168.1.92,192.168.1.93,192.168.1.19 # Checks whether there is currently a client connected to a TCP server at certain$ # Can be used to e.g. block suspending the system in case SSH users are connected # or a web server is used by clients. [check.ActiveConnection] enabled = true ports = 22,8096,10000 # Executes an arbitrary command. In case this command returns 0, the system is assumed to be active. # The command is executed as is using shell execution. Beware of malicious commands in obtained configuration files. [check.ExternalCommand] enabled = true command = netstat -ntaup | egrep -i 'VERBUNDEN' | egrep -i '(8096|8000|10000|2317)'|exit 0 # Checks whether more network bandwidth is currently being used than specified. # A set of specified interfaces is checked in this regard, each of the individual$ # based on the average bandwidth on that interface. [check.NetworkBandwidth] enabled = true interfaces = enp3s0 threshold_send = 10485760 threshold_receive = 4194304 # Any active Samba connection will block suspend. [check.Smb] enabled = false # Example for a custom check name. # This will use the Users check with the custom name RemoteUsers. # Custom names are necessary in case a check class is used multiple times. # Custom names can also be used for clarification. [check.RemoteUsers] class = Users enabled = true name = .* terminal = .* host = [0-9].* # Here the Users activity check is used again with different settings and a different name [check.LocalUsers] class = Users enabled = true name = .* terminal = .* host = localhost # Checks to determine the next scheduled wakeup are prefixed with 'wakeup'. [wakeup.Calendar] enabled = true url = file:///opt/autosuspend/etc/autosuspend.ics # Checks an online iCalendar file for events that are currently running. [check.ActiveCalendarEvent] enabled = true url = file:///opt/autosuspend/etc/autosuspend.ics # A generic check which queries a configured URL and expects the reply to contain JSON data. # The returned JSON document is checked against a configured JSONPath expression and # in case the expression matches, the system is assumed to be active. [check.Emby] class = JsonPath enabled = true url = http://192.168.1.41:8096/Sessions?api_key=e98245f3db7c4150ab06e7a5b041e1aa jsonpath = $.[*].NowPlayingItem.Id # A generic check which queries a configured URL and expects the reply to contain$ # The returned XML document is checked against a configured XPath expression and # in case the expression matches, the system is assumed to be active. [check.Tvheadend] class = XPath enabled = true url = http://192.168.1.41:9981/status.xml # xpath = /currentload/subscriptions[number(.) > 1] | /currentload/recordings/recording/start | /currentload/recordings/recording/next[number(.) < 10] xpath = /currentload/recordings/recording/status | /currentload/recordings/recording/start | /currentload/recordings/recording/next[number(.) < 10] username = kodi password = kodi # Comparable to XPath, but expects that the returned results represent the # wake up time as a delta to the current time in a configurable unit. [wakeup.XPathDelta] enabled = true url = http://192.168.1.41:9981/status.xml xpath = //recording/next/text() # xpath = /currentload/recordings/recording/next/text() # xpath = //recording/next/text() # xpath = /currentload/recordings/recording/text() # or xpath = /recording/next/text() ???? username = kodi password = kodi