HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Set a ping program
Operating System - HP-UX
1826219
Members
2983
Online
109691
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
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
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
07-19-2007 06:19 PM
07-19-2007 06:19 PM
Set a ping program
I would like to add a ping program that ping from host A to host B , the ping schedule is from 09:00am to 05:00pm daily , and periodically send a current time to the ping log ( so that I can easily to trace the time ) , can provide a simple script for me ?
what I do now is :
schedule job 1 : submit a ping job at 09:00am daily and kill it at 05:00pm
schedule job 2 : set a schedule job to run hourly "date >> ping.log"
what I do now is :
schedule job 1 : submit a ping job at 09:00am daily and kill it at 05:00pm
schedule job 2 : set a schedule job to run hourly "date >> ping.log"
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2007 07:14 PM
07-19-2007 07:14 PM
Re: Set a ping program
hi,
since by default, ping waits for 1 sec between the sending of each packet, this can be easily implemented.
#!/bin/sh
export PINGLOG=/home/yd/logfiles/ping-$(date +%a)
cat /dev/null > $PINGLOG
i=1
while [ $i -le 8 ]
do
ping hostb -c 3600 >> $PINGLOG
date >> $PINGLOG
i=`expr $i + 1`
done
hope this helps!
kind regards
yogeeraj
since by default, ping waits for 1 sec between the sending of each packet, this can be easily implemented.
#!/bin/sh
export PINGLOG=/home/yd/logfiles/ping-$(date +%a)
cat /dev/null > $PINGLOG
i=1
while [ $i -le 8 ]
do
ping hostb -c 3600 >> $PINGLOG
date >> $PINGLOG
i=`expr $i + 1`
done
hope this helps!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2007 03:20 AM
07-20-2007 03:20 AM
Re: Set a ping program
Hi hangyu
This is "ping_host.csh" script
#!/bin/csh -f
/usr/sbin/ping -s HOSTNAME
This is kill_ping.csh script:
#!/bin/csh -f
set PR_ID = `/bin/ps -ef | grep ping | grep -v grep | grep HOSTNAME | awk '{print $2}'`
kill -9 $PR_ID
This is crontab line:
00 9 * * 1-5 ping_host.csh > ping.log 2>&1
00 17 * * 1-5 kill_ping.csh
Best Regards
Ernesto.
This is "ping_host.csh" script
#!/bin/csh -f
/usr/sbin/ping -s HOSTNAME
This is kill_ping.csh script:
#!/bin/csh -f
set PR_ID = `/bin/ps -ef | grep ping | grep -v grep | grep HOSTNAME | awk '{print $2}'`
kill -9 $PR_ID
This is crontab line:
00 9 * * 1-5 ping_host.csh > ping.log 2>&1
00 17 * * 1-5 kill_ping.csh
Best Regards
Ernesto.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP