04-18-2012 02:51 PM
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?
04-18-2012 03:34 PM
for this I would look into rpm rather then scripting. This might be a could start : http://www.juniper.net/techpubs/software/junos-sec
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.
04-18-2012 03:49 PM - edited 04-18-2012 03:52 PM
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/br
how to execute commands through event policies: http://www.juniper.net/techpubs/en_US/junos10.0/in
Let me know if you need help with the configuration! :-)
JNCIP-ENT, JNCIP-SEC, JNCIS-SP
(If this post helped you, please mark it as an "Accepted Solution"; kudos are also appreciated!)