Ad Widget

Collapse

How can I monitor file count of subfolders at Linux?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CtnDev
    Junior Member
    • Sep 2021
    • 3

    #1

    How can I monitor file count of subfolders at Linux?

    Hello Dear Community,
    I would like to monitor file count under subfolders.

    Checked couple of guides, but what I see I can monitor only single path not the path recursively(subfolders).
    One of guide is this : https://www.meinekleinefarm.net/zabb...unt-for-linux/
    It has good explanation but I'm looking much smarter way.

    My folder structure may change from server to server.

    Example paths
    x server :
    /opt/path/foo/failed/
    /opt/path/bar/cooked/

    y server :
    /opt/path/bar/failed/
    /opt/path/some/raw/

    I want to have file count under those folders.
    /opt/path is constant.

    Thanks for helping
  • Ivo Palli
    Junior Member
    • Jul 2021
    • 13

    #2
    Put this in a crontab:
    Code:
    /usr/local/bin/zabbix_sender -z zabbix_server -s my_host -k my_item -o "$(find /opt/path -type f | wc -l)"
    or put the find command in a system.run[xxx]

    Comment

    Working...