0

I know how to use inotify to monitor filesystem events under linux. I'm wondering if there is any utility that is similar to inotify which can be used to monitor non-filesystem events.

For example, I'd like to register event handlers which can be triggered by things like the startup or shutdown of certain executables, the receipt of connections or disconnections from other hosts, mounts or unmounts of filesystems, the login or logout of certain users, etc.

The syslog facility is not sufficient for this purpose, because (for example) the starting and stopping of arbitrary executables are not logged anywhere. The same is true for arbitrary mounts and unmounts.

I know that I can write programs to read information from the /proc filesystem and execute code based upon conditions that it finds. I also know that I can write programs to monitor wtmp and other such resources and to similarly execute code based upon what is found. However, I'm wondering if there is some sort of facility like inotify which could be used to encapsulate these kinds of non-filesystem monitoring tasks underneath a standard interface.

Thank you for any suggestions.

2 Answers 2

2

I believe that you can do at least some of what you're looking for With Sysdig Chisels. Sysdig is an open-source tool that enables you to monitor Linux system calls. The chisels enable you to write scripts to perform actions based on the observed system calls.

Take a look at the user guide

0
2

You can also take a look at the Linux auditing subsystem, nice docs for RHEL are at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/chap-system_auditing.

You can add rules, which log events in the audit log, and parse the audit log to do whatever you like with it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.