0

We have a few sshfs based mounts.

We also use pingdom to monitor our service.

We would like to create a custom pingdom handler (php based, accessed via our webserver) to test the status of these mounts.

What is the best way to test the status of these mounts via php?

We were thinking of doing a simple is_file / is_dir but the only downside with this method is that these sshfs mounts all differ from each other (differ as in, not all root (/) mounts) so each mount would have to test for a different file / dir.

I supposed another method would be to test fstab and parse the status out of there?

Any other ideas?

Thanks!

anonymous-one
  • 14,454
  • 18
  • 60
  • 84
  • I know this is an old thread, but it is the first result in a Google search that I did while trying to find out why `is_dir` is failing for sshfs mounts, and there's no answer on this thread. The answer can be found here: http://stackoverflow.com/questions/12620712/how-do-i-check-whether-a-fuse-folder-is-present To check the status of (or read in any way) an sshfs mount that was not mounted by the user making the request, you must set the appropriate `allow_other` options in fuse.conf and invocation of sshfs. – Chris Ostmo Jan 14 '13 at 23:51
  • what we ended up doing is adding a .sshfs_mount file to each of our ssh mounts, and doing a is_file(.... .sshfs_mount)... this works quite well in our case. – anonymous-one Jan 16 '13 at 10:55

1 Answers1

0

You should mount he remote directory with the user and group you need (it may differ in development), and add the allow_other option:

sshfs -o uid={USER_ID},gid={GROUP_ID},allow_other  {REMOTE_USER}@{SERVER_IP}:/var/www/html/images/adjuntos/imagen media/
Mariano Argañaraz
  • 1,159
  • 11
  • 22