What file state parameters can be tracked with IPHost Network Monitor?
Q: I need to keep tracks on file state (attributes) change. What are my options?
A: Files are common objects for monitoring. Those could be system log files; mailboxes, application-generated files containing important information and so on. Depending on the task, it could be required to monitor certain file attributes, such as modification time, size, access rights and so on.
In case of Windows, you can use either ‘for’ command of cmd.exe command-line tool, or WMI (using winMgmts:CIM_DataFile class to get all the file/directory status data). WMI return value can be checked directly; in all the other cases script monitor can be used to run a script checking specific attributes, to analyze them and invoke alerts if necessary.
In case of Linux and similar systems there’s a built-in ‘stat’ utility that can be used to request file and/or directory status attributes. Those can be either used in conjunction with SNMP (to store the retrieved file data as SNMP entry) or using script monitor to pass the data to the IPHost Network Monitor instance.
The above methods cover most of cases of checking file status; if more complicated checks are required, the proper script can be written and used in SSH or Script monitor to get the required data.