Vous êtes sur la page 1sur 56

Do not delete this graphic elements in here:

Section 8
Lab Exercises
Module 12
NTP and CRON

7750 SR Core I R5.0


All Rights Reserved Alcatel-Lucent 2007

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 1


Document History
Lab Exercises NTP and CRON 8 12 2

Document History

E
d
i
t
All Rights Reserved iAlcatel-Lucent 2007
7750 SR Core I R5.0
o
n

0
1

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 2


Lab Exercises NTP and CRON
Module Objectives 8 12 3

Upon successful completion of this module, the student will be


familiar with the:

Concept of the Network Time Protocol and its various operating


modes
Configuration of 7x50SR as a NTP Client and Server in the training lab
network to achieve synchronized network time
Basic building blocks of CRON job scripting on the 7x50
Configuring the 7x50SR to perform simple scripted CRON jobs

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 3


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 4

 General
 NTP client server mode
 NTP peer active mode
 NTP broadcast
 NTP multicast
 Redundancy
 Remarks

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 4


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 5

 RFC 1305
 It is expected that the primary clock source in a given environment is
sourced from equipment with a stratum 1 capable clock and
distributed by a dedicated NTP server.
 The 7750/7450/7710 will act as an intermediate NTP time server for
downstream network elements and should not be used as the primary
clock source.
 Needed for SAA and others as SNTP was not accurate enough
 If both NTP and SNTP are enabled on the node , then SNTP transitions
to an operationally down state . If NTP is removed from the
configuration or shut down then SNTP resumes an operationally state
up.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 5


Network Timing Protocol(NTP)
Lab Exercises NTP and CRON 8 12 6

 Supports:
 Client mode Accept time dont respond to requests
 Server mode Accept time and transmit responses
 Symmetric Active mode Peer to Peer for trusted nodes
 Broadcast & Multicast support Separate client & server controls
(Multicast receive on management port only)
 Support release 2,3 and 4* Accepts either. Transmits per configuration
 Authentication DES & MD5, multiple keys supported
 HA protected Sessions uninterrupted on CPU switchover
 Server unreachable traps If all configured server are unreachable a
trap is generated.
 Gradual Clock adjustment If the time is more then 128ms incorrect then a
programmed adjustment takes place.

* default All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 6


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 7

Timestamp format
 NTP timestamps are represented as a 64-bit unsigned fixed- point number,
in seconds relative to 0h on 1 January 1900. The integer part is in the first
32 bits and the fraction part in the last 32 bits.

Debug system ntp

49 2006/05/11 09:05:32.91 CET MINOR: DEBUG #2001 - NTP


"NTP: RX, rtr: management iface: management
From: 138.203.192.2 To: 138.203.18.21 Len: 48
Version: 4 Mode: Server(4) Stratum: 3 Leap: 0
Ref ID: 138.203.68.13 Poll: 8 Clock Precision: -17
Root Delay: 0x000009AD Root Dispersion: 0x00000A4D
Reference: 0xc80d6cc8.6b111000 Thu, May 11 2006 7:56:56.418
Originate: 0xc80d6ecc.e9bec248 Thu, May 11 2006 8:05:32.913
Receive : 0xc80d6ecc.dc096000 Thu, May 11 2006 8:05:32.859
Transmit : 0xc80d6ecc.dc1a4000 Thu, May 11 2006 8:05:32.859

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 7


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 8
configure system time ntp
Client / Server mode
configure system time ntp

server 192.9.200.100 version 4 prefer server 192.9.200.100 version 4 prefer


no shutdown no shutdown
7750 SIM
Outband management LAN PE-2
192.9.200.156
2.2.2.2
7750 SIM
1/1/1
PE-1 1/1/2
192.9.200.155
1.1.1.1
1/1/1 1/1/3
1/1/2 1/1/3 1/1/1

1/2/1
1/2/2
1/1/3
1/2/3

7750 SR-12
PE-4
server
192.9.200.158 client 1/1/2 1/2/1
client
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.157
3.3.3.3

Configuration for PE-4-PE-3 towards external NTP

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

Configure PE3 and PE4 to be NTP clients of an NTP Server

1. configure>system>time>ntp
2. configure>system>time>ntp#server 192.9.200.100
version 4 prefer
3. configure>system>time>ntp#no shutdown

This enables NTP on these nodes and configures them


to accept timing from an external NTP Server
192.9.200.100. During this configuration it is
possible to set up an Authentication key and also
check for an Authentication key from the NTP
Server

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 8


Lab Exercises NTP and CRON
Network Timing Protocol(NTP)
Client / Server mode 8 12 9
A:PE4# show system ntp all detail
===========================================================================
NTP Status
A:PE3# show system ntp all detail
=========================================================================== 7750 SIM
Enabled : Yes Stratum :4
Outband management LAN =========================================================================== PE-2
Admin Status : up Oper Status : up
Server enabled : Yes Server keyId : none
NTP Status 192.9.200.162
=========================================================================== 2.2.2.2
System Ref Id : 192.9.200.100 Auth Check : Yes
Enabled : Yes Stratum :4
Auth Errors :0 Auth Errors Ignored : 0
Auth Key Id Errors : 0 Auth Key 7750 SIM : 0
Type Errors
Admin Status : up Oper Status : up
Server enabled 1/1/1
: Yes Server keyId 1/1/2 : none
... PE-1
System Ref Id : 192.9.200.100 Auth Check : Yes
192.9.200.161
===============================================================================
Auth Errors :0 Auth Errors Ignored : 0
NTP Servers/Peers
1.1.1.1 Auth Key Id Errors : 0 Auth Key Type Errors : 0
===============================================================================
State Remote Reference ID St Type Auth Poll R Offset
1/1/3
=============================================================================
-------------------------------------------------------------------------------
chosen 192.9.200.100 127.127.1.0 3 srvr none 128 y -0.479
1/1/2 1/1/3
NTP Servers/Peers 1/1/1
=============================================================================
===============================================================================
State Remote Reference ID St Type Auth Poll R Offset
-----------------------------------------------------------------------------
chosen 192.9.200.100 127.127.1.0 3 srvr none 1024 y 0.024
=============================================================================

1/2/1
1/2/2
1/1/3
1/2/3

7750 SR-12
PE-4 client
server client
192.9.200.164 1/1/2 1/1/1
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
3.3.3.3

Show for PE-4-PE-3 towards externalNTP

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

1)PE-1#show system ntp all detail


This table shows where the router is obtaining its timing from, if it is locked to it, any
offset and where the NTP Server is getting its timing from

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 9


Lab Exercises NTP and CRON Network Timing Protocol(NTP) 8 12 10

configure system time ntp


