how to modify the 85% threshold filesystem notification?

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • how to modify the 85% threshold filesystem notification?

      hi, maybe someone can help.

      i have every 30sec these two entries in syslog:

      Source Code

      1. monit[1001]: 'filesystem_srv_dev-disk-by-label-parity1' space usage 86.4% matches resource limit [space usage>85.0%]
      2. monit[1001]: 'filesystem_srv_dev-disk-by-label-data1' space usage 85.9% matches resource limit [space usage>85.0

      trying to modify monit i found here some help

      gderf wrote:

      The default behavior is for OMV to notify once used disk space reaches 80% of capacity. Many find this value too low and the frequent notifications annoying.

      To raise the notification threshold above the default 80% value, to 95% for example, perform the following:

      As the root user, edit the file: /etc/default/openmediavault and add the following line (or change it to the value you want if it already exists):

      OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE=95

      Run the following commands as root in the shell:

      For OMV 2.x:
      /etc/init.d/openmediavault-engined restart
      omv-mkconf monit
      /etc/init.d/monit restart

      For OMV 3.x and higher:
      omv-mkconf collectd
      monit restart collectd

      i did this for omv 3.0 and checked in syslog that monit did a restart,
      but still getting the same entries in log.
      only this time it changed to monit[1008].

      would be great if someone can help
      thnx
    • thank you, i will try.
      this is the whole content of the file openmediavault. did not find any error, so just retyped the last line, in case there was an error..

      Source Code

      1. # This file is part of OpenMediaVault.
      2. #
      3. # @license http://www.gnu.org/licenses/gpl.html GPL Version 3
      4. # @author Volker Theile <volker.theile@openmediavault.org>
      5. # @copyright Copyright (c) 2009-2018 Volker Theile
      6. #
      7. # OpenMediaVault is free software: you can redistribute it and/or modify
      8. # it under the terms of the GNU General Public License as published by
      9. # the Free Software Foundation, either version 3 of the License, or
      10. # any later version.
      11. #
      12. # OpenMediaVault is distributed in the hope that it will be useful,
      13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
      14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      15. # GNU General Public License for more details.
      16. #
      17. # You should have received a copy of the GNU General Public License
      18. # along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
      19. # Global default values. Please restart the openmediavault-engined systemd
      20. # service to take changes into affect.
      21. OMV_CONFIG_FILE="/etc/openmediavault/config.xml"
      22. OMV_CONFIG_TEMPLATE_FILE="/usr/share/openmediavault/templates/config.xml"
      23. OMV_PRODUCTINFO_FILE="/usr/share/openmediavault/productinfo.xml"
      24. OMV_SCRIPTS_DIR="/usr/share/openmediavault/scripts"
      25. OMV_DATAMODELS_DIR="/usr/share/openmediavault/datamodels"
      26. OMV_I18N_LOCALE_DIR="/usr/share/openmediavault/locale"
      27. OMV_MOUNT_DIR="/srv"
      28. OMV_SHAREDFOLDERS_DIR="/sharedfolders"
      29. OMV_NFSD_EXPORT_DIR="/export"
      30. OMV_CACHE_DIR="/var/cache/openmediavault"
      31. OMV_LOG_DIR="/var/log/openmediavault"
      32. OMV_SSL_CERTIFICATE_DIR="/etc/ssl"
      33. OMV_SSL_CERTIFICATE_PREFIX="openmediavault-"
      34. OMV_SSH_KEYS_DIR="/etc/ssh"
      35. OMV_SSH_KEY_PREFIX="openmediavault-"
      36. OMV_DPKGARCHIVE_DIR="/var/cache/openmediavault/archives"
      37. OMV_DOCUMENTROOT_DIR="/var/www/openmediavault"
      38. OMV_CRONSCRIPTS_DIR="/var/lib/openmediavault/cron.d"
      39. OMV_CONFIGIMPORT_SCRIPTS_DIR="/usr/share/openmediavault/configimport"
      40. OMV_MKCONF_SCRIPTS_DIR="/usr/share/openmediavault/mkconf"
      41. OMV_ENGINED_DIR="/usr/share/openmediavault/engined"
      42. OMV_ENGINED_SO_ADDRESS="/var/lib/openmediavault/engined.sock"
      43. OMV_ENGINED_SO_OWNERGROUP_NAME="openmediavault-engined"
      44. OMV_ENGINED_SO_SNDTIMEO=10
      45. OMV_ENGINED_SO_RCVTIMEO=180
      46. OMV_ENGINED_DIRTY_MODULES_FILE="/var/lib/openmediavault/dirtymodules.json"
      47. OMV_INITSYSTEM_SCRIPTS_DIR="/usr/share/openmediavault/initsystem"
      48. OMV_INITSYSTEM_FILE="/var/lib/openmediavault/initsystem.req"
      49. OMV_USERMGMT_DEFAULT_GROUP="users"
      50. OMV_RRDGRAPH_DIR="/var/lib/openmediavault/rrd"
      51. OMV_RRDGRAPH_ERROR_IMAGE="/usr/share/openmediavault/icons/rrd_graph_error_64.png"
      52. OMV_WEBGUI_FILE_OWNERGROUP_NAME="openmediavault-webgui"
      53. OMV_CONFIGOBJECT_NEW_UUID="fa4b1c66-ef79-11e5-87a0-0002b3a176b4"
      54. OMV_DEBUG_SCRIPT="NO"
      55. OMV_DEBUG_PHP="NO"
      56. OMV_DEBUG_EXTJS="NO"
      57. OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE=95
      Display All
      executed
      omv-mkconf collectd
      and
      monit restart collectd"


      log:

      Source Code

      1. Feb 21 23:46:28 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-data1' space usage 85.9% matches resource limit [space usage>85.0%]
      2. Feb 21 23:46:28 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-parity1' space usage 86.4% matches resource limit [space usage>85.0%]
      3. Feb 21 23:46:58 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-data1' space usage 85.9% matches resource limit [space usage>85.0%]
      4. Feb 21 23:46:58 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-parity1' space usage 86.4% matches resource limit [space usage>85.0%]
      5. Feb 21 23:47:21 HomeNAS monit[1008]: 'collectd' restart on user request
      6. Feb 21 23:47:21 HomeNAS monit[1008]: Monit daemon with PID 1008 awakened
      7. Feb 21 23:47:21 HomeNAS monit[1008]: Awakened by User defined signal 1
      8. Feb 21 23:47:21 HomeNAS monit[1008]: 'collectd' trying to restart
      9. Feb 21 23:47:21 HomeNAS monit[1008]: 'collectd' stop: '/bin/systemctl stop collectd'
      10. Feb 21 23:47:21 HomeNAS collectd[5866]: Exiting normally.
      11. Feb 21 23:47:21 HomeNAS systemd[1]: Stopping Statistics collection and monitoring daemon...
      12. Feb 21 23:47:21 HomeNAS collectd[5866]: collectd: Stopping 5 read threads.
      13. Feb 21 23:47:21 HomeNAS collectd[5866]: collectd: Stopping 5 write threads.
      14. Feb 21 23:47:21 HomeNAS systemd[1]: Stopped Statistics collection and monitoring daemon.
      15. Feb 21 23:47:21 HomeNAS monit[1008]: 'collectd' start: '/bin/systemctl start collectd'
      16. Feb 21 23:47:21 HomeNAS systemd[1]: Starting Statistics collection and monitoring daemon...
      17. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "cpu" successfully loaded.
      18. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "df" successfully loaded.
      19. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "interface" successfully loaded.
      20. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "load" successfully loaded.
      21. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "memory" successfully loaded.
      22. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "rrdcached" successfully loaded.
      23. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "syslog" successfully loaded.
      24. Feb 21 23:47:21 HomeNAS collectd[21870]: plugin_load: plugin "unixsock" successfully loaded.
      25. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "cpu" successfully loaded.
      26. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "df" successfully loaded.
      27. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "interface" successfully loaded.
      28. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "load" successfully loaded.
      29. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "memory" successfully loaded.
      30. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "rrdcached" successfully loaded.
      31. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "syslog" successfully loaded.
      32. Feb 21 23:47:21 HomeNAS collectd[21873]: plugin_load: plugin "unixsock" successfully loaded.
      33. Feb 21 23:47:21 HomeNAS collectd[21873]: Systemd detected, trying to signal readyness.
      34. Feb 21 23:47:21 HomeNAS systemd[1]: Started Statistics collection and monitoring daemon.
      35. Feb 21 23:47:21 HomeNAS collectd[21873]: Initialization complete, entering read-loop.
      36. Feb 21 23:47:22 HomeNAS monit[1008]: 'collectd' restart action done
      37. Feb 21 23:47:22 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-data1' space usage 85.9% matches resource limit [space usage>85.0%]
      38. Feb 21 23:47:22 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-parity1' space usage 86.4% matches resource limit [space usage>85.0%]
      39. Feb 21 23:47:52 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-data1' space usage 85.9% matches resource limit [space usage>85.0%]
      40. Feb 21 23:47:52 HomeNAS monit[1008]: 'filesystem_srv_dev-disk-by-label-parity1' space usage 86.4% matches resource limit [space usage>85.0%]
      Display All

      still the same.

      btw now i see.. 1008 is the process id :whistling: didnt knew that before

      is there now way to check the value, like a global var ..or something like that.
    • I do not know what or where OMV does with the changed value. The only other suggestion I have is to reboot.

      OMV 3.x is no longer supported, so it's possible that something was changed that made the fix I suggested non-working, and no longer using OMV 3 myself I would not have noticed.
      --
      Google is your friend and Bob's your uncle!

      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • me too. i'm using version 4.1.19
      08/2018 : fresh 4.x omv install on debian to get system patition work on nvram, so no upgrade from older omv

      i just tried the fix for 3.0 cause didnt found any newer.


      after checking all references in /etc/default/openmediavault
      found this in /usr/share/openmediavault/mkconf/monit.d/filesystem

      Shell-Script

      1. #!/bin/sh
      2. #
      3. # This file is part of OpenMediaVault.
      4. #
      5. # @license http://www.gnu.org/licenses/gpl.html GPL Version 3
      6. # @author Volker Theile <volker.theile@openmediavault.org>
      7. # @copyright Copyright (c) 2009-2018 Volker Theile
      8. #
      9. # OpenMediaVault is free software: you can redistribute it and/or modify
      10. # it under the terms of the GNU General Public License as published by
      11. # the Free Software Foundation, either version 3 of the License, or
      12. # any later version.
      13. #
      14. # OpenMediaVault is distributed in the hope that it will be useful,
      15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
      16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      17. # GNU General Public License for more details.
      18. #
      19. # You should have received a copy of the GNU General Public License
      20. # along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
      21. set -e
      22. . /etc/default/openmediavault
      23. . /usr/share/openmediavault/scripts/helper-functions
      24. OMV_MONIT_SERVICE_FILESYSTEM_CONFIG=${OMV_MONIT_SERVICE_FILESYSTEM_CONFIG:-"/etc/monit/conf.d/openmediavault-filesystem.conf"}
      25. OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE=${OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE:-"85"}
      26. if [ "$(omv_config_get "//system/notification/notifications/notification[id='monitfilesystems']/enable")" = "1" ]; then
      27. # Monitor root filesystem.
      28. cat <<EOF > ${OMV_MONIT_SERVICE_FILESYSTEM_CONFIG}
      29. # Alert if disk space of root filesystem gets low
      30. check filesystem rootfs with path /
      31. if space usage > ${OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE}% for 5 times within 15 cycles
      32. then alert else if succeeded for 10 cycles then alert
      33. EOF
      34. # Monitor mounted filesystems.
      35. xmlstarlet sel -t \
      36. -m "//system/fstab/mntent[not(contains(opts,'bind') or contains(opts,'loop'))]" \
      37. -v "uuid" -n \
      38. -b \
      39. ${OMV_CONFIG_FILE} | xmlstarlet unesc |
      40. while read uuid; do
      41. # Get the mount point of the filesystem.
      42. dir=$(omv_config_get "//system/fstab/mntent[uuid='${uuid}']/dir")
      43. # Generate a unique identifier.
      44. checkid=$(echo "${dir}" | tr "/ :" "_")
      45. # Note, do not monitor the filesystem space usage for various
      46. # types like ISO9660 and UDF because for those filesystems the
      47. # usage is always reported as 100% by the 'df' command.
      48. xmlstarlet sel -t -m "//system/fstab/mntent[uuid='${uuid}']" \
      49. -o "check filesystem filesystem${checkid} with path \"${dir}\"" -n \
      50. -i "type[.!='iso9660' and .!='udf']" \
      51. -o " if space usage > ${OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE}% for 5 times within 15 cycles" -n \
      52. -o " then alert else if succeeded for 10 cycles then alert" -n \
      53. -n \
      54. -b \
      55. -o "check program mountpoint${checkid} with path \"/bin/mountpoint '${dir}'\"" -n \
      56. -o " if status != 0 then alert" -n \
      57. ${OMV_CONFIG_FILE} | xmlstarlet unesc >> ${OMV_MONIT_SERVICE_FILESYSTEM_CONFIG}
      58. done
      59. fi
      Display All

      which is probably to make this config file: /etc/monit/conf.d/openmediavault-filesystem.conf
      but if i look in that.. its still the old one with 85 entries for any drive, and the date is that from installation 08/2018


      how do i proceed, to update this conf file? i will look for that..
      --
      i'm still a rookie, so i m sorry, if any of this is too obvious for a linux pro
    • ok.. found it. with
      monit summary
      i can as well see the drives

      Source Code

      1. ...
      2. │ rootfs │ Accessible │ Filesystem │
      3. ├─────────────────────────────────┼────────────────────────────┼───────────────┤
      4. │ filesystem_srv_dev-disk-by-l... │ Resource limit matched │ Filesystem │
      5. ├─────────────────────────────────┼────────────────────────────┼───────────────┤
      6. │ filesystem_srv_dev-disk-by-l... │ Accessible │ Filesystem │
      7. ├─────────────────────────────────┼────────────────────────────┼───────────────┤
      8. │ filesystem_srv_dev-disk-by-l... │ Accessible │ Filesystem │
      9. ├─────────────────────────────────┼────────────────────────────┼───────────────┤
      10. │ filesystem_srv_dev-disk-by-l... │ Resource limit matched │ Filesystem │
      11. ...
      Display All
      monit status
      does it more detailed, but thats not necessary.

      what works is now:
      still place
      OMV_MONIT_SERVICE_FILESYSTEM_SPACEUSAGE=95
      in /etc/default/openmediavault
      and

      For OMV 4.x and higher:
      omv-mkconf monit
      monit reload

      thank you for the support, gderf. sometimes i need a little push. I appreciate that.
    • Users Online 1

      1 Guest