Maruf Yunus, Senior Lab Architect, Juniper Networks

Schedule Junos Operational Commands Without Using Scripts

Learning Bytes Operations
Maruf Yunus Headshot
How-to demonstration showing a screenshot of a Linux server command line window that’s accessing a Juniper VMX router. 

Learning Byte: The why and the how of automating operation commands

In this hands-on demonstration from Juniper’s Maruf Yunus, you’ll learn how to run commands at regular intervals or a fixed time of day to make it easier to troubleshoot problems and monitor your network. 

Show more

You’ll learn

  • Why it’s not ideal to use scripts to run these commands

  • How to instead use the Event-Options feature to perform predefined tasks 

  • The steps for running a command to manually generate events

Who is this for?

Network Professionals Security Professionals


Maruf Yunus Headshot
Maruf Yunus
Senior Lab Architect, Juniper Networks 



0:02 [Music]

0:11 hello

0:12 uh welcome to uh juniper network's

0:15 learning byte

0:15 my name is marvel venus and i'm a lab

0:17 architect with education services lab

0:18 team

0:19 in this learning bike i'm gonna show you

0:21 how to schedule

0:22 juno's operational commands without

0:25 using scripts in an automatic fashion

0:27 actually

0:27 so scheduling juno's operational

0:29 commands actually

0:30 it can be handy for monitoring and

0:33 troubleshooting purposes

0:34 you may have certain operational

0:36 commands that you want to run at a given

0:38 time

0:39 and you can do so through the juno's

0:42 event

0:42 options feature okay which allows you to

0:45 perform uh pre-defined tasks

0:47 and that are triggered based on the

0:49 following types of events such as system

0:51 generated events and manually generate

0:52 events

0:53 okay for our uh purpose uh to run a

0:56 specific command cla command we'll be

0:58 using manually generate events which is

1:00 basically user events

1:02 and you could use scripts to accomplish

1:04 this task

1:05 but you know sometimes it may be hard to

1:08 figure out if there's an issue with

1:09 scripts for example

1:10 like if you're using a script instead of

1:12 running specific commands and and also

1:15 most of the network admins they know cli

1:18 commands

1:18 more than they know scripts so you don't

1:20 need any advanced

1:21 scripting knowledge to to accomplish

1:23 this task okay so this is very

1:26 uh handy in many cases so without

1:28 further ado i'm gonna

1:30 go to my uh how to demonstration uh

1:33 so i'm gonna so i have this server

1:36 linux server which is access to my vmx

1:40 router that i'm going to go in okay so

1:43 this is the

1:44 configuration it's running uh

1:48 vmx inside a kvm environment so you know

1:51 pretty basic configuration that is

1:54 running right now

1:55 there's nothing configured no event

1:57 options nothing configured

1:58 so i'm going to be running these

2:00 commands here to show you

2:01 i'm going to talk through it a little

2:02 bit so basically we're going to

2:05 set event options it's called generate

2:07 event

2:08 and the event options name is get status

2:10 and we're going to select time of the

2:12 day so we're going to run it in a

2:13 specific time of the day which i will

2:14 define pretty soon

2:15 so that i can i can show you it's

2:17 running in few minutes from now

2:19 and then where you define your time and

2:22 then

2:23 you basically uh you know set events

2:25 policy

2:26 you can configure the uh policy here

2:29 okay and then for that policy you're

2:32 gonna run these commands here so i'm

2:33 gonna be running uh

2:35 actually i'm going to run it and then

2:36 i'm going to show you in the

2:37 configuration tool so you can see the

2:38 better part

2:39 so these are the uh you know commands

2:41 that i'm running i'm going to run

2:42 show chassis fpc and the system uptime

2:46 and alarms

2:47 at that time which you'll define here

2:49 and the

2:50 output of this command will be you know

2:52 saved under

2:54 a file called router status there will

2:57 be some prefix to the file

2:58 which the system will automatically

3:00 generate which i'm defining here

3:03 output file name router status and it

3:05 will be

3:06 archived in local directory you can

3:09 archive to

3:10 remote locations as well but in this

3:13 case i'm going to use local

3:14 barcam directory here on this router

3:17 so uh let me check first what is the

3:20 time here

3:21 so i can show you something very quick

3:23 so right now it's uh 2201

3:25 let's try if it can do 2203

3:30 i'm gonna double check here

3:34 utc time

3:48 three zero zero

3:52 copy

3:58 another configuration mode

4:02 okay so coming

4:05 okay it shows these two uptime so we

4:08 still have time

4:09 yeah so we still have one minute so i'm

4:11 just gonna show uh

4:13 duration apparel back

4:17 back so yeah these are the

4:19 configurations that i added

4:20 so basically you know that's how it

4:22 looks like so it's defined the time of

4:24 the day

4:25 so every day this time we'll run this

4:27 commands

4:28 and this is my policy you know

4:32 the events is get status call the event

4:34 name

4:35 custom event name and then execute these

4:37 commands

4:38 which are here you can add more commands

4:40 i could add more commands here

4:42 and then the file output name is here

4:44 and a local directory

4:46 and then bar temp will be the

4:48 destination so

4:49 pretty simple i think

4:53 let me see the time

4:56 okay almost there

5:00 few seconds i hope okay

5:04 now let's do file list bar temp

5:09 there you go created the uh output file

5:12 here so it basically has the

5:14 name of the router with the timestamp so

5:16 that you know it puts the timestamp

5:18 there

5:18 and the router charges the file name i

5:20 defined so it's there so if i do a file

5:23 show your temp

5:28 it does uh output to xml format so that

5:31 you can use it later

5:33 if you are kept to a specific site you

5:35 know if the server

5:36 some http server or something like that

5:39 or a specific central server

5:40 you can take those information and do

5:42 some reporting if you want it as well

5:45 but this is pretty much it like you know

5:46 took the uh you know

5:48 system uptime stuff uh fpc stuff uh

5:52 it's all uh all there okay

5:57 so i hope this helps thank you for

5:59 watching

6:01 visit the juniper education services

6:03 website

6:04 to learn more about courses view our

6:07 full range of classroom

6:08 online and e-learning courses

6:12 learning paths industry segment and

6:14 technology specific

6:16 training paths juniper networks

6:19 certification program

6:20 the ultimate demonstration of your

6:22 competence and

6:23 the training community from forums to

6:26 social media

6:27 join the discussion

6:34 you

Show more