Client / Server mode
configure system time ntp
ntp-server no authentication-check
no authentication-check server 4.4.4.4 prefer 7750 SIM
server 3.3.3.3
Outband
server 192.9.200.100 version 4 prefer
management LAN no shutdown
PE-2
no shutdown 192.9.200.162
2.2.2.2
7750 SIM
1/2/1
PE-1 1/1/2
same

192.9.200.161 client client


1.1.1.1
1/1/3
1/1/2 1/1/3 1/1/1

1/1/1
1/2/2
1/2/3
1/1/3

7750 SIM
server SR4 client server
192.9.200.164 1/1/2 1/1/1 client server
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
3.3.3.3
configure system time ntp

Config for SR1-SR2- towards SR3-SR4


ntp-server
no authentication-check
server 192.9.200.100 version 4 prefer
no shutdown
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

Configure PE-3 and PE-4 to be NTP Clients of an external NTP


Server and also configure them to be NTP Servers
configure>system>time>ntp
configure>system>time>ntp#ntp-server
configure>system>time>ntp#no authentication check
configure>system>time>ntp#server 192.9.200.100 version 4
prefer

configure>system>time>ntp#no shutdown

Configure PE-1 and PE-2 to be NTP Clients of PE-3 and PE-4


configure>system>time>ntp
configure>system>time>ntp#no authentication check
configure>system>time>ntp#server 4.4.4.4 version 4 prefer

configure>system>time>ntp#server 3.3.3.3 version 4
configure>system>time>ntp#no shutdown

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 10


A:PE1# show system ntp all detail

Network Timing Protocol(NTP)


===========================================================================
NTP Status
===========================================================================
Enabled
Admin Status
Lab Exercises : Yes
: up
NTP and CRON Stratum
Oper Status
:5
: up 8 12 11

Client / Server mode


Server enabled : No Server keyId : none
System Ref Id : 8.8.8.8 Auth Check : Yes
Auth Errors :0 Auth Errors Ignored : 0
Auth Key Id Errors :0 Auth Key Type Errors : 0
..
============================================================================= 7750 SIM
NTP Servers/Peers
Outband management LAN PE-2
=============================================================================
State Remote Reference ID St Type Auth Poll R Offset 192.9.200.162
----------------------------------------------------------------------------- 2.2.2.2
chosen 4.4.4.4 192.9.200.100 4 srvr ok 128 y -40.000
candidate 3.3.3.3 192.9.200.100 4 srvr ok 128 7750 SIM
y -38.197
============================================================================= 1/2/1
PE-1 1/1/2
192.9.200.161 client
client
1.1.1.1
1/1/3 same

1/1/2 1/1/3 1/1/1

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12
server PE-4
client server client server
192.9.200.164 1/1/2 1/2/1
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
3.3.3.3

Show for PE1 PE2 towards PE-3 PE-4

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

PE-1#show system ntp all detail


This table shows where the router is obtaining its timing from,
if it is locked to it, any offset and where the NTP Server is
getting its timing from

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 11


Lab Exercises NTP and CRON
Network Timing Protocol(NTP)
Symmetric Active/Passive Mode
8 12 12

configure system time ntp


ntp-server
no authentication-check
peer 3.3.3.3 7750 SIM
Outband management
server LAN
192.9.200.100 version 4 prefer PE-2
no shutdown 192.9.200.162
2.2.2.2
7750 SIM
1/2/1
PE-1 1/1/2
192.9.200.161
1.1.1.1 client client
1/1/3
1/2/2 1/1/3 1/1/1

1/1/1
1/2/2
1/1/3
1/1/3

7750 SR-12
server PE-4 client
client server
192.9.200.164 server 1/1/2 1/2/1
4.4.4.4
NTP Server
192.9.200.100
peers
configure system time
7750 SR-12
Sratum 3 PE-3
ntp-server
no authentication-check 192.9.200.163
peer 4.4.4.4 3.3.3.3
server 192.9.200.100 version 4 prefer
no shutdown
Make PE-3 PE-4 peers
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

PE_3 and PE-4 to be peers


configure>system>time>ntp
configure>system>time>ntp# peer 3.3.3.3 or peer 4.4.4.4

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 12


A:PE4# show system ntp all detail
A:PE2# show system ntp all detail
===========================================================================
===========================================================================

Network Timing Protocol(NTP)


NTP Status NTP Status

Symmetric Active/Passive Mode


=========================================================================== ===========================================================================
Enabled : Yes Stratum :4 Enabled : Yes Stratum :5
Lab Exercises
Admin Status : up NTP and CRON Oper Status : up Admin Status : up Oper Status : up 8 12 13
Server enabled : Yes Server keyId : none Server enabled : No Server keyId : none
System Ref Id : 192.9.200.100 Auth Check : Yes System Ref Id : 4.4.4.4 Auth Check : Yes
Auth Errors :0 Auth Errors Ignored : 0
Auth Errors :0 Auth Errors Ignored : 0
Auth Key Id Errors :0 Auth Key Type Errors : 0
Auth Key Id Errors : 0 Auth Key Type Errors : 0 ..
... ============================================================================= 7750 SIM
=============================================================================== NTP Servers/Peers
NTP Servers/Peers Outband management LAN ============================================================================= PE-2
=============================================================================== State Remote Reference ID St Type Auth Poll R Offset 192.9.200.162
-----------------------------------------------------------------------------
State Remote Reference ID St Type Auth Poll R Offset 2.2.2.2
-------------------------------------------------------------------------------
chosen
140.140.16.1
4.4.4.4
candidate 3.3.3.3
192.9.200.100 4 srvr ok 128 y -40.000
192.9.200.100 127.127.1.0 3 srvr7750 noneSIM
192.9.200.100 4 srvr ok 128 y -38.197
chosen 128 y -0.479 1/2/1
=============================================================================
candidate 3.3.3.3 192.9.200.100 4 actpr PE-1 none 256 y 2.092 1/1/2
192.9.200.161
=============================================================================== client
client
1.1.1.1 1/1/1
1/1/3
1/1/2 1/1/3 1/1/1

1/2/1
A:PE3# show system ntp all detail 1/2/2
===========================================================================
1/2/3
1/2/3
NTP Status
===========================================================================
Enabled : Yes Stratum 7750
: 4 SR-12
Admin Status server : up Oper Status PE-4: up
client client server
NTP Server : No Auth Check 192.9.200.164
: Yes server 1/1/2 1/1/1
System Ref Id : 192.9.200.100
4.4.4.4
Auth Errors
NTP Server :0 Auth Errors Ignored : 0
Auth Key Id Errors : 0 Auth Key Type Errors : 0

192.9.200.100
============================================================================= 7750 SR-12
Sratum 3
NTP Servers/Peers
PE-3
=============================================================================
State Remote Reference ID St Type Auth Poll R Offset 192.9.200.163
----------------------------------------------------------------------------- 3.3.3.3
chosen 192.9.200.100 127.127.1.0 3 srvr none 1024 y 0.024

Show NTP status final


candidate 4.4.4.4 192.9.200.100 4 actpr none 256 y -2.342
=============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

PE-1#show system ntp all detail


This table shows where the router is obtaining its timing from, if it
is locked to it, any offset and where the NTP Server is getting its
timing from

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 13


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 14

Broadcast mode outband


configure system time ntp configure system time ntp
ntp-server broadcastclient interface management router management
server 192.9.200.100 version 4 prefer no shutdown
broadcast interface management router management 7750 SIM
Outband management LAN
no shutdown 192.9.200.0/ 24 PE-2
192.9.200.162
2.2.2.2
7750 SIM
1/1/1
PE-1 1/1/2
192.9.200.161
1.1.1.1
1/1/3
1/1/2 1/1/3 1/1/1

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12
PE-4
server client server client
192.9.200.164 1/1/2 1/1/1 server
4.4.4.4
NTP Server
192.9.200.100
7750 SR-712
Sratum 3 PE-3
192.9.200.163
3.3.3.3

Sr3 and SR4 are broadcast servers on the LAN


configure system time ntp
ntp-server
server 192.9.200 100 version 4 prefer
broadcast interface management router management
no shutdown
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

Configure PE-3 and PE-4 to be NTP Clients of an external NTP Server


and also configure them to be NTP Servers and then configure them to
broadcast NTP timing from the management port. The CPM
management port must first be given the name management and
assigned an ip address

router - specifies the router name used to transmit NTP packets. Base is
the default. Select management to use the SR CPM management port

Configure SR1 and SR2 to be broadcast clients so they receive NTP


packets from SR3 and SR4 on their SR CPM management ports

configure router interface management address 192.9.20.xxx/32


For PE-3 and PE-4
configure>system>time>ntp
configure>system>time>ntp#server 192.9.200.100 version 4 prefer

configure>system>time>ntp#ntp-server
configure>system>time>ntp#broadcast interface management router
management
configure>system>time>ntp#no shutdown
For PE-1 and PE-2
configure>system>time>ntp
configure>system>time>ntp#broadcastclient interface management
router management
configure>system>time>ntp#no
All Rights Reservedshutdown
2007, Alcatel-Lucent

Section 8 Module 12 Page 14


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 15

Broadcast mode outband


A:PE1# show system ntp all detail
...
===============================================================================
NTP Configured Broadcast/Multicast Interfaces 7750 SIM
===============================================================================
vRouter Interface Address Type Auth Poll
PE-2
------------------------------------------------------------------------------- 192.9.200.162
management management Host-ones bcast no 64 2.2.2.2
===============================================================================
7750 SIM
1/1/1
PE-1
=============================================================================== 1/1/2
NTP Active Associations 192.9.200.161 client client
===============================================================================
State Remote
1.1.1.1
Reference ID St Type Auth Poll R Offset
------------------------------------------------------------------------------- 1/1/3
chosen 192.9.200.100 127.127.1.0 3 srvr none 128 y -26.469
============================================================================= 1/1/2 1/1/3
==

1/2/1
1/2/2
1/1/3
1/2/3

7750 SIM
A:PE2# show system ntp all detail
PE-4 server
server server
192.9.200.164 ... 1/1/2 1/2/1
4.4.4.4 ===============================================================================
NTP Server NTP Configured Broadcast/Multicast Interfaces
===============================================================================
192.9.200.100 vRouter Interface Address Type Auth Poll
------------------------------------------------------------------------------- 7750 SR-12
Sratum 3 management management Host-ones bclnt no n/a PE-3
=============================================================================== 192.9.200.163
=============================================================================== 3.3.3.3
NTP Active Associations

PE-3 and PE-4 are broadcast servers on the LAN ===============================================================================


State Remote Reference ID St Type Auth Poll R Offset
-------------------------------------------------------------------------------
chosen 192.9.200.164 192.9.200.100 4 bclnt none 64 y -20.000
All Rights Reserved192.9.200.163
candidate Alcatel-Lucent192.9.200.100
2007 4 bclnt none 64 y -11.197
7750 SR Core I R5.0 ===============================================================================

PE-1#show system ntp all detail


This table shows where the router is obtaining its timing from,
if it is locked to it, any offset and where the NTP Server is
getting its timing from.

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 15


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 16

Broadcast mode inband


configure system time
broadcastclient interface tope4
broadcastclient interface tope3
no shutdown
7750 SIM
PE-2
192.9.200.162
2.2.2.2
configure system time ntp
7750 SIM same
ntp-server 1/2/1
server 192.9.200.100 version 4 prefer PE-1 1/1/2
broadcast interface tope1 192.9.200.161 client client
broadcast interface tope2 1.1.1.1
no shutdown 1/1/3
1/1/2 1/1/3 140.140.21.2 1/1/1

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12
PE-4 server
server server
192.9.200.164 1/1/2 1/1/1
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
3.3.3.3
configure system time

PE-3 and PE-4 are server


broadcast servers towards PE-1 and PE-2
ntp-server
192.9.200.100 version 4 prefer
broadcast interface tope1
broadcast interface tope2
no shutdown
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

Configure PE-3 and PE-4 to be NTP clients of an external NTP server


and then configure them to be broadcast servers to PE-1 and PE-2 using
an inband (network) interface

For PE-3 and PE-4


configure>system>time>ntp
configure>system>time>ntp#server 192.9.200.100 version 4 prefer

configure>system>time>ntp#ntp-server
configure>system>time>ntp#broadcast interface toPE-1
configure>system>time>ntp#broadcast interface toPE-2
configure>system>time>ntp#no shutdown

For PE-1 and PE-2


configure>system>time>ntp
configure>system>time>ntp#broadcastclient interface toPE-3
configure>system>time>ntp#broadcastclient interface toPE-4
configure>system>time>ntp#no shutdown

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 16


Network Timing Protocol(NTP)
Lab Exercises NTP and CRON 8 12 17
A:PE4# show system ntp all detail
... Broadcast mode inband
===============================================================================
NTP Configured Broadcast/Multicast Interfaces 7750 SIM
===============================================================================
vRouter Interface Address Type Auth Poll PE-2
------------------------------------------------------------------------------- 192.9.200.162
Base tope1 Host-ones bcast no 64 2.2.2.2
Base tope2 Host-ones bcast no 64
7750 SIM
=============================================================================== 1/1/1
PE-1 1/1/2
===============================================================================
192.9.200.161 client client
NTP Active Associations
1.1.1.1
===============================================================================
State Remote Reference ID St Type Auth Poll R Offset 1/1/3
-------------------------------------------------------------------------------
chosen 192.9.200.100 127.127.1.0 3 srvr none 512 y -26.472 1/1/2 1/1/3 1/1/1
===============================================================================

