From 69e1b0fe391b611fed0dd57422dbff76d5ea9546 Mon Sep 17 00:00:00 2001 From: "M. Sean Finney" Date: Sun, 26 Jun 2005 16:27:05 +0000 Subject: spring cleaning of contrib directory from andreas git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1192 f882894a-f735-0410-b71e-b25c423dba1c --- contrib/check_ftpget.pl | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 contrib/check_ftpget.pl (limited to 'contrib/check_ftpget.pl') diff --git a/contrib/check_ftpget.pl b/contrib/check_ftpget.pl deleted file mode 100755 index de7e8242..00000000 --- a/contrib/check_ftpget.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -w -## Written 12/5/00 Jeremy Hanmer -# $Id$ - -use strict; -use Net::FTP; -use Getopt::Std; - -use vars qw($opt_H $opt_u $opt_p $opt_f); -getopts("H:u:p:f:"); - -my $host = $opt_H || - die "usage: check_ftp.pl -h host [<-u user> <-p pass> <-f file>]\n"; - -my $username = $opt_u || 'anonymous'; -my $pass = $opt_p || "$ENV{'LOGNAME'}\@$ENV{'HOSTNAME'}" ; - -my $file = $opt_f; - -my $status = 0; -my $problem; -my $output = "ftp ok"; - -my $ftp = Net::FTP->new("$host") || - &crit("connect"); - -$ftp->login("$username", "$pass") || - &crit("login"); - -$ftp->get($file) || - &crit("get") if $file; - -sub crit() -{ - $problem = $_[0]; - $status = 2; - if ( $problem eq 'connect' ) { - $output = "can't connect"; - } elsif ( $problem eq 'login' ) { - $output = "can't log in"; - } elsif ( $problem eq 'get' ) { - $output = "cant get $file"; - } -} - -print "$output\n"; -exit $status; - -- cgit v1.2.3-74-g34f1