HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Needed
Operating System - HP-UX
1834130
Members
2485
Online
110064
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
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
03-29-2005 09:52 PM
03-29-2005 09:52 PM
Hi All,
I need scrips for NTP server side and NTP clien side.I have attached NTP server side procdeure and NTP client side procedure.This is very urgent script.please do the needful.
Configuring an NTP Server :
The steps to configure a system to be an NTP Server are:
1. Edit the /etc/rc.config.d/netdaemons
Eg: lcscore1(10.3.10.14)
export NTPDATE_SERVER= lcscore1
export XNTPD=1
export XNTPD_ARGS= "-c /etc/ntp.conf"
2. Edit the /etc/ntp.conf
server lcscore1 version 1 prefer
fudge 10.3.10.14 stratum 10
3. Start the xntpd daemon manually by executing the following command:
sbin/init.d/xntpd start
Configuring an NTP Client
The complete, step-by-step procedure for configuring an NTP client is:
1. Edit the /etc/rc.config.d/netdaemons
export NTPDATE_SERVER= lcscore1
export XNTPD=1
export XNTPD_ARGS= "-c /etc/ntp.conf"
2. Edit the /etc/ntp.conf
fudge 10.3.10.14 stratum 10
server lcscore1 version 1 prefer
3. Start the xntpd daemon manually by executing the following command:
/sbin/init.d/xntpd start
Thanks&Regards,
Sureshkumar.
I need scrips for NTP server side and NTP clien side.I have attached NTP server side procdeure and NTP client side procedure.This is very urgent script.please do the needful.
Configuring an NTP Server :
The steps to configure a system to be an NTP Server are:
1. Edit the /etc/rc.config.d/netdaemons
Eg: lcscore1(10.3.10.14)
export NTPDATE_SERVER= lcscore1
export XNTPD=1
export XNTPD_ARGS= "-c /etc/ntp.conf"
2. Edit the /etc/ntp.conf
server lcscore1 version 1 prefer
fudge 10.3.10.14 stratum 10
3. Start the xntpd daemon manually by executing the following command:
sbin/init.d/xntpd start
Configuring an NTP Client
The complete, step-by-step procedure for configuring an NTP client is:
1. Edit the /etc/rc.config.d/netdaemons
export NTPDATE_SERVER= lcscore1
export XNTPD=1
export XNTPD_ARGS= "-c /etc/ntp.conf"
2. Edit the /etc/ntp.conf
fudge 10.3.10.14 stratum 10
server lcscore1 version 1 prefer
3. Start the xntpd daemon manually by executing the following command:
/sbin/init.d/xntpd start
Thanks&Regards,
Sureshkumar.
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2005 10:25 PM
03-29-2005 10:25 PM
Solution
You can use the script as,
#!/bin/ksh
#server.ksh
NTPSERVER="lcscore1";
NTPIP="10.3.10.14"
FLAG=0;
# 1
while read line;
do
echo $line | grep -q 'export NTPDATE_SERVER'
if [[ $? -eq 0 ]]
then
echo "export NTPDATE_SERVER=$NTPSERVER"
FLAG=1
fi
echo $line | grep -q 'export XNTPD'
if [[ $? -eq 0 ]]
then
echo "export XNTPD=1"
FLAG=1
fi
echo $line | grep -q 'export XNTPD_ARGS'
if [[ $? -eq 0 ]]
then
echo "export XNTPD_ARGS=\"-c /etc/ntp.conf\""
FLAG=1
fi
if [[ $FLAG -eq 0 ]]
then
echo $line
fi
FLAG=0;
done < /etc/rc.config.d/netdaemons /tmp/netdaemons
mv /tmp/netdaemons /etc/rc.config.d/netdaemons
# 2
grep -Eq '^server|^fudge' /etc/ntp.conf
if [[ $? -eq 0 ]]
then
sed -i -e '/^server/d;/^fudge/d' /etc/ntp.conf
fi
echo "server $NTPSERVER version 1 prefer" >> /etc/ntp.conf
echo "fudge $NTPIP stratum 10" >> /etc/ntp.conf
# 3
/sbin/init.d/xntpd start
exit 0
##
===================================
#!/bin/ksh
#client.ksh
NTPSERVER="lcscore1";
NTPIP="10.3.10.14"
FLAG=0;
# 1
while read line;
do
echo $line | grep -q 'export NTPDATE_SERVER'
if [[ $? -eq 0 ]]
then
echo "export NTPDATE_SERVER=$NTPSERVER"
FLAG=1
fi
echo $line | grep -q 'export XNTPD'
if [[ $? -eq 0 ]]
then
echo "export XNTPD=1"
FLAG=1
fi
echo $line | grep -q 'export XNTPD_ARGS'
if [[ $? -eq 0 ]]
then
echo "export XNTPD_ARGS=\"-c /etc/ntp.conf\""
FLAG=1
fi
if [[ $FLAG -eq 0 ]]
then
echo $line
fi
FLAG=0;
done < /etc/rc.config.d/netdaemons /tmp/netdaemons
mv /tmp/netdaemons /etc/rc.config.d/netdaemons
# 2
grep -Eq '^server|^fudge' /etc/ntp.conf
if [[ $? -eq 0 ]]
then
sed -i -e '/^server/d;/^fudge/d' /etc/ntp.conf
fi
echo "fudge $NTPIP stratum 10" >> /etc/ntp.conf
echo "server $NTPSERVER version 1 prefer" >> /etc/ntp.conf
# 3
/sbin/init.d/xntpd start
exit 0
##
It will work.
#!/bin/ksh
#server.ksh
NTPSERVER="lcscore1";
NTPIP="10.3.10.14"
FLAG=0;
# 1
while read line;
do
echo $line | grep -q 'export NTPDATE_SERVER'
if [[ $? -eq 0 ]]
then
echo "export NTPDATE_SERVER=$NTPSERVER"
FLAG=1
fi
echo $line | grep -q 'export XNTPD'
if [[ $? -eq 0 ]]
then
echo "export XNTPD=1"
FLAG=1
fi
echo $line | grep -q 'export XNTPD_ARGS'
if [[ $? -eq 0 ]]
then
echo "export XNTPD_ARGS=\"-c /etc/ntp.conf\""
FLAG=1
fi
if [[ $FLAG -eq 0 ]]
then
echo $line
fi
FLAG=0;
done < /etc/rc.config.d/netdaemons /tmp/netdaemons
mv /tmp/netdaemons /etc/rc.config.d/netdaemons
# 2
grep -Eq '^server|^fudge' /etc/ntp.conf
if [[ $? -eq 0 ]]
then
sed -i -e '/^server/d;/^fudge/d' /etc/ntp.conf
fi
echo "server $NTPSERVER version 1 prefer" >> /etc/ntp.conf
echo "fudge $NTPIP stratum 10" >> /etc/ntp.conf
# 3
/sbin/init.d/xntpd start
exit 0
##
===================================
#!/bin/ksh
#client.ksh
NTPSERVER="lcscore1";
NTPIP="10.3.10.14"
FLAG=0;
# 1
while read line;
do
echo $line | grep -q 'export NTPDATE_SERVER'
if [[ $? -eq 0 ]]
then
echo "export NTPDATE_SERVER=$NTPSERVER"
FLAG=1
fi
echo $line | grep -q 'export XNTPD'
if [[ $? -eq 0 ]]
then
echo "export XNTPD=1"
FLAG=1
fi
echo $line | grep -q 'export XNTPD_ARGS'
if [[ $? -eq 0 ]]
then
echo "export XNTPD_ARGS=\"-c /etc/ntp.conf\""
FLAG=1
fi
if [[ $FLAG -eq 0 ]]
then
echo $line
fi
FLAG=0;
done < /etc/rc.config.d/netdaemons /tmp/netdaemons
mv /tmp/netdaemons /etc/rc.config.d/netdaemons
# 2
grep -Eq '^server|^fudge' /etc/ntp.conf
if [[ $? -eq 0 ]]
then
sed -i -e '/^server/d;/^fudge/d' /etc/ntp.conf
fi
echo "fudge $NTPIP stratum 10" >> /etc/ntp.conf
echo "server $NTPSERVER version 1 prefer" >> /etc/ntp.conf
# 3
/sbin/init.d/xntpd start
exit 0
##
It will work.
Easy to suggest when don't know about the problem!
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 2025 Hewlett Packard Enterprise Development LP