1/2/1
1/2/2
1/1/3
1/2/3

7750 SR-12
PE-4 server server
server
192.9.200.164 A:PE3# show system ntp all 1/1/2 detail 1/2/1
4.4.4.4 ...
NTP Server ===============================================================================
NTP Configured Broadcast/Multicast Interfaces
192.9.200.100 ===============================================================================
vRouter Interface Address Type Auth Poll 7750 SR-12
Sratum 3 ------------------------------------------------------------------------------- PE-3
Base tope3 Host-ones bclnt no n/a
Base toppe4 Host-ones bclnt no n/a 192.9.200.163
=============================================================================== 3.3.3.3

PE-3 and PE-4 are broadcast servers towards PE-1 and PE-2
NTP Active Associations
===============================================================================
State Remote Reference ID St Type Auth Poll R Offset
-------------------------------------------------------------------------------
chosen 140.140.17.1 192.9.200.100 4 bclnt none 64 y -21.196
All Rights Reserved Alcatel-Lucent 2007 4 bclnt none 64 y -70.001
7750 SR Core I R5.0 candidate 140.140.21.2 192.9.200.100
===============================================================================

PE-12-1#show system ntp all detail


This table shows where the router is obtaining its timing from, if it is locked to it,
any offset and where the NTP Server is getting its timing from.

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 17


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 18
Multicast mode outband configure system time ntp
multicastclient
no shutdown
7750 SIM
Outband management LAN 192.9.200.0 / 24 same
PE-2
192.9.200.162
2.2.2.2
7750 SIM
1/1/1
PE-1 1/1/2
192.9.200.161 client client
1.1.1.1
1/1/3
1/1/2 1/1/3 1/1/1
configure system time ntp
ntp-server
server 192.9.200.100 version 4 prefer
multicast
no shutdown

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12
PE-4 server
server server
192.9.200.164 1/1/2 1/1/1
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
3.3.3.3

PE-3 and PE-4 are multicast servers on the LAN


configure system time
ntp-server
server 192.9.200.100 version 4 prefer
multicast
no shutdown
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 18


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 19

Multicast mode outband


A:PE4# show system ntp all detail
...
===============================================================================
NTP Configured Broadcast/Multicast Interfaces 7750 SIM
Outband management LAN 192.9.200.0.0 / 24
=============================================================================== PE-2
vRouter Interface Address Type Auth Poll
-------------------------------------------------------------------------------
192.9.200.162
management management 224.0.1.1 mcast no 64 2.2.2.2
===============================================================================
7750 SIM
1/2/1
PE-1
=============================================================================== 1/1/2
NTP Active Associations 192.9.200.161 client
client
===============================================================================
1.1.1.1
State Remote Reference ID St Type Auth Poll R Offset 1/1/3
-------------------------------------------------------------------------------
chosen 192.9.200.100 127.127.1.0 3 srvr none 512 y -26.472
1/1/2 1/1/3 1/1/1
===============================================================================

1/1/1
1/2/2
1/1/3
1/2/3

7750 SR-12
PE-4 server server
server
192.9.200.164 1/1/2 1/1/1
4.4.4.4
A:PE2# show system ntp all detail
NTP Server ...
===============================================================================
192.9.200.100 NTP Configured Broadcast/Multicast Interfaces
=============================================================================== 7750 SR-12
Sratum 3 vRouter Interface Address Type Auth Poll PE-3
-------------------------------------------------------------------------------
management management 224.0.1.1 mclnt no n/a
192.9.200.163
=============================================================================== 3.3.3.3

PE-3 and PE-4===============================================================================


are broadcast servers towards PE-1 and PE-2
NTP Active Associations

State Remote Reference ID St Type Auth Poll R Offset


-------------------------------------------------------------------------------
chosen 192.9.200.100 127.12.7.1.0 4 mclnt none 64 y -70.000
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0 candidate 192.9.200.158 192.9.200.100 4 mclnt none 64 y -1.197
===============================================================================

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 19


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 20
Redundancy
A:PE1# show system ntp all detail
A:PE4# show system ntp all detail
===========================================================================
===========================================================================
NTP Status
NTP Status
===========================================================================
===========================================================================
Enabled : Yes
Enabled
Stratum
: Yes
:4
Stratum :5 7750 SIM
Admin Status : up Oper Status : up
Admin Status Outband PE-2
Server keyIdmanagement LAN : up
: up Oper Status
Server enabled : Yes : none
System Ref Id
Server enabled
: 192.9.200.10
: Yes
Auth Check
Server keyId
: Yes
: none 192.9.200.162
System Ref Id : 3.3.3.3 Auth Check : Yes 2.2.2.2
Auth Errors :0 Auth Errors Ignored : 0
Auth Errors :0 Auth Errors Ignored : 0
Auth Key Id Errors : 0 Auth Key Type Errors : 0
Auth Key Id Errors : 0 7750 SIM Auth Key Type Errors : 0
...
... 1/1/1
PE-1
=============================================================================== 1/1/2
===============================================================================
client client
NTP Servers/Peers
NTP Servers/Peers 192.9.200.161
===============================================================================
1.1.1.1
===============================================================================
State Remote Reference ID St Type Auth Poll R Offset
State Remote Reference ID St Type Auth Poll R Offset
-------------------------------------------------------------------------------
1/1/3
-------------------------------------------------------------------------------
chosen 192.9.200.100 127.127.1.0 3 srvr none 128 y -0.479
candidate 3.3.3.3
chosen 3.3.3.3 192.9.200.100 4 actpr
192.9.200.100 4 actpr none 256 y 2.092
1/1/2none 1024 y 1.242 1/1/3 1/1/1
reject 192.9.200.100 INIT - srvr none 1024 n 0.000
===============================================================================
===============================================================================

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12
server PE-4 server client server
client
192.9.200.164 1/1/2 1/1/1
4.4.4.4
NTP Server
192.9.200.100
7750 SR-12
Sratum 3 PE-3
192.9.200.163
Peer 3.3.3.3

PE-4 IP connectivity failure : case 1


All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0

No alarm on PE1 but he goes to init ( after a while ).


PE3 keeps choosen PE1 because it is prefered.

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 20


Network Timing Protocol(NTP)
Lab Exercises NTP and CRON 8 12 21

PE2> Redundancy
B:PE-2# show system ntp all configure system time ntp
server 4.4.4.4 prefer
=========================================================================== server 3.3.3.3
7750 SIM
NTP Status Outband management LAN no shutdown PE-2
=========================================================================== 192.9.200.162
Enabled : Yes Stratum :5 2.2.2.2
Admin Status : up Oper Status : up
Server enabled : No 7750 SIM: none
Server keyId
System Ref Id : 10.1.1.1 Auth Check : Yes 1/1/1
PE-1 1/1/2
192.9.200.161 client client
=============================================================================
NTP Active Associations 1.1.1.1
============================================================================= 1/1/3
State Remote Reference ID St Type Auth Poll R Offset
----------------------------------------------------------------------------- 1/1/2 1/1/3 1/1/1
chosen 4.4.4.4 192.9.200.10 4 srvr none 1024 y -0.039
candidate 3.3.3.3 8.8.8.8 5 srvr none 1024 y 5.252

1/2/1
1/2/2
1/2/3
1/2/3

7750 SR-12A:PE2# show system ntp all detail


server PE-4 ===========================================================================
client client
NTP Status serverserver client server
192.9.200.164 1/1/2 1/2/1
===========================================================================
4.4.4.4 Enabled : Yes Stratum : 13
NTP Server Admin Status : up Oper Status : up
192.9.200.100 NTP Server :No Auth Check : Yes
System Ref Id : 3.3.3.3
Auth Errors :o Auth Errors Ignored : 0
7750 SR-12
Sratum 3 PE-3
Auth Key Id Errors : o Auth Key Type Errors : 0
192.9.200.163
============================================================================= 3.3.3.3
NTP Servers/Peers
=============================================================================
PE-4 box failure : case 2
State Remote Reference ID St Type Auth Poll R Offset
-----------------------------------------------------------------------------
reject 4.4.4.4 INIT - srvr ok 512 n 0.000
chosen 3.3.3.3 192.9.200.100 4 srvr ok 64 y -58.197
All Rights Reserved Alcatel-Lucent 2007
7750 SR Core I R5.0
=============================================================================

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 21


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 22

Possible NTP states


State Description
Chosen 7KHSHHULVFKRVHQDVWKHVRXUFHRIV\QFKURQL]DWLRQ

Reject The peer is rejected and will not be used for synchronization.
Rejection reasons could be the peer is unreachable, the peer is
synchronized to this local server so synchronizing with it would
create a sync loop, or the synchronization distance is too large.

Invalid The peer is not maintaining an accurate clock. This peer will not be
used for synchronization.

Excess The peer's synchronization distance is greater than ten other


peers.This peer will not be used for synchronization.

Outlayer The peer is discarded as an outlayer. This peer will not be used for
synchronization.

Candidate The peer is accepted as a possible source of synchronization.

Inferior The peer is an acceptable source of synchronization, but it's


synchronization distance is greater than six other peers.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 22


Lab Exercises NTP and CRON Network Timing Protocol(NTP) 8 12 23

Trap : No / Yes servers available


TRAP tmnxNtpNoServersAvail

 Generated when all of the configured servers, broadcast/multicast


servers, or peers are unreachable.

TRAP tmnxNtpServersAvail
 Generated when one of the configured servers, broadcast/multicast
servers, or peers is found.
 The "server available"trap does not mean that "synchronization" has been
achieved, just that an NTP server's pkts have been received.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

Show log event-coltrol NTP


2001 tmnxNtpAuthMismatch WA gen 0 0
2002 tmnxNtpNoServersAvail MA gen 0 0
2003 tmnxNtpServersAvail MI gen 0 0
2005 tmnxNtpMaxFreqDftExceed MI gen 0 0
2006 tmnxNtpUtcOffsetExThreshold MI gen 0 0
2007 tmnxNtpUtcOffsetInThreshold MI gen 0 0
2008 tmnxNtpOperChange WA gen 0 0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 23


Lab Exercises NTP and CRON
Network Timing Protocol(NTP) 8 12 24

Remarks
 www.ntp.org
 ntp multicast is only supported on management interface.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

Show log event-coltrol NTP


2001 tmnxNtpAuthMismatch WA gen 0 0
2002 tmnxNtpNoServersAvail MA gen 0 0
2003 tmnxNtpServersAvail MI gen 0 0
2005 tmnxNtpMaxFreqDftExceed MI gen 0 0
2006 tmnxNtpUtcOffsetExThreshold MI gen 0 0
2007 tmnxNtpUtcOffsetInThreshold MI gen 0 0
2008 tmnxNtpOperChange WA gen 0 0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 24


Do not delete this graphic elements in here:

Any Questions

7750 SR Core I R5.0


All Rights Reserved Alcatel-Lucent 2007

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 25


Do not delete this graphic elements in here: Section 8
Lab Exercises
Module 12
CRON SCRIPTING

7750 SR Core I R5.0


All Rights Reserved Alcatel-Lucent 2007
Lab Exercises NTP and CRON CRON 8 12 27

 What ?
 Enables users to execute CLI scripts (groups of commands)
automatically at a specified time/date or interval.

 Why ?
 Timed reboot
 Scheduled SAA tests
 Peer turn up
 Management tasks (e.g. config backups)
 ...

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 27


CRON
Lab Exercises NTP and CRON 8 12 28

TO DO

O
- Pizza
- Fruit
-shopping (see TO DO) - Beer
-be back before 3pm
-put stuff in fridge !!! Post letter
Pick up laundry

Schedule: Action: Script:

-When ? -Script ? - What to do ?


-Interval ? -Results ?
-Action ? -Timing ?

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 28


Lab Exercises NTP and CRON
CRON script 8 12 29

 The CRON script:

A:PE-1# configure cron script ?


- no script <script-name> [owner <script-owner>]
- script <script-name> [owner <script-owner>]

<script-name> : [32 chars max]


<script-owner> : [32 chars max] Default - "TiMOS CLI"

[no] description - Description for this CRON script


[no] location - Location of script to be scheduled
[no] shutdown - Administratively enable/disable the CRON script

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 29


CRON action
Lab Exercises NTP and CRON 8 12 30

 The CRON action:

A:PE-1# configure cron action ?


- action <action-name> [owner <action-owner>]
- no action <action-name> [owner <action-owner>]

<action-name> : [32 chars max]


<action-owner> : [32 chars max] Default - "TiMOS CLI"

expire-time - Maximum amount of time to keep the run history status


entry from a script run
lifetime - Maximum amount of time the script may run
max-completed - Maximum number of script run history status entries to
keep
[no] results - Location to receive CLI output display of a script run
[no] script - Script to run
[no] shutdown - Administratively enable/disable CRON action

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 30


CRON schedule
Lab Exercises NTP and CRON 8 12 31

 The CRON schedule:

A:PE-1# configure cron schedule ?


- no schedule <schedule-name> [owner <schedule-owner>]
- schedule <schedule-name> [owner <schedule-owner>]

<schedule-name> : [32 chars max]


<schedule-owner> : [32 chars max] Default - "TiMOS CLI"

[no] action - Action parameters for this schedule


