Ad Widget

Collapse

External FTP monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kroontje
    Junior Member
    • Jul 2009
    • 3

    #1

    External FTP monitoring

    Hello Zabbix-addicts

    I wanna try to check if an external FTP server is accepting my credentials so I can see if the FTP server is up. I found this thread: http://www.zabbix.com/forum/showthread.php?t=10741 and use the cURL commands from there and created an item in Zabbix, but always the return-code is 0? Even when I change the credentials, servername, etc.

    The command I use on the shell is: curl ftp://userassword@host >/dev/null 2>&1 | echo $?

    I'am not a scripter, sorry, but what's going wrong here? Tried to search on Google, the cURL manual, but no succes!

    Thanks in advance!

    Edit: When I use no /dev/null I get the errors in the way when I change credentials and/or host:

    0

    curl: (6) Couldn't resolve host 'host'

    AND

    0

    curl: (67) Access denied: 530

    Always that 0 at the beginning and when it succeed I wil get a file list of the FTP server.
    Last edited by Kroontje; 20-07-2009, 14:57.
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    You should replace | by ;

    Code:
    curl ftp://user:password@host >/dev/null 2>&1 ; echo $?
    Hope this helps
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • Padawan.AVT
      Junior Member
      • May 2009
      • 26

      #3
      There even more simple way: just check if your server accepts connection on port 21. If so, FTP is up
      Zabbix has build-in feature for that and even some templates have this (FTP check) item

      Comment

      • Kroontje
        Junior Member
        • Jul 2009
        • 3

        #4
        Originally posted by alixen
        You should replace | by ;

        Code:
        curl ftp://user:password@host >/dev/null 2>&1 ; echo $?
        Hope this helps
        Alixen
        That does the trick, thank you!

        Originally posted by Padawan.AVT
        There even more simple way: just check if your server accepts connection on port 21. If so, FTP is up
        Zabbix has build-in feature for that and even some templates have this (FTP check) item
        It's not my server, it's external and want to know if I can login, thanks!

        Comment

        Working...