Hey guys,
I'm working right now on a project to monitor our SFTP server, we want most of it to run through Zabbix since that is where all of our monitoring is.
The process is:
Here is what we've done so far:
We have created a Python script with os.walk which scans folders for new files, creating a list of: {#NAME}: <FILENAME> {#CREATIONTIME}: <TIMESTAMP>
With that, we created a discovery rule which runs this script, and opens a new item for each file arrived.
The tricky part is checking the logs for the file names.
So these are the options I tried:
I'm having a hard time figuring out what is the best way to do this.
Any advice?
Thanks.
I'm working right now on a project to monitor our SFTP server, we want most of it to run through Zabbix since that is where all of our monitoring is.
The process is:
- We get new files on our SFTP folders.
- Files gets loaded on our system and logged in a specific log file.
Here is what we've done so far:
We have created a Python script with os.walk which scans folders for new files, creating a list of: {#NAME}: <FILENAME> {#CREATIONTIME}: <TIMESTAMP>
With that, we created a discovery rule which runs this script, and opens a new item for each file arrived.
The tricky part is checking the logs for the file names.
So these are the options I tried:
- Creating a regular item with log[logfile.log,"File has been loaded"]. Then the discovery rule creates a new dependent item on this log to check for the file name. This did not work because the dependent item was created a bit after the file was logged in the system, so it did not receive the data needed to know it was logged.
- Creating a new active log item for each file, meaning - log[logfile.log,"{#NAME}"]. The problem with this way was to have a trigger for a file not loaded. 'nodata' did not work because even if the file was loaded, after a while there is no more data and the trigger would alarm. Every other way to discover regular expressions or strings in the values did not work as well, since when a file did not load there were no values, so the trigger would not alarm.
I'm having a hard time figuring out what is the best way to do this.
Any advice?
Thanks.