GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- FTP script
Operating System - HP-UX
1846551
Members
1716
Online
110256
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 04:34 PM
10-30-2006 04:34 PM
I need a script that can read the /var/log/ftplog and send an sms alert if there is an ftp disconnection. The ftp jobs run daily @ 5 am.
The ftp log shown lost connection
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 373804 daemon.info] connection from 10.103.3.4 at Fri Jul 14 05:00:56 2006
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 220
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 738965 daemon.debug] bwbw0066 FTP server (SunOS 5.8) ready.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: USER asftp^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 331
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 337738 daemon.debug] Password required for asftp.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 416587 daemon.debug] command: PASS
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 230
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 636382 daemon.debug] User asftp logged in.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: SYST^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 215
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 369318 daemon.debug] UNIX Type: L8 Version: SUNOS
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: TYPE A^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 200
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 735722 daemon.debug] Type set to A.
Jul 14 05:01:00 bwbw0066 in.ftpd[21485]: [ID 103687 daemon.debug] lost connection
The ftp log shown lost connection
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 373804 daemon.info] connection from 10.103.3.4 at Fri Jul 14 05:00:56 2006
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 220
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 738965 daemon.debug] bwbw0066 FTP server (SunOS 5.8) ready.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: USER asftp^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 331
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 337738 daemon.debug] Password required for asftp.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 416587 daemon.debug] command: PASS
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 230
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 636382 daemon.debug] User asftp logged in.
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: SYST^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 215
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 369318 daemon.debug] UNIX Type: L8 Version: SUNOS
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 577562 daemon.debug] command: TYPE A^M
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 988435 daemon.debug] <--- 200
Jul 14 05:00:56 bwbw0066 in.ftpd[21485]: [ID 735722 daemon.debug] Type set to A.
Jul 14 05:01:00 bwbw0066 in.ftpd[21485]: [ID 103687 daemon.debug] lost connection
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 07:21 PM
10-30-2006 07:21 PM
Solution
Hi,
one way may be something like:
#!/usr/bin/sh
filename=/var/log/ftplog
# Get todays date
sdate=`date -u "+%b %m"`
# Search for the lost connection and todays date
lfound=`grep -e"$sdate" $filename | grep -e"lost connection"| wc -l`
if [ $lfound -gt 0 ]
then
# send mail
grep -e"$sdate" $filename | grep -e"lost connection" |mailx -s"Lost ftp connection" reciever@mail.com
else
echo "clean run"
fi
In conjunction with SMS thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=182232
If you found this answer useful please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
one way may be something like:
#!/usr/bin/sh
filename=/var/log/ftplog
# Get todays date
sdate=`date -u "+%b %m"`
# Search for the lost connection and todays date
lfound=`grep -e"$sdate" $filename | grep -e"lost connection"| wc -l`
if [ $lfound -gt 0 ]
then
# send mail
grep -e"$sdate" $filename | grep -e"lost connection" |mailx -s"Lost ftp connection" reciever@mail.com
else
echo "clean run"
fi
In conjunction with SMS thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=182232
If you found this answer useful please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 07:29 PM
10-30-2006 07:29 PM
Re: FTP script
Shalom,
Welcome to ITRC.
Most ftp servers do include an inactivity time out.
You appear to be running into that, perhaps due to a large file transfer that is proceeding slowly.
SEP
Welcome to ITRC.
Most ftp servers do include an inactivity time out.
You appear to be running into that, perhaps due to a large file transfer that is proceeding slowly.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP