<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Folder Size Monitoring in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231672#M3788</link>
    <description>&lt;P&gt;I see the issue now, unfortunately user error. Thank you for your assistance here! All good now, seems to be accurate.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 20:48:10 GMT</pubDate>
    <dc:creator>sivart_89</dc:creator>
    <dc:date>2023-12-12T20:48:10Z</dc:date>
    <item>
      <title>Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231499#M3782</link>
      <description>&lt;P&gt;I am looking to monitor the size of a folder, is this possible today with dynatrace, via a provided extension or does anyone know if this is coming down? The extension below monitors the size of files, it doesn't seem to work for folders.&lt;/P&gt;&lt;P&gt;Is the direction here to create a custom extension ourselves? If so we will wait for when the python datasource is available. Will this then let us write any code in python to have it ran via the extension? I saw an old post (few years old) where it was noted to use an extension but wanted to confirm this is still the case.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sivart_89_0-1702313017445.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16119i823730ECBF798C31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sivart_89_0-1702313017445.png" alt="sivart_89_0-1702313017445.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 16:47:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231499#M3782</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2023-12-11T16:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231528#M3783</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/17361"&gt;@sivart_89&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;yes, you should use the extension&amp;nbsp;&lt;A href="https://www.dynatrace.com/hub/detail/filesystem-monitoring-extension-v2/" target="_blank"&gt;https://www.dynatrace.com/hub/detail/filesystem-monitoring-extension-v2/&lt;/A&gt;&amp;nbsp;and install it directly from your environment. For size of a directory (file size) you can use the size check and use the directory. If you need it recursively, use double asterisk. So like /data/* (just for files in /data) or /data/** (files in /data/ and recursively).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 07:39:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231528#M3783</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-12-12T07:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231606#M3784</link>
      <description>&lt;P&gt;Have you been able to get this to work? And I don't mean simply having a datapoint show, is it actually accurate? I have the configuration below. When running the command below I get a result of&amp;nbsp;40K. Makes sense that there is a value &amp;gt; 0 since we do have the custom.python.generic_command extension deployed there. However, dynatrace plots a datapoint of 0 B.&lt;/P&gt;&lt;P&gt;For the heck of it I also changed the config to use&amp;nbsp;/opt/dynatrace/oneagent/plugin_deployment/ (trailing /), same result.&lt;/P&gt;&lt;P&gt;du -sh /opt/dynatrace/oneagent/plugin_deployment&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sivart_89_0-1702389740314.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16154i6B4867DFCABFEF01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sivart_89_0-1702389740314.png" alt="sivart_89_0-1702389740314.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:09:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231606#M3784</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2023-12-12T14:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231654#M3785</link>
      <description>&lt;P&gt;The extension only calculates file sizes within directories, not directory sizes (du command ), so the value with du will never match exactly with the output of "du -s". It does not run the du command and it must have access to those directories - just a reminder.&lt;BR /&gt;&lt;BR /&gt;In your case you should add the asterisks (wildchars), the extension assumes the path is a file and you don't have any.&amp;nbsp; So you should&amp;nbsp; reconfigure the path to be&amp;nbsp;&lt;SPAN&gt;/opt/dynatrace/oneagent/plugin_deployment/** to sum the size of all files recursively in your directory.&lt;BR /&gt;&lt;BR /&gt;In my case just a simple demo to showcase this is working:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# find /tmp/data -type f -exec ls -l {} \;
-rw-r--r-- 1 root root 1048576 dec 12 18:20 /tmp/data/data1
-rw-r--r-- 1 root root 10485760 dec 12 18:21 /tmp/data/subdir/data3
-rw-r--r-- 1 root root 1048576 dec 12 18:21 /tmp/data/data2

# du -sb /tmp/data
12591104        /tmp/data&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julius_Loman_0-1702402846799.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16165i9DD198587714C0AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julius_Loman_0-1702402846799.png" alt="Julius_Loman_0-1702402846799.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, be sure not to scan large volumes or limit it to run it in meaningful intervals.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 17:47:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231654#M3785</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-12-12T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231659#M3786</link>
      <description>&lt;P&gt;Apologies&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt; I should have picked up on that with your last post. I had du on my mind instead of recursively looking at the files and adding them up.&lt;/P&gt;&lt;P&gt;So let's say I have the 4 files below showing the size when doing a ls -lh. When looking in data explorer I see a value of .007 MB which doesn't make much sense to me. Doesn't the M represent MB as well? If so why would dynatrace be showing &amp;lt; 1 MB when there is a file that is 6 plus another &amp;gt; 2. For this test all the files are in the same directory with no folders so I am only doing a '&amp;lt;path&amp;gt;\*' type config (instead of **)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sivart_89_0-1702404700103.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16166i0EC0DCB670F4E8D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sivart_89_0-1702404700103.png" alt="sivart_89_0-1702404700103.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 18:17:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231659#M3786</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2023-12-12T18:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231661#M3787</link>
      <description>&lt;P&gt;This can be for various reasons. Are you really having the path correct? Does OneAgent access to read the directory and file sizes (if there are subdirs).&lt;BR /&gt;&lt;BR /&gt;Anyway, the extension calculates it this way (for my previous example):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pathlib import Path
import glob

sum_sizes = 0
path="/tmp/data/**"
for f in glob.glob(path, recursive=True):
    print(f)
    try:
        if Path(f).is_file():
            sum_sizes += Path(f).stat().st_size
    except Exception as e:
        print(f"Could not get size for {f}: {e}")

print(sum_sizes)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 18:20:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231661#M3787</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-12-12T18:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Folder Size Monitoring</title>
      <link>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231672#M3788</link>
      <description>&lt;P&gt;I see the issue now, unfortunately user error. Thank you for your assistance here! All good now, seems to be accurate.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 20:48:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Folder-Size-Monitoring/m-p/231672#M3788</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2023-12-12T20:48:10Z</dc:date>
    </item>
  </channel>
</rss>

