cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2216
Views
0
Helpful
3
Replies

Cisco Prime copy file adding date

p.juarezponte
Level 1
Level 1

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.

Prime template.PNG

 

This is the variable:

imagen.png

 

And this is how it is copied to scp server:

Prime ficheros.PNG

 

Maybe it's possible to make it directly from the switch.

Any help would be welcome.

3 Replies 3

Alexander Onnikov
Cisco Employee
Cisco Employee

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!

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?

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.