Reply

Export logfile at the end of script

DaveHartburn
Techie
Posts: 14
5868     0

I have written a script to gather some baseline information from our routers, using the archive command, to gather live routing tables and the like:

Action-Commands:
    SKIPERROR: on
    ARCHIVE ($name.baseline): show ip route
    ARCHIVE ($name.baseline): show ip ospf neighbor
    ARCHIVE ($name.baseline): show lldp neighbor

    ......

 

This works great and in the job tab does generate files router1.baseline.txt, router2.baseline.txt etc. However that is not the most accessible place to have them. Is there a way to automatically export the ARCHIVE generated files at the end of job run? They will be going to a linux server, so tftp, scp, ftp etc are all valid option.

 

Alternatively is there a way to know what the path will be and perform a pull from the linux box?

Re: Export logfile at the end of script

Adviser
Posts: 406
5869     0

The most recently created ZIP file will also be available for download directly from the NetMRI, using this URL: http://<NetMRI_IP>/netmri/ccs/tx/common/GetArchive.tdf.

 

Sif



Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

Re: Export logfile at the end of script

DaveHartburn
Techie
Posts: 14
5869     0

That works for doing a manual grab. I wanted to run a number of parrallel jobs at 4am then push them out to our management server. You can't do something like a wget on that URL and if jobs are running in parallel, you can never be sure which output you are grabbing.

 

An alternative is to use the redirect commands on the router firmware and build the files up , one command at a time. It would be nicer if NetMRI could package these up for me and copy them out.

Re: Export logfile at the end of script

Adviser
Posts: 406
5869     0

That would be a good RFE, like you account team know about the request.

 

As for the bandaid Smiley Happy

I would make an external API call to run my first script at schedule time, check the status of the Job once completed download the file.  Then continue to loop though the reset of the jobs.

 

Sif

 

Here are some examples:

http://community.infoblox.com/t5/Network-Change-Configuration/Call-to-API-via-URL-and-passing-a-vari...

 


Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

Re: Export logfile at the end of script

DaveHartburn
Techie
Posts: 14
5869     0

Thanks, I will give that a look.

 

I've not touched the API yet, so time to learn something new Smiley Happy

Re: Export logfile at the end of script

Authority
Posts: 40
5869     0

Hi Dave,

A possible workaround that works pretty well for me.

In a perl script, write your desired logs into a file. And run a cronjob on the sandbox to transfer the files to your destination.

Re: Export logfile at the end of script

Adviser
Posts: 53
5869     0

Or write a Perl script that dumps the files to the local filesystem on the Sandbox and then have the Perl script ftp/tftp/scp the file to the remote destination. The ftp/tftp/scp executables should all be pre-installed in the Sandbox.

 

Thanks,

- Chris

 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You