Welcome, Guest. Please login or register.

Author Topic: config backup  (Read 8215 times)

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
config backup
« on: July 18, 2011, 11:22:09 PM »
I've got this problem where a switch died, and I replaced it with a different switch, but was unable at the time to get the original config off nedi.
It has been 16hours now, and nedi updates every hour so there is a new config backup.

My question is there anyway to get the original config file, or merge the changes into the current file to end up with the old config?

Oh and I'm using 1.0.6

Many thanks.
Mark.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2526
    • View Profile
    • NeDi
Re: config backup
« Reply #1 on: July 19, 2011, 10:12:36 PM »
You mean getting the config out of NeDi? The disk icon in Devices-Config lets you download it.

BTW, the new version will have a lot more options...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #2 on: July 19, 2011, 10:54:52 PM »
Yeah I can get the current config it has stored in nedi, and I found it in the database.
But what I really want is an older copy of the config. not the current config.

Not sure if that is possible or not, maybe it can be a new feature to keep x amount of backups of past configs.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2526
    • View Profile
    • NeDi
Re: config backup
« Reply #3 on: July 21, 2011, 11:13:50 PM »
Ok, so you've got colored changes as well in Devices-Config? If you use -B, nedi will store real files besides the DB entry. The upcoming version lets you access and even edit those files directly:
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #4 on: July 21, 2011, 11:17:46 PM »
Exactly what I'm after. :)
Thank you very much.
Mark.

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #5 on: March 07, 2012, 03:14:13 AM »
I've been using the backup feature for a while but after upgrading to 1o7 it seems to not work properly.
I have 4 devices that have config backups, but the rest don't get backed up.
The CLI for the ones not backing up are red.
I've reset that and still no go after another discovery.

now I've reset the cli in nedi, and done a manual -B -v -a 1.1.1.1 update and this is what I'm getting.
Code: [Select]
CLI3:Password sent
Use of uninitialized value in concatenation (.) or string at ./inc/libcli-iopty.pm line 479.
CLI4:Matched SWTICH4> (or gen. prompt with enpass &  cmd), enabling
ERR :pattern match timed-out
TEL :admin:23 Tout:2s OS:IOS EN:(.+?)#\s?$

All the network is cisco.
I've manually telnet to the switch from the nedi server, using the same credentials and it works.
I've double checked the user/pass/enable but still not working.
Any other ideas would be great.

Thanks.
Mark.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2526
    • View Profile
    • NeDi
Re: config backup
« Reply #6 on: March 07, 2012, 08:20:28 PM »
Have you applied the patch? If so, use -d to generate input and output.log for further debugging...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #7 on: March 07, 2012, 08:33:27 PM »
arhhh, no I had not. thanks. all working.

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #8 on: March 08, 2012, 01:40:57 AM »
well it did go well but I'm also getting another error during discovery
Code: [Select]
Use of uninitialized value in subroutine entry at /usr/local/nedi/inc/libdb-msq.pm line 752.
And this is the -v run of nedi.pl on the switch 6504E.
There are some interfaces on this switch that are in a VRf but all are shutdown. (not sure if this has anything to do with it)
In nedi, the swtiches show up with snmp (read/write) and CLI conenctions as Green.

Code: [Select]
Writing Dev  ------------------------------------------------------------------
WDEV:SWTICH1 written to nedi2.devices
Use of uninitialized value in substr at ./inc/libdb-msq.pm line 752.
Use of uninitialized value in subroutine entry at ./inc/libdb-msq.pm line 752.
Use of uninitialized value in subroutine entry at ./inc/libdb-msq.pm line 752.
Use of uninitialized value in substr at ./inc/libdb-msq.pm line 752.
Use of uninitialized value in subroutine entry at ./inc/libdb-msq.pm line 752.
Use of uninitialized value in subroutine entry at ./inc/libdb-msq.pm line 752.
WIF :106 interfaces written to nedi2.interfaces
WMOD:3 modules written to nedi2.modules
WVLN:21 vlans written to nedi2.vlans
WNET:28 networks written to nedi2.networks
WLNK:10 (ignoring 0 static) links written to nedi2.links
DISC:ToDo/Done-Time =    0/1-10s
===============================================================================


It's only happening on 2 cisco 6504E's running 12.2-18.SXF9

Peter@Lichtenberg

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: config backup
« Reply #9 on: March 08, 2012, 09:04:23 AM »
Hello ntmark,

remove the devices and add the devices with

 sudo -u www-data /var/nedi/nedi.pl -a device1
 sudo -u www-data /var/nedi/nedi.pl -a device2

After it you see no more failure messages. May you copy the NeDi 1.07 database to the NeDi 1.08 installation.

Peter

ntmark

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • tvnz.co.nz
Re: config backup
« Reply #10 on: March 08, 2012, 08:26:04 PM »
Thanks Peter,
 All is working after removing and adding back the devices.
Mark.

tristanbob

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: config backup
« Reply #11 on: October 29, 2012, 05:11:32 PM »
Peter,

I just migrated my Nedi 1.0.7 database to a new server, and I am getting tons of devices with these errors (around 50 switches).  Is there an easier way to do this (other than truncating the "devices" table)?  I have over 1,000 devices in that table.

Thanks,

Tristan
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

Peter@Lichtenberg

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: config backup
« Reply #12 on: November 02, 2012, 10:29:21 PM »
Hello Tristan,

there is a script bulkdelete.sh at <nedi>/contrib/, but I never tried it. 

May you can try once more to discover, get the ssh keys, start a refresh-run with detailed logging messages and check only some of the 50 devices:
- discover, starting at the devip:
    sudo -u www-data /var/nedi/nedi.pl  -v -p -A "inet_ntoa(devip) regexp '^172.16.*$|^192.168.*$'"
- optional get ssh keys (check your nedi.conf:usessh) :
    sudo -u www-data /var/nedi/nedi.pl  -v -k -A "inet_ntoa(devip) regexp '^172.16.*$|^192.168.*$'"
- refresh-run:
    sudo -u www-data /var/nedi/nedi.pl  -v  -A "inet_ntoa(devip) regexp '^172.16.*$|^192.168.*$'"

May you get a hint from the logging messages what is going wrong. May check your device definition files (for example 1.3.6.1.4.1.9.1.697.def) for the devices. In one situations I saw this messages for a device with connection problems at the uplink. I saw the messages for a router with many IP-Addresses (check your nedi.conf:useip variable). In an other situation I saw the message when the device definition file was wrong (Minor Firmware Version was different). You can check the OID with snmpget.

For example:
    snmpget -v2c -c<community string> <device-address> 1.3.6.1.2.1.1.2.0
    iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.9.1.697

Regards

 Peter