[no] day-of-month - Configure the days of the month for CRON schedule
[no] description - Description for this CRON schedule
[no] hour - Configure hour for CRON schedule
[no] interval - Interval between each periodic schedule run
[no] minute - Configure minute for CRON schedule
[no] month - Configure month for CRON schedule
[no] shutdown - Administratively enable/disable the CRON schedule
type - Type of schedule
[no] weekday - Configure week day for CRON schedule

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 31


CRON
Lab Exercises NTP and CRON 8 12 32

The configuration of an SAA task using CRON is a 5 step process

1. Configure an SAA test as shown previously

2. Write a script using Notepad with the SAA test as a line in the script
a.Save the script with a easily recognisable name
b.FTP the script to a Compact Flash,preferably CF1:\ or CF2:\ or to a server

3.Configure a CRON Script with the location as the location of the script on the Compact Flash

4.Configure a CRON Action specifying the script configured in para 3 and also the location of where to send
results, this is most likely the same Compact Flash as the Script in para 2 is stored

5. Configure a CRON Schedule with the action specified in para 4 and a schedule type and periodicity

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 32


Lab Exercises NTP and CRON
CRON example SAA tests 8 12 33

 Scheduled SAA tests:


 Every 15 minutes, start the SAA lsp25 lsp-ping test and put result on flash.

configure cron
File dir cf3:\saa*
schedule "saa
type periodic 04/02/2006 11:45a 3791 saa_20060402-094514.out saa_test_result_1
interval 900 04/02/2006 12:00p 3791 saa_20060402-100014.out
action "saa" 04/02/2006 12:15p 3791 saa_20060402-101514.out
no shutdown ...
exit saa_test_result_2

action "saa"
results "cf3:\saa"
script "saa" File type cf3:\myscript
no shutdown
exit show time
echo '=========='
script "saa" clear saa lsp25
location "cf3:\myscript" oam saa start lsp25
no shutdown sleep 10
exit show saa lsp25

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 33


CRON configuration notes
Lab Exercises NTP and CRON 8 12 34

 CRON script:
 The script can be stored local (CF) or remote (FTP) and points to a CLI script
file

 CRON action:
 A results location (local or remote) must be specified and points to the file
that will be used for output redirection. For each scheduled run, a timestamp is
added to the configured results filename: _YYYYMMDD-hhmmss.out
 The max-completed and expire-time parameters define how long an
action execution record is kept in the script run history (see later)
 The lifetime parameter specifies how long a script may run. It is a protection
against a mis-configured scripts which runs away.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 34


CRON configuration notes
Lab Exercises NTP and CRON 8 12 35

 CRON schedule:
 The schedule type can be one of :
 Periodic (default): the CRON job is scheduled at regular time intervals.
The interval must be specified. (in seconds; min. 30 seconds)
 Calendar: the CRON job is scheduled at calendar intervals. For example:
every Tuesday at 05:00 am
 Oneshot: the CRON job is scheduled once at a specific day and time. For
example: Tuesday, May 2nd 2006 at 21:00.
When the action is scheduled, the schedule goes in operational down
(finished) state.
 For calendar and oneshot, the minimum config must include: Month, weekday, day-of-
month, hour and minute
 For each of the parameters month, day-of-month, weekday, hour and minute, multiple
values can be configured. The action is scheduled for each corresponding value.
 When both day-of-month and weekday resolve to the same day, the action is only
scheduled once.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 35


Lab CRON Configuration
The objective of this lab is to configure a CRON job.

1. Configure an SAA test

A:PEx#configure saa test sdpping where sdpping is the test name


A:PEx>config>saa>test$ type sdp-ping x resp-sdp y (using suitable sdps on your
router)
A:PEx>config>saa>test$ no shutdown
A:PEx>config>saa>test$ exit
A:PEx#show saa

2. Run your saa test to prove it works

A:PEx#oam saa sdpping start (or stop) to start the test


A:PEx#show saa sdpping - to see results
A:PEx#clear saa sdpping - to clear results (this
also stops the test)

3. Create your test script using notepad

show time
echo ==========
clear saa sdpping
oam saa sdpping start
sleep 20
show saa sdpping

Save the script as saa.txt and ftp it to cf3:\ on a router or cf2:\ on a Sim

4. Create your cron job

A:PEx#configure cron schedule 60 secs


A:PEx>config>cron>sched#type periodic
A:PEx>config>cron>sched#interval 60
A:PEx>config>cron>sched#action run_saa_test
A:PEx>config>cron>sched#no shutdown

A:PEx#configure cron action run-saa-test


A:PEx>config>cron>action#results cf2:\sdp-ping (this appends the name sdp-
ping to the results file that is stored on cf3)
A:PEx>config>cron>action#script run SAA test
A:PEx>config>cron>action#no shutdown

A:PEx#configure cron script run SAA test


A:PEx>config>cron>script#location cf2:\saa.txt

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 36


Lab CRON Configuration
5. To check results, navigate to cf3 or cf2
A:PE3>file cf2:\ # dir

*A:PE1>file cf2:\ # dir


Volume in drive cf2 on slot A is CF2.
Volume in drive cf2 on slot A is formatted as FAT32.
Directory of cf2:\
09/19/2007 02:09p 5407 PE1.ndx
03/29/2006 06:08p <DIR> images
09/19/2007 10:48a 5362 PE1.ndx.1
09/19/2007 02:09p 22362 PE1.cfg
09/18/2007 05:05p 5317 PE1.ndx.2
09/19/2007 10:48a 20138 PE1.cfg.1
09/25/2007 12:33p <DIR> log
09/18/2007 04:58p 5317 PE1.ndx.3
09/18/2007 05:05p 19976 PE1.cfg.2
09/18/2007 12:13p 16896 tech-support
09/18/2007 04:58p 19976 PE1.cfg.3
09/18/2007 02:11p 4537 PE1.ndx.4
09/18/2007 12:04p 4402 PE1.ndx.5
09/18/2007 02:11p 16715 PE1.cfg.4
09/25/2007 12:50p 89 saa.txt
09/18/2007 12:04p 15426 PE1.cfg.5
09/25/2007 01:29p 3350 sdpping_20070925-132917.out
09/25/2007 01:30p 3350 sdpping_20070925-133017.out
09/25/2007 01:31p 3350 sdpping_20070925-133117.out
09/25/2007 01:32p 3350 sdpping_20070925-133217.out
09/25/2007 01:33p 3350 sdpping_20070925-133317.out
19 File(s) 178670 bytes.
2 Dir(s) 39855685632 bytes free.

These .out files are generated according to interval set in your cron schedule

6. To check the results in the .out file

A:PE3>file cf2:\ # type sdpping_20070925-132917.out


