Ad Widget

Collapse

Help needed: Monitoring SFTP server for new files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spctra
    Junior Member
    • Apr 2019
    • 2

    #1

    Help needed: Monitoring SFTP server for new files

    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:
    1. We get new files on our SFTP folders.
    2. Files gets loaded on our system and logged in a specific log file.
    Basically, I want to know when a file has arrived and have a trigger if it was not loaded to our system.

    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:
    1. 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.
    2. 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.
Working...