Reply
Highlighted

Script output to text

Authority
Posts: 15
3496     0

I have a user request to take the output of a script, run on multiple devices, and have it forwarded to him via e-mail. He also wants the oputput for all devices to be on a single page. So far I have unable to find an elegant way of doing this. Has anyone else run across the same type of request?

Hi William,

Authority
Posts: 40
3497     0

Hi William,

Do you use perl or ccs? In Perl, its easier.

Just open a file and print the output you want into it. Use a static file name, if you want output from all the jobs in a single file. If it was possible to serialize job execution, this would work elegantly. 

Make sure you write at the end of the script and in one attempt [Because while using a static file, multiple jobs will try and write into the same file at the same time]. This works well for a small number of devices [upto 30]. Running against a larger set will cause some errors [unable to write into text file...text file busy error] but you can rerun the job on errored devices. 

I do not know if you can capture session logs and write it to a file. If that is possible, let me know too.

 

 

We have some really cool in

Adviser
Posts: 373
3497     0

We have some really cool in NetMRI CCS called Archive C0mmand

ARCHIVE ($ipaddress-version): sh ver
ARCHIVE (
$ipaddress-running): sh running-config
ARCHIVE (
$ipaddress-startup): sh startup-config

Say you run this on 500 devices at the end it will give you1 lovely zip file

Once a job batch completes, all of the related ARCHIVE files will automatically be copied into a single ZIP file, which can be collected from the “Files” tab of the Job Viewer (not the Job Details Viewer):

 

This produced a nicely-named list of files like:

10.10.1.5-data.txt
10.10.1.5-oam.txt
10.10.1.5-finance.txt
10.100.5.1-data.txt
10.100.5.1-oam.txt
10.100.5-1-finance.txt

Download it and email it to the person.

Next option you can use PERL to to get the data an update a Custom Field, then you can generate a Report and send that to the person Smiley Happy

Example of a creating a custom field via PERL - https://community.infoblox.com/forum/network-automation/adding-custom-device-field-api

 

Sif

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

Custom device field report

Authority
Posts: 15
3497     0

I don't think the CSS "Archive" function will do the trick. The customer wants the results for all devices on a single document, not several documents in a zip file. I may be able to give him what he wants with the Custom Feild, but I'm not sure how to generate a report once the custom feilds have been set. Is there a guide somewhere for creating reports from custom feilds?

First, you would create a

Adviser
Posts: 357
3497     0

First, you would create a Device custom field in the UI (Settings > General Settings > Custom Fields) or via the API Sif mentioned above.

Then, you can create a report in Reports > Add Custom Report (button in the upper right). Choose "Devices" for the data type. In step 3 of the wizard, you will see your custom field as "Devices: <your field name>" and can add that to the report.

 

 

FYI PS is great at helping

Adviser
Posts: 373
3497     0

FYI PS is great at helping doing this kind of Knowlege transfer Smiley Happy

O wait, I'm in the PS group(shameless self promoting)

Sif

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

To add another option to the

MGriffin
Techie
Posts: 37
3497     0

To add another option to the mix, you could use a Custom Issue as well.

A Subscription could be used to automatically email the output. on issue raise; this is not near as pretty as a report, but could get the output desired.

Re: First, you would create a

Authority
Posts: 31
3497     0

How would you add the output from the script into the custom field?

Re: First, you would create a

Adviser
Posts: 373
3497     0

You will have to use PERL or Python

Which do you want to use?

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

Re: First, you would create a

Authority
Posts: 31
3497     0

PERL

Re: First, you would create a

Adviser
Posts: 373
3497     0

https://community.infoblox.com/t5/Network-Change-Configuration/Adding-a-custom-device-field-via-the-...

 

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

Re: First, you would create a

Authority
Posts: 31
3497     0

I have the same issue as the original poster. I need to run a show command on several devices, catenate all output into one file and then email it. The files are several hundred KB, so how do I send the output into a custom field? Also, this all needs to be automated and run on a weekly basis.

Re: First, you would create a

Adviser
Posts: 373
3497     0

Please start a new thread and give me some more details, I have a few different ideas 

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Showing results for 
Search instead for 
Do you mean 

Recommended for You