A:PE3# show time
Thu Aug 25 13:44:07 UTC 2007
A:PE3# echo "========="
=========
A:PE3# clear saa sdpping
A:PE3# oam saa sdpping start
A:PE3# sleep 20
A:PE3# show saa sdpping

===============================================================
SAA Test Information
================================================================
Test name : sdpping
Owner name : TiMOS CLI
Administrative status : Enabled
Test type : sdp-ping 166 resp-sdp 167
Test runs since last clear :1
Number of failed test runs :0
Last test result : Success
Press any key to continue (Q to quit)

7. show cron action run-saa-test


clear cron action run-saa-test (needs to be performed prior to
removing the cron config)

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 37


CRON configuration notes
Lab Exercises NTP and CRON 8 12 38

 Show & tools commands:


# show cron script [<script-name>] [owner <owner-name>]
# show cron action [<action-name>] [owner <action-owner>]
# show cron schedule [<schedule-name>] [owner <owner-name>]

# tools perform cron action stop [<action-name>] [owner <action-owner>] [all]

 Clear commands:
# A:PE-1# clear cron action completed ?
- completed [<action-name>] [owner <action-owner>]

<action-name> : [32 chars max]


<action-owner> : [32 chars max] Default - "TiMOS CLI"

 There is no CRON debug available

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 38


CRON configuration notes
Lab Exercises NTP and CRON 8 12 39

 Tips and tricks


 Results file management:
 periodic and/or calendar CRON scripts can generate numerous results
files
 The operator must take care of results file management (delete old
files) to save disk space.
 Weekday & Day-of-month:
 Mandatory parameters for schedule types oneshot and calendar
 Default they are unconfigured (no day-of-month, no weekday)
 If you want to configure a weekday, independent from the day-of-
month, configure day-of-month all
 If you want to configure a day-of-month, independent from the
weekday, configure weekday all

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 39


CRON script run history
Lab Exercises NTP and CRON 8 12 40

 For each scheduled action, an action execution record is kept in the script
run history:

Record is deleted when:


A:PE-1# show cron action myaction The number of records in the
. . . script run history exceeds the
configured max-completed
===============================================================================
Script Run History Status Information the configured expire-time
fires
-------------------------------------------------------------------------------
Script Run #25
-------------------------------------------------------------------------------
Start time : 2006/03/17 14:56:02 End time : 2006/03/17 14:56:02
Elapsed time : 0d 00:00:00 Lifetime : 0d 00:00:00
State : terminated Run exit code : noError
Result time : 2006/03/17 14:56:02 Keep history : 0d 09:07:39
Error time : never
Results file : cf2:/cron-results/myscript_20060317-145600.out
Run exit : Success
-------------------------------------------------------------------------------

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 40


Lab Exercises NTP and CRON
CRON script run history 8 12 41

 As long as there are action execution records (run history entries) attached
to an action, the action cannot be shutdown. Use the clear command to
force deletion:

A:PE-1>config>cron>action# info
----------------------------------------------
results "cf2:/cron-results/myscript"
script "myscript" owner "admin"
no shutdown
----------------------------------------------
A:PE-1>config>cron>action# shutdown
MINOR: SYSTEM #2518 Cannot 'shutdown' because there are associated
run history entries

A:PE-1# clear cron action completed


WARNING: CLI Cleared run history entry #3347 for action "myaction
created by owner "admin".

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 41


CRON interaction with set-time
Lab Exercises NTP and CRON 8 12 42

 Schedule type calendar:


 when you set the time to something different, the CRON job will be scheduled
correctly based on the time change that was made. It dynamically adjusts to the
change made to the system time.
 Schedule type oneshot:
 If a oneshot CRON schedule is finished and then you adjust the time so that it is
before the one-shot's schedule, the CRON script will fire again.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 42


Lab Exercises NTP and CRON
CRON security 8 12 43

 The default owner for CRON schedule, action and script is TiMOS-
CLI.
 It is recommended that the user who configures CRON have the
same access rights as the "admin" user. In the current release a
user can workaround his profile restrictions with CRON scripts.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 43


Lab Exercises NTP and CRON
CRON example management tasks 8 12 44

 Configuration backup:
 push each Friday night the running config to a centralised server sample script
sample output
 This task could be implemented using a calendar CRON job:

script "config-backup"
location "ftp://user:pwd@192.168.1.1/./cron/conf_backup_221"
no shutdown
exit schedule "config-backup"
action "config-backup"
type calendar
action "config-backup" day-of-month all
results "ftp://user:pwd@192.168.1.1/./ hour 23
cron/results/conf_backup_221" minute 50
script "config-backup" month all
no shutdown weekday friday
exit no shutdown
exit

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 44


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 45

#--------------------------------------------------
echo "Cron Configuration"
#--------------------------------------------------
cron
action "scheduled reboot" owner "TiMOS CLI"
no results No result file specified in action
script "scheduled reboot" owner "TiMOS CLI"
max-completed 1
expire-time 3600
lifetime 3600
no shutdown
exit
exit

3003 2006/03/15 16:35:00.64 UTC MAJOR: SYSTEM #2102 - CRON script


"CRON action "scheduled reboot" created by "TiMOS CLI" run #1 failed with error:
Failed to open results output file URL: "_20060315-163500.out""

3002 2006/03/15 16:35:00.64 UTC WARNING: SYSTEM #2007 - SYSTEM


"Launch Owner:"TiMOS CLI" Launch Name:"scheduled reboot" Run: 1 managed object created"

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 45


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 46

A:PE-1# show cron action

===============================================================================
CRON Action Information
===============================================================================
Action : scheduled reboot
Action Owner : TiMOS CLI
Administrative status : enabled
Operational status : enabled
Script : scheduled reboot
Script owner : TiMOS CLI
Script source location : ftp://*******:*******@138.203.18.50/./cron/reboot
Script results location : cf2:/cron-results/reboot
Max running allowed :1
Max completed run histories :1
Max lifetime allowed : 0d 01:00:00 (3600 seconds)
Completed run histories :1

There was no result file


Executing run histories :0
Initializing run histories :0
Max time run history saved
Script start error
: 0d 01:00:00 (3600 seconds)
: Failed to open results output file URL:"_20060316-163900.out" configured in the cron
Last change
Max row expire time
: 2006/03/16 16:39:50
: never
action
===============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 46


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 47

===============================================================================
Script Run History Status Information
-------------------------------------------------------------------------------
Script Run #1
-------------------------------------------------------------------------------
Start time : 2006/03/24 23:50:01 End time : 2006/03/24 23:50:02
Elapsed time : 0d 00:00:01 Lifetime : 0d 00:00:00
State : terminated Run exit code : genericError
Result time : 2006/03/24 23:50:02 Keep history : 0d 00:57:21
Error time : 2006/03/24 23:50:02
Results file : ftp://*******:*******@192.168.1.1/./cron/results_20060324-235
000.out
Run exit : Failed NoCRON
result script
file specified
containsinerror
action
Error : CLI command error
===============================================================================

