Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am wondering if it would be of any help if some kind of tools that does filesystem monitoring (i.e inotify-tools) would be modified in order to monitor/report back through ssh. Would it help sysadmins to be able to do something like inotify-watch 192.168.0.33:/home/deploy/script ? Probably the monitored servers should fulfill some pre-condition, but does this sound feasible?

share|improve this question
1  
Do you want it to happen automatically and report back? Or are you ok with having an app you run that SSH's to the machine and runs the command? –  sparks Jul 11 '09 at 15:14
    
Which OS are you talking about? I presume linux at this point (inotify) but I just wanted a clarification. –  Avery Payne Jul 11 '09 at 19:11
    
@sparks: having an app that ssh's to the machine would be my option. @Avery Payne: yes, definitely Linux :) –  hyperboreean Jul 12 '09 at 8:43

6 Answers 6

I've got to be honest, this seems like the wrong way to work this.

First of all, there's no way to know whether the remote machine will support inotify.

Secondly, it seems like a lot of effort to combine what is traditionally a two piece generalized solution, into a single piece specific solution. Monitoring and reporting on remote machines is rarely best accomplished with ssh. When you need this level of information about a remote host, you usually want to put a software agent on the remote host that can do the monitoring, and then run the monitoring system on a different box to poll the agent (or have the agent report back).

If you want to add this ability to a box without installing an additional agent, SNMP would be the logical choice (many/most hosts support SNMP out of the box, or have a vendor supplied SNMP package). Alternately, most agent-based monitoring systems such as Nagios, BigBrother/Hobbit/BigSister, Munin, etc, offer the ability to define your own plug-ins. It wouldn't be that difficult to create an inotify-based plug-in.

If you don't want to use a full-blown monitoring system to monitor the remote box, I'd use something like func, which provides a better framework for this than ssh.

share|improve this answer

Have you considered munin? http://munin.projects.linpro.no/

The normal method of operation is for the munin-node software to be listening on the remote machines. Periodically, the munin monitoring software will connect to the nodes to collect data; it can even do that over an SSH tunnel. (It's in the FAQ, I cannot put in two links because my rep is too low).

Munin by default can monitor a wide range of statistics, including filesystem monitoring. In addition, it is trivially easy to write your own plugins for munin-node, to collect the data you want.

share|improve this answer

You might want to look at enabling file auditing, which causes the system to record file events. It is fairly flexible and doesn't require a persistent connection. The auditing can be searched via a command line tool, auditctl(8), so you don't need to wade through mountains of extraneous data. Another bonus is that you get a record of user accounts, process IDs, etc.

As for remote monitoring, you can either have the local server perform the deed for you and ship the data off, or you can run a remote command via ssh, whichever suits your needs best.

share|improve this answer

Yes, any additional ways to monitor systems are of help. Are you asking because your writing a wrapper?

share|improve this answer

fam might be what you're looking for. It's got a daemon that does the local detection and libfam that is a library to talk to it to get a more platform-independent notification.

share|improve this answer
    
@pjz: I am asking from the point of view of the developer, not the one of the user. –  hyperboreean Jul 14 '09 at 20:59

I would use whatever tool you want to watch the file access, and then push it via authenticated web API then you can transform/store/sort the things in a nice web-ui

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.