I use this simple monitoring of our ftp server.

  1. vsftpd service health monitoring:
    • bash script:
      #!/bin/bash
      
      service vsftpd status > /dev/null 2>&1;echo "{ \"ftp_health_error\": $? }"
      
    • configuration in telegraf:
      [[inputs.exec]]
        commands=["/etc/telegraf/ftp_health_test.sh"]
        timeout="10s"
        interval="30m"
        name_suffix="_ftphealth"
      
  2. ftp connection error:
    • bash script:
      #!/bin/bash
      
      curl ftp://xxxx:xxxx@xxx.xxx.xxx.xxx > /dev/null 2>&1; echo "{ \"ftp_connect_error\": $?}"
      
    • telegraf:
      [[inputs.exec]]
        commands=["/etc/telegraf/ftp_connect_test.sh"]
        timeout="10s"
        interval="30m"
        name_suffix="_ftpconnect"