File Activity Plugin - How can I figure out what keeps spinning up my disks?


dlandon

Recommended Posts

3 hours ago, karateo said:

I use latest Unraid and latest File Activity plugin.

 

I set settings to Yes, No, No and apply,

but it doesn't show anything in file activity tab.

I tried to open a movie, browse folder but it doesn't show anything there.

Any idea of what I should try?

I have the same problem.
I've tried different browsers but nothing is showing on the array for file activity
I'm not using the cache for any shares.

Kevin.

Link to comment

You may not have any shares on the cache, but that doesn't mean the files aren't temporarily on the cache until moved at night by the mover.

Go to the Tools->Processes and look for a line that starts like this:

inotifywait -m -r -q -e open,attrib,move,create,delete --excludei appdata/...

Copy the complete line and post it here so I can verify inotify is running as it should on your system.  Also tell me how many disks you have in your system.

Edited by dlandon
Link to comment
47 minutes ago, dlandon said:

You may not have any shares on the cache, but that doesn't mean the files aren't temporarily on the cache until moved at night by the mover.

Go to the Tools->Processes and look for a line that starts like this:


inotifywait -m -r -q -e open,attrib,move,create,delete --excludei appdata/...

Copy the complete line and post it here so I can verify inotify is running as it should on your system.  Also tell me how many disks you have in your system.

I have no line like that in Tools->Processes.
Plugin is showing as running.
Array has 16 drives including 2 parity.

I have also tried stopping and restarting it. Still no inotifywait line.

58ac2e3739a44_ScreenShot2017-02-21at12_06_43pm.thumb.png.6693091d288750a18590c612d3cb750f.png58ac2e53c05cb_ScreenShot2017-02-21at12_07_37pm.thumb.png.2cdf8c5f0b6e754c4a9f7c6fda9fa0bc.png
 

Kevin.

Edited by digitalfixer
Link to comment

inotify did not start.  Look in your syslog and on the console and see if there is an error message about inotify not starting.  Also try to stop and re-start and see if it is then shown in the processes.

How many disks are in your array?

Edited by dlandon
Link to comment

I don't have a screen attached to my server so no console.
I have theses 2 lines twice in my syslog

 

Feb 19 13:05:34 Tower inotifywait[22253]: Failed to watch /mnt/disk3; upper limit on inotify watches reached!
Feb 19 13:05:34 Tower inotifywait[22253]: Please increase the amount of inotify watches allowed per user via `/proc/sys/fs/inotify/max_user_watches'.

Stop and start made no difference.

Kevin

Solved.
Doubled the number of inotifywait max_user_watches and it is now running properly.

Edited by digitalfixer
Problem solved.
Link to comment
1 hour ago, dlandon said:

You may not have any shares on the cache, but that doesn't mean the files aren't temporarily on the cache until moved at night by the mover.

Go to the Tools->Processes and look for a line that starts like this:


inotifywait -m -r -q -e open,attrib,move,create,delete --excludei appdata/...

Copy the complete line and post it here so I can verify inotify is running as it should on your system.  Also tell me how many disks you have in your system.

I have this line

 

root      8465     1  0 01:24 ?        00:00:04 inotifywait -dsrqo /var/run/hash.pipe -e close_write --exclude ^/mnt/disk[0-9]+/Backups|CommunityApplicationsAppdataBackup,Do*****,Squidbait-beef,Squidbait-blue,Squidbait-compare,Squidbait-could,Squidbait-evidently,Squidbait-glimpse,Squidbait-hand,Squidbait-isten,Squidbait-other,Squidbait-place,TV***** --format %w%f /mnt/disk1

 

I have parity, disk1, disk2 and cache.

The files I tried to open definately are not in cache drive.

Link to comment
Just now, karateo said:

I have this line

 


root      8465     1  0 01:24 ?        00:00:04 inotifywait -dsrqo /var/run/hash.pipe -e close_write --exclude ^/mnt/disk[0-9]+/Backups|CommunityApplicationsAppdataBackup,Do*****,Squidbait-beef,Squidbait-blue,Squidbait-compare,Squidbait-could,Squidbait-evidently,Squidbait-glimpse,Squidbait-hand,Squidbait-isten,Squidbait-other,Squidbait-place,TV***** --format %w%f /mnt/disk1

 

I have parity, disk1, disk2 and cache.

The files I tried to open definately are not in cache drive.

And I just remembered this inotifywait must be from the File Integrity plugin!

Link to comment
1 hour ago, digitalfixer said:

I don't have a screen attached to my server so no console.
I have theses 2 lines twice in my syslog

 


Feb 19 13:05:34 Tower inotifywait[22253]: Failed to watch /mnt/disk3; upper limit on inotify watches reached!
Feb 19 13:05:34 Tower inotifywait[22253]: Please increase the amount of inotify watches allowed per user via `/proc/sys/fs/inotify/max_user_watches'.

