Junos Automation (Scripting)
Reply
Visitor
jkeeton81@yahoo.com
Posts: 3
Registered: ‎04-06-2012
0

Running Pings to multiple devices at a certain time?

Hello,

Im just learning about these automation scripts.  My manager has tasked me with finding out a way to have our routers ping each other at a certain time of day and and generate a report with the results.  Can these scripts be set up to run at a specific time?

 

Thanks

Distinguished Expert
Screenie
Posts: 1,073
Registered: ‎01-10-2008
0

Re: Running Pings to multiple devices at a certain time?

Hi,

 

for this I would look into rpm rather then scripting. This might be a could start : http://www.juniper.net/techpubs/software/junos-security/junos-security10.0/junos-security-admin-guid...

best regards,

Screenie.
Juniper Ambassador,
JNCIA IDP AC WX JNCIS FW SSL JNCIP SEC ENT SP JNCI

If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.
Recognized Expert
Mattia
Posts: 198
Registered: ‎03-17-2010
0

Re: Running Pings to multiple devices at a certain time?

[ Edited ]
Hi,
besides what Screenie suggested (I'm not sure though that you can configure a probe to be triggered just at a specific time), if you want to practice with the event automation concepts, here is my suggestions!
You can configure a time-based event on the devices, which will be generated at a specific time. Then you can configure an event-policy in order to catch that event, and execute an event-script or a CLI command. Doing this, the script will be triggered at the time configured for the generated event ( of course you will have to synchronize your devices via NTP server).
Regarding the ping test, you have different options. You can use the rpc within an event script, and save the output of the script in a local or remote directory, or you could just let the event-policy execute a ping (with count 1) and store the output. With this second option you would not actually need to write a script, it can all be done via configuration.
Just to give you some reference documents:
- how to create time based events and to match them within an event-policy: page 90 of Juniper book "this week: applying Junos automation"
- an example of the usage of the ping rpc: http://code.google.com/p/junoscriptorium/source/browse/trunk/library/juniper/event/HA/track-ip/track... -
how to execute commands through event policies: http://www.juniper.net/techpubs/en_US/junos10.0/information-products/topic-collections/config-guide-...
Let me know if you need help with the configuration! :-)
bye
Mattia
.................................................................................
JNCIP-ENT, JNCIP-SEC, JNCIS-SP
(If this post helped you, please mark it as an "Accepted Solution"; kudos are also appreciated!)


Visitor
jkeeton81@yahoo.com
Posts: 3
Registered: ‎04-06-2012
0

Re: Running Pings to multiple devices at a certain time?

Thank you both for the information,  I will research this and let you know if I have any questions.

 

thank you again

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.