Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Aug 17, 2017 10:30 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
 Post subject:
PostPosted: Wed May 26, 2010 6:18 am 
Offline
Cacti User

Joined: Wed May 27, 2009 5:10 pm
Posts: 124
EDIT
This has been working ALL ALONG. Thanks Grady. HP and Cisco devices DO in fact back up correctly - Here is the catch.

When adding devices, to be quick and easy I simply used the IP address as the description AND the hostname / IP part. For some reason, this messes up the script and the routerconfigs plugin does not change the file name, and does not list it in the backups. I just had a thought what would happen if I changed the file name from it's IP address, to it's correct hostname and it now backs up perfectly.

Very pleased.
Cheers,


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 30, 2010 11:56 am 
Offline

Joined: Sun May 30, 2010 11:54 am
Posts: 3
Thank you so much for your understanding, and I apologies if I disturbed you :[


______________
dvd replication
contract warehousing


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2010 3:15 am 
Offline
Cacti User

Joined: Wed May 27, 2009 5:10 pm
Posts: 124
crazy_90 wrote:
Thank you so much for your understanding, and I apologies if I disturbed you :[


I've been disturbed for a long time, don't worry! :)


Top
 Profile  
 
 Post subject: New Challenge
PostPosted: Wed Jun 02, 2010 5:11 am 
Offline
Cacti User

Joined: Wed May 27, 2009 5:10 pm
Posts: 124
Hi Grady,
When trying to backup the config of an ASA over a VPN tunnel, after the IP address we need to add the command ;int=inside

Do you have any idea how I could incorporate that into routerconfigs as an option so that it doesn't effect other cisco devices, or ASAs that do not require that additional command?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2010 2:28 pm 
Offline
Cacti User

Joined: Wed Feb 20, 2008 5:02 pm
Posts: 60
Hi diesel, sorry -- ive been out for a while. Youve got a couple of options there. The easiest of course would be to allow hairpinning on the ASA, though there's likely security issues that you'd need to address if you decided to take that route.
Code:
The other would be to add a device type to the plugin_routerconfigs_devicetypes table in the cacti DB. That'd be as simple as mysql> insert into plugin_routerconfigs_devicetypes (id,name,username,password,copytftp,version,confirm,forceconfirm) values ('NEXT NUMBER HERE', 'ASA', 'sername:', 'assword:', 'copy run tftp', 'int inside','n', 'n');

Next go into functions (backup working one prior of course) and in the phptelnet class define an additional docommand:

Code:
       function DoCommandASAint($c, &$r) {
                if ($this->fp) {
                        fputs($this->fp, " $c\r");
                        $this->Sleep();
                        $this->GetResponse($r);
                        $r = preg_replace("/^.*?\n(.*)\n[^\n]*$/", "$1", $r);
                }
                return $this->fp ? 1 : 0;
        }


Next head up and replicate the conditional HP stuff:
Code:
//If ASA and need int use extra commands
        $devicetypeASA = db_fetch_row("SELECT name FROM plugin_routerconfigs_devicetypes WHERE id = " . $device['devicetype']);
                 foreach ($devicetypeASA as $value)
                 {
                        if ($value == "ASA"){
                        $result1 = $telnet->Connect($device['ipaddress'],  $info['username'], $info['password'], $devicetype);
                        $debug = $telnet->debug;
                        $result=$result2;
                        $telnet->DoCommand($devicetype['copytftp'], $result);
                        echo $result;
                        $telnet->DoCommandASA($devicetype['version'], $result);
                        $telnet->DoCommand($filename, $result);
                        echo $result;
                        }
                }
//end


Go back into router configs and re-add the device that needs this additional command. When you do in the drop down list select device type of ASA. That way the version command you pass to it in the above if block is actually the interface stuff you need. If you take that path make sure to edit the line below the comment with false positive in it:
Code:
                        if ($value !="HP" && $value !="ASA") {


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2010 11:29 am 
Offline
Cacti User

Joined: Wed Feb 20, 2008 5:02 pm
Posts: 60
Alternatively a MUCH easier solution here is to use the above sql to create a row for ASA device type that looks like this:

Code:
|  4 | ASA         | sername: | assword:  | write net                              | sh ver       | y       |            1 |


Then, hop out to your ASA and add the following to the config:
Code:
tftp-server inside x.x.x.x <device name>


Then routerconfigs will send the command write net vs the copy run stuff. So long as your existing firewalls are set to a device type of ASA you should be gtg.


Top
 Profile  
 
 Post subject: Re: Routerconfigs plugin / how it works?
PostPosted: Tue Sep 06, 2011 3:01 pm 
Offline

Joined: Tue Sep 06, 2011 2:52 pm
Posts: 1
This may be a bit too late for this topic, but do you have any plans to implement your version of routerconfigs over SSH? I know some SSH modules for PHP have been gaining a lot of momentum and it would be great to see this feature in routerconfigs. I would love to help with the project with what PHP I know, and the modification of routerconfigs to support HP devices was exactly what I was looking for, so expanding further, in my opinion, would be quite useful.


Top
 Profile  
 
 Post subject: Re: Routerconfigs plugin / how it works?
PostPosted: Sun Jan 20, 2013 10:10 am 
Offline
Cacti User

Joined: Sun Dec 23, 2012 9:59 am
Posts: 57
Hi,

I try to backup my asa firewall with routerconfigs.
I write in phpmyadmin :
Code:
INSERT INTO plugin_routerconfigs_devicetypes (id, name, username, password, copytftp, version, confirm, forceconfirm) VALUES (3, 'ASA', 'sername:', 'assword:', 'write net', 'show version', 'y', 1)


but this line needs to be written on the ASA? (because i tried to connect to via telnet , and it asked me a password...How can i have this password?
Code:
tftp-server inside x.x.x.x <device name>

And x x x x is which IP?
And device name?

Thank you


Top
 Profile  
 
 Post subject: Re: Routerconfigs plugin / how it works?
PostPosted: Thu Mar 07, 2013 8:56 pm 
Offline

Joined: Tue Mar 01, 2005 1:49 pm
Posts: 32
The statement on the ASA just tftp's the running config to the cacti server (running TFTP server) when triggered to do so by the plugin. So the ASA statement needs to look like this.

Code:
tftp-server Inside <ip_address_of_cacti_host> <asa_hostname>


The <asa_hostname> above should match your actual ASA hostname AND the routerconfigs device name. Don't put a path on it and it will go to the tftp root like all the rest of your config files.

Here's what you do in mysql

mysql -u root -p

Code:
mysql> use cacti;
mysql> INSERT INTO plugin_routerconfigs_devicetypes (id, name, username, password, copytftp, version, confirm, forceconfirm) VALUES (3, 'ASA', 'sername:', 'assword:', 'write net', 'show version', 'y', 0)


The number '3' above assumes the ASA devicetype is the 3rd one you are adding. If it is the 4th use '4' and so on. You may check your table with this command:

mysql> select * from plugin_routerconfigs_devicetypes;

Here is the result:

Code:
+----+-------------+----------+----------+------------------+--------------+---------+--------------+
| id | name        | username | password | copytftp         | version      | confirm | forceconfirm |
+----+-------------+----------+----------+------------------+--------------+---------+--------------+
|  1 | Cisco IOS   | sername: | assword: | copy run tftp    | show version | y       |            0 |
|  2 | Cisco CatOS | sername: | assword: | copy config tftp |              | y       |            1 |
|  3 | ASA         | sername: | assword: | write net        | show version | y       |            0 |
+----+-------------+----------+----------+------------------+--------------+---------+--------------+


Top
 Profile  
 
 Post subject: Re: Routerconfigs plugin / how it works?
PostPosted: Thu Dec 01, 2016 6:17 pm 
Offline
Cacti User

Joined: Mon Sep 10, 2012 5:54 pm
Posts: 64
I have this plugin working for Cisco IOS devices, but having issue with IOS-XR. Anyone run into this?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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