Confirming CLI commands before copying?

              Hi All,
                   Is there a way to confirm the cli commands inputted into a Nexus5k (NX-OS) Ver 4.1(3) N1(1), before copying it to start. The JunOS has a "commit check" command that will give a heads up if the commands you are about to put in are going to hose your network. The "checkpoint" function will get me back to an operational state, but, I would rather not have to dance while the network comes back to life.
Thanks All,
              Ron Clifford

Hi,
IOS-XR implements the commit feature and checks the validity of the config and it seems NX-OS does the same
http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus5000/sw/configuration/guide/cli_rel_4_0_1a/CLIConfigurationGuide/sm_rollback.html#wp1076261
Regards
Alain
Don't forget to rate helpful posts.

Similar Messages

  • EEM to verify cfg file before copy running

    I've scripted over the years in many languages. Just not TCL.
    I'm wondering the feasability of intercepting a copy tftp running command, and doing a simple sanity check before execution.
    Basically if my router/switch is hostname:R1, I want to copy the file to the local disk/flash, verify it has a hashtag with a hostname that MATCHES the existing box, and if so, copy said file into running.
    1) I realize that not all devices have the same storage, so eaither assume that I'm writing this for a specific platform, or get crazy on captuering the local resources.
    2) I know you can intercept CLI command and 'block' it. And supercede it with my own creations.
    3) I do not know if you can open local files, and scan them/read them.
    4) I do know that I can just execute a command to copy x running once I've passed my check.
    Any other ideas on this subject?
    I'm basically trying to prevent the copy tftp to running from being quite SO instant. Adding a level of "This is what is going to happen, are you sure?" That prompt isn't just are you sure you want to copy file x. But here IS file X, look at it... Now are you sure? Or, this hostname doesn't match the tag. Seems wrong... Are you sure?
    --Allen

    I'm not sure what you mean by hashtag, but you can certainly intercept the command and pre-check the file to be copied.  You can even prompt the user to make sure they know what will be happening.  If all the verification checks out, then all you need to do is exit with a non-zero status code.  That will cause the original command to execute.
    So bottom line is that everything you want to do sounds doable (of course that's without knowing what you mean by hashtag).

  • Erase Flash before copying?

    Hi
    If I get a new router, and try to copy a file from tftp to flash, it copies the file without disturbing what's there.
    If I erase the flash, from that point it always prompts me to erase the flash before copying and I have to explicity press N or ESC to prevent it being wiped.
    What changes this behaviour? Can I do something after the flash is erased the first time to stop this prompt appearing??
    Anyone?
    Thanks
    Aaron

    I had this same problem and always thought it was just me. This is all I can find which really doesn't help that much but gives a little insite on how it works:
    !--- On Class B Flash file systems, the router gives you the option of erasing
    !--- the existing contents of Flash memory before writing to it. If no free Flash
    !--- memory is available, or if no files have ever been written to Flash memory,
    !--- the erase routine is required before new files can be copied. If there is
    !--- enough free Flash memory, the router gives you the option of erasing the
    !--- existing Flash memory before writing to it. The system will inform you
    !--- of these conditions and prompt you for a response.
    !--- If you enter 'n' after the "Erase flash before writing?" prompt, the copy
    !--- process continues. If you enter 'y' and confirm the erasure, the erase
    !--- routine begins. Be sure to have ample Flash memory space before entering "n"
    !--- at the erasure prompt.
    I would also look into the 'squeeze' command. When i have an extra router my way i'll test it out.

  • How to Run Operating System Command Before/After Message Processing SAP PI

    Hi,
    We are trying to execute multiple commands via "Operating System Command Before/After Message Processing".
    When we use single command say for example cp or mv (copy or move) the commands get executed fine.
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt 
    /this works fine/
    when we club commands together or try to redirect the outputs of commands, none of the commands get executed.
    eg:
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    or
    wc -l %F > /var/opt/data/outbound/Test/Dummy.txt
    Is it possible to execute multiple commands or redirect the output  of commands without using a shell script? The PI server we are working on iis hosted on UNIX environment.

    Hi Harleen,
    try like this
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    instead of semicolon try this
    (1) &
    command1 & command2
    Execute Command1 and then execute Command2
    (2) &&
    command1 && command2
    Runs the command2 only when command1 doesn't Complete successfully
    (3) ||
    command1 || command2
    Runs the second command if the first command had an error
    (4) ()
    (command1 || command2) || (command3 & command4)
    Defines the order in which commands are to be executed
    Regards
    Suraj

  • Interactive CLI commands

    I'm quite new to EEM, so please bear with me.
    How can I handle interactive CLI commands. I want a script that detects when a configuration change has been made, and then copies the running configuration to a TFTP server.  This is what I have tried:
    event manager applet Configured
    event syslog pattern ".*%SYS-5-CONFIG_I.*"
    action 10 cli command "enable"
    action 20 cli command "copy run tftp"
    action 30 gets response
    action 40 puts "MyTFTPServer"
    action 50 gets response
    action 60 puts "MyRtr.run"
    action 70 end
    All that happens is:
    No.  Job Id Proc Status  Time of Event            Event Type        Name
    1    1      Actv abort    Mon May14 13:53:35 2012  syslog            applet: Configured
    2    2      Actv abort    Mon May14 13:53:46 2012  syslog            applet: Configured
    3    3      Actv abort    Mon May14 14:01:32 2012  syslog            applet: Configured
    4    4      Actv abort    Mon May14 14:02:11 2012  syslog            applet: Configured
    5    5      Actv abort    Mon May14 14:05:01 2012  syslog            applet: Configured
    6    6      Actv abort    Mon May14 14:06:18 2012  syslog            applet: Configured
    7    7      Actv abort    Mon May14 14:08:49 2012  syslog            applet: Configured
    (You see how many times I have tried to get it working ;-)  The problem seems to be the interactivity of the "copy run tftp" command.
    Can someone give me some guidance please?
    Kevin Dorrell
    Luxembourg

    OK, I got it
    event manager applet Configured
    event syslog pattern ".*%SYS-5-CONFIG_I."
    action 10 cli command "enable"
    action 20 cli command "copy run tftp" pattern "Address or name of remote host.*"
    action 30 cli command "MyTFTPServer" pattern "Destination filename.*"
    action 40 cli command "MyRtr.run"
    Kevin Dorrell
    Luxembourg

  • Brand new 2960X and 2960XR not responding to cli commands

    I have 2 brand new 2960X switches and neither are responding to cli commands via the RJ45 to DB9 cisco cable.  Text is displayed but when I hit enter on the keyboard nothing happens and the switches just sit at whatever the last boot ouput is. 2960-XR just sits at 'vlan1, changed state to up.....' and I am never prompted for the express setup and no response to any keyboard input. 
    I know the cable/keyboard works because I can connect it to a 2911 right beside the 2960's and have no problems using the same cable. 
    Anyone seen this before?
    Cisco IOS Software, C2960X Software (C2960X-UNIVERSALK9-M), Version 15.0(2)EX1, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2013 by Cisco Systems, Inc.
    Compiled Fri 28-Jun-13 13:20 by prod_rel_team
    Nov 22 10:49:54.277: %USB_CONSOLE-6-MEDIA_RJ45: Console media-type is RJ45.
    Nov 22 10:49:55.602: %LINK-3-UPDOWN: Interface FastEthernet0, changed state to down
    Nov 22 10:49:56.493: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/47, changed state to up
    Nov 22 10:49:56.493: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/48, changed state to up
    Nov 22 10:49:58.370: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/47, changed state to up
    Nov 22 10:49:58.412: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/48, changed state to up
    Nov 22 10:49:58.450: %PLATFORM_ENV-1-FAN_NOT_PRESENT: Fan is not present
    Nov 22 10:50:26.384: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

    Hello,
    Recieved today also 2 2960-x switches.
    Had the same issue...playing arround with secureCRT settings (rts/cts, xon/xoff etc) ...no results.
    Tried Putty and it worked right away ...indeed strange have never seen this before.
    Installed latest software 150.2ex4  still the same.
    regards michel

  • How to change to.pac file using CLI command ?

    I've asked this before but have not had much luck getting an easy fix.
    I need to change a large number of machines over to using a pac file instead of the current settings for secure and web proxys.
    It's not possible using 10.4 CLI command networksetup but I'm wondering if anyone may have another way of doing this ? Possibly a script or something ???
    Mitch

    Hi Min,
    You should move this question to Unified Communications Application community to get the expert answer on IP phone configuration. This community is for Cisco WebEx Meetings Server and Cisco Unified MeetingPlace products.
    Thank you.
    -Dejan

  • Execute Hidden/Undocumented CLI Commands

    Hello,
    I am running into an issue running some undocumented/hidden CLI commands via the EEM Applet.
    I guess this is due to the fact that the Applet checks whether the CLI Command exists and the command is "hidden" .
    Is there a way to disable CLI Command Check or possiby enable hidden commands specifically?
    Best regards,
    Tim
    EDIT:
    Specifically it is concerning show list in the following Applet:
    event manager applet memory_outputs
    event timer cron cron-entry "* */4 * * *" 
    action 010 cli command "enable"
    action 020 cli command "terminal exec prompt timestamp"
    action 030 cli command "show processes memory sorted | redirect tftp://10.10.10.20/show_process_cpu_sorted$_event_pub_sec"
    action 040 wait 10
    action 050 cli command "show memory alloc totals | redirect tftp://10.10.10.20/show_memory_alloc_totals$_event_pub_sec"
    action 060 wait 10
    action 070 cli command "show list | redirect tftp://10.10.10.20/show_list$_event_pub_sec"
    action 080 wait 10
    action 090 cli command "end"
    But it seems show list is not executed due to the default maxrun of 20 seconds. I have not had the chance to confirm this...

    Yeah, you definitely need to add "maxrun 50" (or higher) for this applet.  Note: you can execute any CLI command via EEM that you can manually.  EEM uses the same VTY infrastructure for executing CLI commands.

  • Ciscoworks cli commands

    Hi,
    I hv lms 2.6, and currently facing some issues DCR. i would like to know is there any cli commands in lms by which i can (1) export the dcr using cli, since the gui is giving dcr communication error..
    regards
    sec-it

    In LMS 2.6 I mostly see issues with daemons down because of certificates expired. Please check your certificates of server via NMSROOT/bin/perl NMSROOT/MDC/Apache/SSLUtil.pl and select option 1.
    If it says expired regenerate is via following procedure :
    Please try the following steps:
    1. Stop the daemon manager
    2. Regenerate the SSL certificate (Dont forget to start you shell/command prompt session as Administrator):
         *Remove server.*  files under NMSROOT\MDC\Apache\conf\ssl (take backup of all 4 files before deleting).
         *NMSROOT\bin\perl NMSROOT\MDC\Apache\ConfigSSL.pl -disable
         *NMSROOT\bin\perl NMSROOT\MDC\Apache\ConfigSSL.pl -enable
         *Fill all the details it request for.
         *Ensure that the following files are created under NMSROOT\MDC\Apache\conf\ssl :
    server.crt
    server.csr
    server.key
    server.pk8
    -Thanks

  • CLI commands to backup IOS

    When backing up the router IOS with the following command: Router# copy flash tftp: The IOS asks for the source file name. What is the correct source file name for the IOS?
    Thanks in advance.

    Hello Duane,
    >>What is the correct source file name for the IOS?
    the one that is listed in the show ver in the line System Image file
    System image file is "flash:c2600-i-mz.122-8.T5.bin"
    the part after the : can be enough if your router has only one flash filesystem otherwise you need to use also the part before the :
    Hope to help
    Giuseppe

  • Alert sound when using Command Cut, Copy

    Hi there
    I have what seems to be a strange but recurring problem on a particular website where I have to edit a lot of text and keywords around. I'm using an Apple Macbook running on 10.7.4, but also regularly use an iMac on 10.5.11, and on both computers whenever I use Command + Cut, Copy or Paste I have to endure my alert sound over and over again.
    I know I could simply mute my volume but it's very frustrating and I'd simply like to know why it's happening.
    I have posted in the forum of the website I'm using and no other Mac users have this problem.
    If it's a Command key problem why is it specific to the website I'm using? The alert sound doesn't happen repeatedly when I'm Command + Cutting, Copying or Pasting in any other application.
    It doesn't seem to be a problem with this website because no other users are reporting this.
    I came across a similar forum discussion here but after running Repair Disk Permissions the problem isn't solved.
    Any ideas would be much appreciated!

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • OS command before file processing in Sender File adapter

    Hi there,
    I'm having troubles running a os command from the sender file (NFS) adapter.  The batch file which I try to run is not getting executed at all.
    When I manually run the same batch file from the command prompt then it works perfectly.
    The OS command looks like this from the adapter config:
    myserver\xi\interface\in\dothis.bat
    I have also try with this notation
    G:\myserver\xi\interface\in\dothis.bat
    Please give me some tips how can I solve this problem, is there any way how can I debug the OS command? When I look at the adapter monitonr no errors are showed.
    Thanks for any tips.
    Roberto

    Hi all,
    The problem is solved.
    Issue: File Receiver Channel does not execute the OS Command before message processing.
    Reason: XI always expects an input file (in my case the sender communication channel) on the source folder. If no input files are found then the rest of the adapter configuration is not executed at all.
    In our scenario the OS command is responsible for retrieving the input files from a FTP server the adapter. SO XI will never trigger the OS Command.
    Solution: Place a dummy input file on the source folder , the sender adapter will always read in this file and put it back on the same location.(e.g. using a condition in the receiver determination).
    Thanks,
    Roberto

  • Confirmation in DA before refresh of a PPR region

    Apex 4.1.1.00.23
    I am working with an app that I am upgrading from v3.2 to 4.1.1.00.23 and I have a page/region that had some javascript in it that I am trying to move away from manual JS and into dynamic actions.
    The region in question is a tabular form with PPR turned on and the problem I'm having is that I wish to check if any of the checkboxes are checked and if so, display a confirmation message to the user before the region paginates. I want that if the user does NOT press OK to the confirmation that the pagination is cancelled.
    So I have a DA as:
    1. Before refresh of my region
    2. Conditional based on javascript expression (I have my own JS on the region that checks if any checkboxes are checked and it does work for sure) that checks if at least one checkbox is checked.
    <script language="javascript" type="text/javascript">
    function verifyCheckboxes()
      var checkboxes=document.getElementsByName('f01');
      if (checkboxes==null)
        return(false);
      else
        var vBoxChecked=false;
        for (var i=0;i<checkboxes.length;i++)
          if(checkboxes.checked)
    vBoxChecked=true;
    break;
    return(vBoxChecked);
    </script>
    3. If any are checked, prompt the user with the confirmation "are you sure you want to leave this page?". This action is defined as type "confirm".
    4. If the user presses cancel, the page should not continue.
    Steps 1-3 work fine. Step 4 doesn't happen...no matter what the user chooses (OK or cancel), the region paginates.
    I have worked with confirmations before on "before page submit" and it works like this...cancellilng in the confirmation box cancells the submission. I figured this would work similarly with "before refresh" of a region, but it does not.
    Is this an Apex bug that the confirmation OK/Cancel always allows the region to refresh (different behavior than with a confirmation used before page submit)?
    Ideas on another soution for what I'm trying to do?

    Well I guess the situation is that "before refresh" fires after the signal to refresh the region has been heard by the server.
    In other words, when I paginate through the region, I click the link to paginate, it wants to refresh but encounters my DA that fires before the region actually refreshes. This is fine. My code fires correctly and prompts "are you really sure...?". Problem is, the answer from the confirmation is ignored (either OK or cancel permits the pagination to continue).
    When I've used a confirmation with a "before page submit" in this same manner, answering "cancel" to the confirmation would also abort the submit process.
    So I want the same sort of "cancel" action to abort the region refresh in this case, but seems like it's ignored.

  • FTP - Run OS Command before file processing

    Hi,
    I have a requirement wherein I need to FTP a file from XI to a folder in a FTP server . Now FTP Server is set up in such a way that I cannot put the file directly. Before transferring the file , I have to use CD ( change directory command ) to access a particular folder and then transfer the file. This means that I cannot give the folder information directly to TARGET DIRECTORY.
    To address this, I decided to use the feature "Run OS Command BEFORE file processing " . And wrote a command 'cd <foldername> .It is not working. Then I tried using "Run OS Command AFTER file processing "  and it also didnot work.
    Does anyone have any clue how can I address this requirement using FILE Adapter.
    thanks,
    rakesh

    HI,
    OS commands will be executed in XI server not in the FTP server. So first you need to connect into FTP server and then you need execute CD command.
    option 1) Get the absolute path ie direct path from FTP server so that you can directly connect to FTP server's specific directoty
    22) In this case , write the file into your XI server itself by NFS File Transport protocol. Then ftp this file from your XI server into FTP server using Shell Script.
    So write a shell script which will be executed in the XI server, inside this write a logic of tranfer of files with FTP protocol. This shell script is executed from the Reciever File adapter with the option OS command.
    Hope this helps,
    Regards,
    Moorthy

  • RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESSING

    hi.
    just i want to know what is the purpose of run operating system command before message processing,after message processing under file sender adapter.
    waiting for your great answer.
    bye.
    regards.
    seeta ram.

    Hello Seeta,
    let me see if I give it using a simple scenario that I implamented : i nedd to transfer a very large file from one server to the other by XI.
    to save space and network traffic I use an OS command before picking up the file to run a zip command to zip the file.
    after I transfer the file to the target server I run another OS command after the transfer to unzip the file.
    now to your second question:
    the before Os command on the target server is used mostly for checks (make sure there isn't a file by that name or backing up existing data)
    and the after sender OS command is usualy for backing up or erasing existing files (cause it is done only after the first part was finished succesfully).
    Uri Lifshitz.
    p.s.
    there was a blog obout this titled "XI as a huge file mover"
    and you can see a description and my scripts at https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/03/additionaltipsforusingXIasahugefiletransfer%28withbatchscripts%29&

Maybe you are looking for