11-21-2019 07:32 AM
Hello team
I have been two days trying to implement a job and I hope someone can help me or at last tell me there is no way no do it.
I have a capture configured on two Cisco (9500 ans a 9300) devices.
I have made a job on Cisco Prime to launch the capture everyday because there is and issue on my environment that happens randomly but usually at 6:00 am and I don't want to wake up everyday on that time, obviously.
Well, the thing is that I send the job to start and stop the capture ang get the pcaps to analyze, but I want to send it (via ftp, tfp, scp...) in order to not overwrite ir everyday.
What I could't get is sending the copy adding the date to the name, trying to not overwrite every file is made everyday.
Could anybody point me in the good direction?
This is the feature template I made.
It copies the file adding the ip address, but I don't know how to add the date (or a sequence number or something like that) at the end.
This is the variable:
And this is how it is copied to scp server:
Maybe it's possible to make it directly from the switch.
Any help would be welcome.
11-25-2019 09:12 AM
Hello,
I do not think it is possible to do via Prime UI. It allows to add a variable to your script, but its value will be the same for all scheduled instances of the job.
But this can be done via Prime API. You can add a variable to your CLI template (integer or string) and prepare external script that will deploy this template.
API:
PUT-/op/cliTemplateConfiguration/deployTemplateThroughJob
Payload sample:
<cliTemplateCommand> <templateName>{Name of your template}</templateName>
<targetDevices> <targetDevice> <targetDeviceID>{ID of your device}</targetDeviceID> <variableValues> <variableValue> <name>{Variable name}</name> <value>{Variable value}</value> </variableValue> </variableValues> </targetDevice> </targetDevices> </cliTemplateCommand>
Hope this helps!
11-26-2019 03:43 AM
Hello Alexander,
I appreciate your comment but I have never worked with API.
I don't know how to do that steps or even where to start.
Could you detail your answer or point me in the good direction?
11-26-2019 08:03 AM
Hello!
You can start from reading the API documentation. It is available at https://your-pi/webacs/api/v1/ on your PI server. Or you can login to PI, click on the "gear" icon near the user name, and then click on REST APIs menu item.
I recommend to start with Getting Started (https://your-pi/webacs/api/v1/?id=getting-started) and Step-by-Step Tutorial (https://your-pi/webacs/api/v1/?id=tutorials). There are also few examples in different programming languages.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide