06-08-2015 05:43 PM
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?
06-09-2015 07:37 AM
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.
06-12-2015 03:12 AM
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:
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
Example of a creating a custom field via PERL - https://community.infoblox.com/forum/network-automation/adding-custom-device-field-api
06-15-2015 05:05 PM
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?
06-16-2015 08:05 AM
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.
06-17-2015 03:44 AM
FYI PS is great at helping doing this kind of Knowlege transfer
O wait, I'm in the PS group(shameless self promoting)
06-17-2015 07:20 AM
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.
08-14-2018 12:59 PM
You will have to use PERL or Python
Which do you want to use?
08-14-2018 01:03 PM
08-14-2018 01:26 PM
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.
08-14-2018 01:34 PM
Please start a new thread and give me some more details, I have a few different ideas