7398 2006/03/24 23:50:01.95 UTC MAJOR: SYSTEM #2102 - CRON script


"CRON action "config-backup" created by "TiMOS CLI" run #1 failed with error: CLI command error"

7397 2006/03/24 23:50:00.69 UTC WARNING: SYSTEM #2007 - SYSTEM


"Launch Owner:"TiMOS CLI" Launch Name:"config-backup" Run: 1 managed object created"

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 47


Lab Exercises NTP and CRON CRON troubleshooting / error messages 8 12 48

2998 2006/03/15 16:00:00.64 UTC MAJOR: SYSTEM #2101 - CRON schedule


"CRON schedule "Maintenance reboot" created by "TiMOS CLI" failed with error:
Failed to trigger action"

No action
configured

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 48


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 49

3009 2006/03/15 16:45:02.51 UTC WARNING: SYSTEM #2008 - SYSTEM


"Launch Owner:"TiMOS CLI" Launch Name:"scheduled reboot" Run: 1 managed object deleted"

3008 2006/03/15 16:45:02.51 UTC MAJOR: SYSTEM #2102 - CRON script


"CRON action "scheduled reboot" created by "TiMOS CLI" run #2 failed with error:
The script file was not found."

3007 2006/03/15 16:45:00.64 UTC WARNING: SYSTEM #2007 - SYSTEM


"Launch Owner:"TiMOS CLI" Launch Name:"scheduled reboot" Run: 2 managed object created"

#--------------------------------------------------
echo "Cron Configuration" Wrong remote
#-------------------------------------------------- location
configured
cron
script "scheduled reboot"
location "ftp://user:pwd@192.168.1.1/cron/reboot"
no shutdown
exit
exit

A:SR-221# file dir "ftp://user:pwd@192.168.1.1/cron/reboot"


MINOR: CLI Can't open /cron/.

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 49


CRON troubleshooting / error messages
Lab Exercises NTP and CRON 8 12 50

A:SR-221# show cron schedule

===============================================================================
CRON Schedule Information
===============================================================================

Schedule : Maintenance 15/3 15:45


Schedule owner : TiMOS CLI
Description : none
Administrative status : enabled
Operational status : enabled
Action : scheduled reboot
Action owner : TiMOS CLI
Script : scheduled reboot
Script Owner : TiMOS CLI

The CRON job will not run.


Script source location : ftp://*******:*******@192.168.1.1/cron/reboot
Script results location : none
Schedule type
Interval
:
:
oneshot
n/a -> Check the config
Next scheduled run
Weekday
:
:
Not scheduled
none
here: mandatory
Month : march parameter for oneshot
schedule (weekday) is not
Day of month : 15
Hour : 15

configured
Minute : 45
Number of schedule runs : 0
Last schedule run : never
Number of schedule failures : 0
Last schedule failure : no error
Last failure time : never

===============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 50


Lab Exercises NTP and CRON CRON troubleshooting / error messages 8 12 51

A:SR-221# show cron schedule myschedule

===============================================================================
CRON Schedule Information
===============================================================================
Schedule : myschedule
Schedule owner : TiMOS CLI
Description : none
Administrative status : enabled
Operational status : enabled
Action : myaction
Action owner : admin
Script : myscript
Script Owner : admin
Script source location : cf2:scripts/myscript
Script results location : cf2:/cron-results/myscript
Schedule type : calendar
Interval : n/a The CRON job will not run.
-> Check the config
Next scheduled run : Bad configuration
Weekday : none

here: mandatory parameter


Month : march
Day of month : 19
Hour
Minute
: 21
: 55
for calendar schedule
Number of schedule runs
Last schedule run
: 0
: never
(weekday) is not configured
Number of schedule failures : 0
Last schedule failure : no error
Last failure time : never

===============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 51


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 52

A:SR-221# show cron schedule oneshot

===============================================================================
CRON Schedule Information
===============================================================================
Schedule : oneshot
Schedule owner : TiMOS CLI
Description : none
Administrative status : enabled
Operational status : enabled

The CRON job will not run.


Action : myaction
Action owner : admin

-> Check the config


Script : myscript
Script Owner : admin
Script source location
Script results location
: cf2:scripts/myscript
: cf2:/cron-results/myscript here: no schedule type
Schedule type
Interval
: periodic
: 0d 00:00:00 (0 seconds)
configured defaults to
Next scheduled run : No timer is set periodic with interval = 0s
Weekday : sunday monday tuesday wednesday thursday friday
saturday
Month : march
Day of month : 20
Hour : 21
Minute : 18
Number of schedule runs : 0
Last schedule run : never
Number of schedule failures : 0
Last schedule failure : no error
Last failure time : never

===============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 52


Lab Exercises NTP and CRON
CRON troubleshooting / error messages 8 12 53

A:SR-221# show cron schedule sec owner readonly

===============================================================================
7031 2006/03/20 09:36:03.81 UTC MAJOR: SYSTEM #2101 - CRON schedule
CRON Schedule Information
"CRON schedule "sec" created by "readonly" failed with error: MINOR:
===============================================================================
Schedule : sec AGENT #18 Unknown name error"
Schedule owner : readonly
Description : none
Administrative status : enabled action "sec" owner "readonly"
Operational status : enabled results "cf2:/cron-results/myscript"
Action : sec script "myscript" owner "admin"
Action owner : TiMOS CLI
no shutdown
Script name : none
Script owner : none exit
Script source location : none schedule "sec" owner "readonly"
Script results location : none interval 90
Schedule type : periodic action "sec"
Interval : 0d 00:01:30 (90 seconds) no shutdown
Next scheduled run : 0d 00:01:29 exit
Weekday : none
Month : none
Day of month : none

The action owner is not


Hour : none
Minute : none
Number of schedule runs
Last schedule run
: 1
: 2006/03/20 09:36:04 configured in the
Number of schedule failures : 1
Last schedule failure : inconsistent name
schedule.
Last failure time : 2006/03/20 09:36:04

===============================================================================

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 53


Do not delete this graphic elements in here:

Any Questions

7750 SR Core I R5.0


All Rights Reserved Alcatel-Lucent 2007

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 54


Lab Exercises NTP and CRON 8 12 55

Switch to notes view!

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

This page left blank intentionally.

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 55


Lab Exercises NTP and CRON 8 12 56

End of Module
NTP and CRON

All Rights Reserved Alcatel-Lucent 2007


7750 SR Core I R5.0

All Rights Reserved 2007, Alcatel-Lucent

Section 8 Module 12 Page 56

Vous aimerez peut-être aussi