Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon May 22, 2017 11:55 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: ConfigStore Plugin
PostPosted: Wed Sep 01, 2010 3:59 pm 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
ConfigStore is a plugin for backing up device configurations - based on the routerconfigs plugin. It is under development at the moment, but at a point that I think it could be useful.

Like with anything, you should make backups, be careful, etc. before installing. I make no warranty.

This plugin uses the PIA 2.x, so just untar, ungzip the file to your plugin directory and go to Plugin Management.

For further instructions please read the README file included in the tar ball. Better documentation will follow shortly.

This plugin is under active development, so fixes/features will be coming soon.

For now please post back to this thread if you have questions, problems, etc. I will work on getting a site to put releases on in the future, but that will be a ways off.

Have fun!

-chadd.


Attachments:
File comment: ConfigStore v0.7
configstore-v0.7.tar.gz [104.93 KiB]
Downloaded 866 times


Last edited by chadd on Mon Nov 14, 2011 2:07 pm, edited 16 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 01, 2010 5:25 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
Dont forget to post to the docs once its stable.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2010 8:02 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
Sure thing. I did put some notes in the readme file, but documentation will be forthcoming. Thanks.

-chadd.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2010 8:59 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
The last file had a bug, so I fixed it and tried to upload the new one, but keep getting a: No post mode specified message.

I will post the fixed version when the forum starts cooperating again. Sorry..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2010 6:27 am 
Offline

Joined: Tue May 02, 2006 4:46 pm
Posts: 47
Excelent work! if you need some betatester, feel free to contact me.
I have equipment from Cisco, Juniper, Arris, Nortel.
cya.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 07, 2010 1:56 pm 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
I have made some corrections, so hopefully some of you can give it a try and let me know what you think.

-chadd.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2010 6:55 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
If you downloaded that last one, it had an error in the logging class. I fixed it and uploaded a new file. There will be other corrections coming this morning. Stay tuned...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2010 10:18 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
Found out that I did not account for not having to use a normal password, and an enable password when doing terminal logins. Now if you have a user set up with the privilege level to do enabled commands at first login, it should work. Just use the password field in the account form, and leave the enable password field blank if that is your case.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2010 6:24 pm 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
Marcelo wrote:
Excelent work! if you need some betatester, feel free to contact me.
I have equipment from Cisco, Juniper, Arris, Nortel.
cya.


Could certainly use a beta tester.
Have decided right now not to support Nortel. Most importantly because the config (at least on the switches we have) is binary. I have not looked into ways of making it text. Two, we are getting rid of them, and I don't know for sure, but I think they are defunct..
As for Juniper and Arris, I don't have either of those vendors equipment to test on. If you would like to send me info on them (login process, backup process, snmp mibs, etc.) I could try to do something if I get some time. The only issue is that you would have to do the testing. A better plan would be for you to add that functionality and post back the files ;). It is quite easy to add new vendor types (not as easy as I would like, but still quite easy). If you want to know what files to edit/create, let me know I will make a little recipe.

Anyway, thanks.

-chadd.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 09, 2010 11:17 am 
Offline
Cacti User

Joined: Thu Dec 14, 2006 4:38 pm
Posts: 68
Location: Kingsport TN
For nortel routers look at bcc


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2010 10:00 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
eternal wrote:
For nortel routers look at bcc


Sorry, I don't want to seem callus, but I really can't spend the time on getting Nortel devices to work. I think that even if I did, the config backup you have would not be able to be re-uploaded to a device for recovery. It would only serve as a template for the manual configuration of a device. Which may be very useful to people, but not to my current employer (as we would just replace it with a different vendors equipment).

If someone wants to work on backups for Nortel devices, using this plugin, I would be happy to answer any questions they might have in the process of writing the code.

The easiest way to get started (and this goes for any new currently unsupported equipment) would be as follows:

1.) Change code starting on line 98 of the configstore_devices.php file shown here:

"devicetype" => array(
"method" => "drop_array",
"friendly_name" => "Device Type",
"description" => "Choose the type of device.",
"value" => "|arg1:devicetype|",
"default" => 0,
"array" => array(1 => 'Cisco-IOS', 2 => 'Foundry'),
),
Add your new device type to the array, so it shows up in the drop down.