Stop and start made no difference.

Kevin

Solved.
Doubled the number of inotifywait max_user_watches and it is now running properly.

I'll have to account for this.

Link to comment

I think the issue that several of you have run into is the number of max_user_watches value being too low.  I'm working on an update that will adjust that value when the plugin is installed or updated.  I also will change the list of disks to be read from a file and not on the command line.  With a large array, the command line could be too long for Linux to handle.

Link to comment
13 minutes ago, dlandon said:

I think the issue that several of you have run into is the number of max_user_watches value being too low.  I'm working on an update that will adjust that value when the plugin is installed or updated.  I also will change the list of disks to be read from a file and not on the command line.  With a large array, the command line could be too long for Linux to handle.

You should make it user adjustable.With any number of plugins (Notably Dynamix FIP) all trying to have watches, whatever value you set may always be too low, especially on large, complex structures.

Link to comment
Feb 21 22:55:38 Tower emhttp: Spinning up all drives...
Feb 21 22:55:38 Tower emhttp: shcmd (411): /usr/sbin/hdparm -S0 /dev/sdc &> /dev/null
Feb 21 22:55:38 Tower kernel: mdcmd (60): spinup 0
Feb 21 22:55:38 Tower kernel: mdcmd (61): spinup 1
Feb 21 22:55:38 Tower kernel: mdcmd (62): spinup 2
Feb 21 22:55:38 Tower kernel: mdcmd (63): spinup 3
Feb 21 22:55:38 Tower kernel: mdcmd (64): spinup 4
Feb 21 22:55:38 Tower kernel: mdcmd (65): spinup 5
Feb 21 22:55:38 Tower kernel: mdcmd (66): spinup 6
Feb 21 22:55:38 Tower kernel: mdcmd (67): spinup 7
Feb 21 22:55:38 Tower kernel: mdcmd (68): spinup 8
Feb 21 22:55:38 Tower kernel: mdcmd (69): spinup 29
Feb 21 22:55:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 21 22:55:51 Tower file.activity: Starting File Activity
Feb 21 22:55:53 Tower file.activity: Error: inotify failed to start for File Activity
Feb 21 22:56:01 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 21 22:56:01 Tower file.activity: Stopping File Activity
Feb 21 22:56:01 Tower file.activity: File Activity is not running

Using version 2017.02.21b  - Nothing happens.  Am I missing something?

Link to comment

For testing I set the Max user watches to 1000000 and it worked with version 2017.02.21.

 

Very very useful plugin. 

Thank you.

 

What value so I change the Max user watches to?

 

Ps.

Is it possible, when the file is accessed to catch who is doint it?

Even if it's just a localhost or some other ip is very useful.

Edited by karateo
Link to comment
6 hours ago, bakes82 said:

Feb 21 22:55:38 Tower emhttp: Spinning up all drives...
Feb 21 22:55:38 Tower emhttp: shcmd (411): /usr/sbin/hdparm -S0 /dev/sdc &> /dev/null
Feb 21 22:55:38 Tower kernel: mdcmd (60): spinup 0
Feb 21 22:55:38 Tower kernel: mdcmd (61): spinup 1
Feb 21 22:55:38 Tower kernel: mdcmd (62): spinup 2
Feb 21 22:55:38 Tower kernel: mdcmd (63): spinup 3
Feb 21 22:55:38 Tower kernel: mdcmd (64): spinup 4
Feb 21 22:55:38 Tower kernel: mdcmd (65): spinup 5
Feb 21 22:55:38 Tower kernel: mdcmd (66): spinup 6
Feb 21 22:55:38 Tower kernel: mdcmd (67): spinup 7
Feb 21 22:55:38 Tower kernel: mdcmd (68): spinup 8
Feb 21 22:55:38 Tower kernel: mdcmd (69): spinup 29
Feb 21 22:55:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 21 22:55:51 Tower file.activity: Starting File Activity
Feb 21 22:55:53 Tower file.activity: Error: inotify failed to start for File Activity
Feb 21 22:56:01 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 21 22:56:01 Tower file.activity: Stopping File Activity
Feb 21 22:56:01 Tower file.activity: File Activity is not running

Using version 2017.02.21b  - Nothing happens.  Am I missing something?

 

Update to 2017.02.22 and try again.  The inotify errors are now logged to the syslog and you should be able to see why it is not starting.

