Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Monday, October 13, 2014

Command Line Tricks for HP Procurve Switchs

Below some helpful commands.

  • Display logs or debug on current session:
    • terminal monitor (Cisco)
    • debug destination session (HP Procurve)
  • By default HP Procurve switch don't display packets drops by queue. You can enable the monitoring only on 1 interface with the command below:
    • qos watch-queue xx out (where XX is the interface you want to monitor)
  • Obtain 'show tech':
    • copy command-output "show tech all" sftp user ftpuser 10.10.10.10 show-tech.txt
  • Filter a 'show runnning' command:
    • Like Cisco, it's possible to use '|' after the 'show running'
Switch# show running-config | include router
ip router-id 1.1.1.1
router ospf
router vrrp

Switch# show running-config | begin router
ip router-id 1.1.3.1


Tuesday, July 15, 2014

Not able to execute 'copy running-config startup-config' command

Today, I have encountered the following problem:

MY-SWITCH#copy running-config startup-config
startup-config file open failed (Device or resource busy)

In a first step, I was thinking that the nvram: was corrupted because I was not able to see files in the nvram (dir nvram:). In fact, we were 2 users connected on the switch.


MY-SWITCH#show users
    Line       User       Host(s)              Idle       Location
*  1 vty 0     admin      idle                 00:00:00 10.10.10.10 => My session
   2 vty 1     admin      idle                 00:07:09 10.10.20.10

 Also, I have just ejected my colleague with the following command:

MY-SWITCH#clear line 2

After that, I was able to backup my configuration.

Saturday, February 25, 2012

kron and backup

Today, I have looked my auto archive to see if they work properly. Surprise, all was ok except for the 3560 switch. When someone execute a 'write memory' all work fine but the schedule backup creates an empty file. There are just these four rows:

!
!
!
end


After some investigations on Internet I have discovered that I was not the first to occur this issue with these equipement. So I have decided to use another solution. It's the kron which is the equivalent of the cron on an unix machine. The configuration looks like this example:


archive
path ftp://10.10.10.10/PATH/MY-SWITCH/$h-
write-memory
no time-period 10080

kron occurrence backup at 22:00 25 recurring
policy-list backup
!
kron policy-list backup
cli archive config

I have kept all the configuration of the archive except the 'time-period'. I have just added policy backup which is schedule by a kron. The policy executes the command 'archive config' and the kron starts one time par month every 25th at 10pm. Also, it's very important to have NTP server if you don't want encountered problem to execute a kron.

Sunday, February 19, 2012

Add a mount point for an ASA


I have found a nice feature on the Cisco ASA. You can create a mount point to a server FTP.
Below you can find a sample of the configuration to  apply:

mount Backup-ASA type ftp
 server 10.10.10.10
 path /root/Backup
 username  userFTP
 password passwordFT
 mode passive
 status enable

To check all the configuration available on this particular folder you can use the command 'dir':

ASA# dir Backup-ASA:
Directory of Backup-ASA:/
       -rwx  71147       19:37:00 Jul 14 2011  ASA-14jul11.txt
       -rwx  79337       16:41:00 Jan 31 2012  ASA-09-02-2012.txt
0 bytes total (2146293760 bytes free)

This trick can be useful to backup easily the running configuration on remote folder:

ASA#copy running-config Backup-ASA

Thursday, February 9, 2012

Archive configuration on a Cisco Switch

In a previously post I have written a script (python) to automatically backup cisco config.
There is another method to backup this configuration. Used the archive command. By this way, it's possible to backup the configuration on a remote FTP server. Below, you will find an example:


ip ftp username user1
ip ftp password password1
!
archive
 path ftp://10.10.10.10/folder/My-switch.cfg
 write-memory
 time-period 1440

The write memory command trigger an automatic backup on the ftp server.
1440 means one backup generate every day.

If you make a mistake and you decide to come back on an old version, it's possible to restore the configuration. The better way is  using this command:


configure replace path ftp://10.10.10.10/folder/My-switch.cfg--9-09-00-23-0

To see the state of the archive you can use the 'show archive' command:


SWITCH#show archive
The maximum archive configurations allowed is 14.
The next archive file will be named ftp://10.10.10.10/folder/My-switch.cfg-%3Ctimestamp%3E-2
 Archive #  Name
   1        ftp://10.10.10.10/folder/My-switch.cfgFeb--9-09-00-23-0
   2        ftp:// 10.10.10.10/folder/My-switch.cfgFeb--9-09-00-37-1 <- Most Recent
   3
   4