0

I am currently a beginner in Zabbix, and I want to set up monitoring of files when they are stopped in a folder.

I work in a company that already has a monitoring system only to see if a certain folder has stopped files. We need this monitoring because the system works with the movement of files and if a file is stopped this needs to generate the alert.

I tried searching the web but I did not find this feature. Zabbix is ​​running on a Centos 7 server and the folders are on servers running Windows Server

Luis Fernando
  • 23
  • 1
  • 2
  • 9
  • With "file stopped" do you mean some single log file is not getting new content anymore, or for example that a directory won't get any new files created? – Janne Pikkarainen Nov 21 '18 at 14:40
  • No, it is for example when a file is not moved automatically from a folder and remains "stopped" without being processed by the system. – Luis Fernando Nov 21 '18 at 15:34
  • Would that mean that a file should not spend more than X minutes in a folder, or should Zabbix somehow monitor point A (where the file originally comes from), point B (the directory where the file now is) and point C (where the file is supposed to go? You know, you're really not giving us a very detailed description what you REALLY want. Imagine you being the one who reads the question and try then to fill in the lacking details. – Janne Pikkarainen Nov 21 '18 at 16:28
  • OK. I'll try to be more specific. Currently our application works to move files from one folder to another, so that it separates the processes. If a file is stopped for a few minutes in a folder means that the system has failed in this process. What I need to know is if there is any file stopped for more than 15 minutes (for example) in one of these folders. Zabbix does not seem to have this file-checking functionality. So I would like to know if there is a way to customize a script or some information from the agent so that it sends to the server the alert for stopped files. – Luis Fernando Nov 21 '18 at 17:13

1 Answers1

0

Your case seems to involve some basic custom scripting. :)

find /path/to/your/folder -type f -mmin +15 | wc -l

If that returns more than zero, then it means you have a file older than 15 minutes somewhere in that folder or any sub-directory.

Hook that external script to Zabbix as a new item for your monitored server and you're done.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • Thanks for the answer! I have received other answers, one of the official zabbix forum informing to use the vfs.dir.size parameter to check the folder size, I thought of using a trigger with this parameter in zabbix to warn if the directory size is more than 1kb. I will perform some tests, also along with your response, thanks for now – Luis Fernando Nov 29 '18 at 11:52