Link to comment
4 hours ago, karateo said:

For testing I set the Max user watches to 1000000 and it worked with version 2017.02.21.

 

Very very useful plugin. 

Thank you.

 

What value so I change the Max user watches to?

 

Ps.

Is it possible, when the file is accessed to catch who is doint it?

Even if it's just a localhost or some other ip is very useful.

 

Set Max User Watches to whatever works for you system.  Start with the default and if that doesn't work, try doubling it.

 

I can't get any information on who is accessing the file from inotify.

Link to comment

Updated, no errors in log, says "starting" but that's it.

 

Feb 22 08:58:35 Tower root: plugin: creating: /boot/config/plugins/file.activity/file.activity-2017.02.22.tgz - downloading from URL https://github.com/dlandon/file.activity/raw/master/file.activity-2017.02.22.tgz
Feb 22 08:58:36 Tower root: plugin: checking: /boot/config/plugins/file.activity/file.activity-2017.02.22.tgz - MD5
Feb 22 08:58:36 Tower root: plugin: running: anonymous
Feb 22 08:58:36 Tower root: plugin: skipping: /boot/config/plugins/file.activity/file.activity.cfg already exists
Feb 22 08:58:36 Tower root: plugin: running: anonymous
Feb 22 08:58:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 22 08:58:51 Tower file.activity: Starting File Activity
Feb 22 09:00:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 22 09:00:51 Tower file.activity: Stopping File Activity
Feb 22 09:00:51 Tower file.activity: File Activity is not running
Feb 22 09:00:57 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 22 09:00:57 Tower file.activity: Stopping File Activity
Feb 22 09:00:57 Tower file.activity: File Activity is not running
Feb 22 09:00:57 Tower file.activity: Starting File Activity
Feb 22 09:01:04 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 22 09:01:04 Tower file.activity: Starting File Activity

 

Link to comment
3 hours ago, bakes82 said:

Updated, no errors in log, says "starting" but that's it.

 


Feb 22 08:58:35 Tower root: plugin: creating: /boot/config/plugins/file.activity/file.activity-2017.02.22.tgz - downloading from URL https://github.com/dlandon/file.activity/raw/master/file.activity-2017.02.22.tgz
Feb 22 08:58:36 Tower root: plugin: checking: /boot/config/plugins/file.activity/file.activity-2017.02.22.tgz - MD5
Feb 22 08:58:36 Tower root: plugin: running: anonymous
Feb 22 08:58:36 Tower root: plugin: skipping: /boot/config/plugins/file.activity/file.activity.cfg already exists
Feb 22 08:58:36 Tower root: plugin: running: anonymous
Feb 22 08:58:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 22 08:58:51 Tower file.activity: Starting File Activity
Feb 22 09:00:51 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 22 09:00:51 Tower file.activity: Stopping File Activity
Feb 22 09:00:51 Tower file.activity: File Activity is not running
Feb 22 09:00:57 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'update'
Feb 22 09:00:57 Tower file.activity: Stopping File Activity
Feb 22 09:00:57 Tower file.activity: File Activity is not running
Feb 22 09:00:57 Tower file.activity: Starting File Activity
Feb 22 09:01:04 Tower php: /usr/local/emhttp/plugins/file.activity/scripts/rc.file.activity 'start'
Feb 22 09:01:04 Tower file.activity: Starting File Activity

 

 

Go to a command line and run this command:

/usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity

See if you get any errors.  If it looks like the program is hanging, then it is running.  Ctrl-C to stop the program.  Let me know the results.

Link to comment
3 minutes ago, bakes82 said:

root@Tower:~# /usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity
/usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity: line 38: inotifywait: command not found

 

 

Ok. Now I know the problem. I'll have to set the full path.

Link to comment


Tower login: root
Linux 4.4.30-unRAID.
Last login: Wed Feb 22 17:56:32 -0500 2017 on /dev/pts/1 from 192.168.0.34.
root@Tower:~# /usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity
/usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity: line 41: /usr/bin/inotifywait: No such file or directory
 

Link to comment
1 minute ago, bakes82 said:


Tower login: root
Linux 4.4.30-unRAID.
Last login: Wed Feb 22 17:56:32 -0500 2017 on /dev/pts/1 from 192.168.0.34.
root@Tower:~# /usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity
/usr/local/emhttp/plugins/file.activity/scripts/inotify.file.activity: line 41: /usr/bin/inotifywait: No such file or directory
 

 

Go to a command line and enter:

whereis inotifywait

 

it looks like you are missing inotifywait.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.