How to monitor a linux file opened & closed status using Nagios
Marc Powell
marc at ena.com
Thu Oct 1 15:01:13 CEST 2009
On Oct 1, 2009, at 6:48 AM, Selvakumar A wrote:
> Hi,
> Thanks for your guidance.I followed your instructions.I installed
> net_nc in windows-XP and I could only get the file's modified time.
> I am also interested to know about how to monitor a linux file's
> status whether it is opened or closed and modified etc.I used
> chech_file_age plugin which gives only the age of the file.Is there
> any way please help me.
I'm not aware of any plugins that check these. If you decide to write
your own plugin, lsof (when run using sudo) will be your friend.
'is opened' - specified file appears in the output of lsof
'is closed' - specified file does not appear in the output of lsof
'is modified' - depends on what you mean by modified. File age may be
sufficient but if you want to see if actual changes were made you'll
need to create a copy at each run and compare the current with the
previous (using cmp or diff, for example).
A quick google for 'nagios check lsof' doesn't yield any interesting
initial results but you might have luck further in the search results.
--
Marc
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list