2.) Edit the functions.php file to detect your new device type and call the new php file you are going to create. Below is the section of code you need to edit (around line 84):

// Cisco-IOS device type
if ($device['devicetype'] == '1') {
if(!file_exists($config['base_path'] . '/plugins/configstore/lib/cisco-ios.php')) {
return false;
} else {
include_once($config['base_path'] . '/plugins/configstore/lib/cisco-ios.php');
$backup_results = cisco_ios_get_config($device);
}
// Foundry device type
} elseif ($device['devicetype'] == '2') {
if(!file_exists($config['base_path'] . '/plugins/configstore/lib/foundry.php')) {
return false;
} else {
include_once($config['base_path'] . '/plugins/configstore/lib/foundry.php');
$backup_results = foundry_get_config($device);
}
} else {
return false;
}

As you can infer, your new device type will be 3 and you will include a new file you are about to create to do the actual backup of the device.

3.) Create the new backup script and put it in the "lib" directory. You can just make a copy of one of the .php files currently in there (like cisco-ios.php or foundry.php) and modify it for your purposes. The expect scripts in the "lib" directory I am just using to do the terminal logins, and return the output to the backup script (cisco-ios.php or foundry.php). This script you create just has to return the following array back to the functions.php script:

$backup_results = array('device' => $device['id'],
'btime' => $t,
'directory' => $dir,
'filename' => $filename,
'config' => $data,
'lastchange' => $lastchange,
'username' => $lastuser,
'hostname' => $hostname,
);
It doesn't matter how you get this information, just that it gets sent back to the functions.php script in this format.

And that should be it. You should have support for your new device. The scripts I have included so far (cisco-ios.php and foundry.php) support all the different methods of backing up one of these devices. Your script does not have to - it only needs to support the method you would like to use. The "configstore_accounts" script should be able to accommodate your authentication requirements. If not, that can be changed too.

Hope this helps someone, and don't be afraid to ask me questions. I may not be able to answer them, but I will try. Good luck.

-chadd.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2010 10:03 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
I have made some further corrections and uploaded a new file. These are:

- Actually saving the debug on backup failure (not sure how I missed that ;).
- increasing the timeout to 30 seconds on the terminal logins (expect scripts). Some of my devices needed more than 10 seconds to complete.

-chadd.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 14, 2010 9:50 am 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
Just upgraded to Cacti version 0.8.7g and Plugin Architecture Version 2.8, and everything appears to be working fine.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 20, 2010 10:29 am 
Offline
Cacti User
User avatar

Joined: Sat Sep 23, 2006 7:50 pm
Posts: 89
Location: WI, USA
chadd wrote:
Could certainly use a beta tester.
Have decided right now not to support Nortel. Most importantly because the config (at least on the switches we have) is binary...


Any of the newer Avaya/Nortel (25xx,45xx,55xx,56xx, and 8xxx) switches also support ascii config management when running newer code.

_________________
Current cacti install
-------------------------
Hardware: ESXi 5.1 VM
Software Load: FreeBSD 9.0 + Lighttpd + MySQL + Cacti 0.8.7
Plug-ins loaded: aggregate, flowview, monitor, realtime, rrdclean, syslog, spikekill, settings, thold, weathermap, and uptime.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 20, 2010 2:28 pm 
Offline
Cacti User

Joined: Thu Mar 24, 2005 3:53 pm
Posts: 383
Location: Ocoee, Florida
zgamer wrote:
chadd wrote:
Could certainly use a beta tester.
Have decided right now not to support Nortel. Most importantly because the config (at least on the switches we have) is binary...


Any of the newer Avaya/Nortel (25xx,45xx,55xx,56xx, and 8xxx) switches also support ascii config management when running newer code.


If you post the methods (ssh, telnet, scp, tftp, scpserver, snmp, etc.) that you'd like, and the data I need to write the code (login proceedure capture, mibs, etc.) I will give the code a try - and you can test it for me, as I have no Avaya/Nortel equipment to test on.. Let me know, and I will try to help.

-chadd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group