Routerconfig for ASAs (working but tftp file gets deleted?)

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Routerconfig for ASAs (working but tftp file gets deleted?)

Post by dieselboy »

Hello all, I have recently began using cactiEZ as an all-in-one solution for quick setup. I think it's fantastic!

I would really like routerconfigs to work. So, today, I spent some time coding in the enable functionality. So now the PHP script connects to your device, logs in, enables, then issues copy start tftp:. I have tested this working on both a Cisco 3750 and an ASA5510. First, I tested this by setting my laptop as the tftp server. The config files get copied to my tftp server on my laptop and they stay there.

When I send the files to the cacti server the 3750 file saves fine, but the ASA config file (which is 47k) appears in the directory for a few moments, but then disappears. I restarted the cacti server but it didnt resolve the issue. I'm baffled as to what is happening.

If people are interested in the ability to enable then let me know and I can paste the contents here.
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Post by dieselboy »

I think this has something to do with the script looking for the correct hostname.
I have also tried specifying the file path. For other devices, e.g. a cisco wireless access point, and the 3750 it creates the sub directory. With the ASA it doesnt even try to create a sub directory, it temporarily stores the file in the root of routerconfigs and then deletes the file.

:(
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Post by dieselboy »

Can anyone help? :cry:
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Post by dieselboy »

Don't worry, I have found the problem, and I now have routerconfigs backing up ASA / PIX :D :D :D

I am watching this topic.
MrRat
Cacti User
Posts: 136
Joined: Thu Jan 07, 2010 10:33 am

Post by MrRat »

what exactly did you have to change to get the ASA downloading working. This seems to work fine for my switches (6513,4507,3750,3550, and 2960) but will not download my ASA configs.
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Post by dieselboy »

If you have enable working (since ASA requires enable I think) then you need to disable the config file checking part of the routerconfigs functions.php. these are the lines:

Code: Select all

//if (!plugin_routerconfigs_check_config ($data)) {
			//$telnet->error = 5;
			//plugin_routerconfigs_save_error ($device['id'], $telnet);
			//plugin_routerconfigs_save_debug($device, $debug);
			//$telnet->Disconnect();
			//return false;
Just comment them out like I did above.
MrRat
Cacti User
Posts: 136
Joined: Thu Jan 07, 2010 10:33 am

Post by MrRat »

thanks, I have it working now.
samlui
Posts: 2
Joined: Tue Nov 04, 2014 1:56 am

Re: Routerconfig for ASAs (working but tftp file gets delete

Post by samlui »

I have the ASA5510 configured telnet password and enable passwork.
and comment out the lines as dieselboy mentioned.
But it isn't working on routerconfigs. please help.
MrRat
Cacti User
Posts: 136
Joined: Thu Jan 07, 2010 10:33 am

Re: Routerconfig for ASAs (working but tftp file gets delete

Post by MrRat »

Are you using routerconfigs 0.4?
Have you created a custom device type for the ASA?
here is what I have.

Code: Select all

mysql> select * from plugin_routerconfigs_devicetypes;
+----+--------------------+----------+----------+--------------------------------------------------------+--------------+---------+--------------+
| 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       |            1 |
|  4 | Nexus7K            | sername: | assword: | copy run tftp://%SERVER%/%FILE% vrf management vdc-all | show version | y       |            1 |
|  5 | Nexus5K            | sername: | assword: | copy run tftp://%SERVER%/%FILE% vrf management         | show version | y       |            1 |
|  6 | IBM Chassis Switch | sername: | assword: | copy run tftp mgt                                      | show version | y       |            1 |
+----+--------------------+----------+----------+--------------------------------------------------------+--------------+---------+--------------+
6 rows in set (0.00 sec)
To create the new devicetype use similar to.

Code: Select all

mysql>insert into plugin_routerconfigs_devicetypes (id,name,username,password,copytftp,version,confirm,forceconfirm) values ('YOUR NEXT NUMBER HERE', 'ASA', 'sername:', 'assword:', 'write net', 'show version', 'y', '1');
If you are trying to backup through a VPN tunnel then you need to specify the tftp server interface on the ASA similar to.

Code: Select all

tftp-server inside 1.2.3.4 MY-ASA-01
where 1.2.3.4 is your cacti tftp server and then the hostname of your ASA
samlui
Posts: 2
Joined: Tue Nov 04, 2014 1:56 am

Re: Routerconfig for ASAs (working but tftp file gets delete

Post by samlui »

Thanks,
I am using routerconfigs 0.3. is it working on version 0.3?
MrRat
Cacti User
Posts: 136
Joined: Thu Jan 07, 2010 10:33 am

Re: Routerconfig for ASAs (working but tftp file gets delete

Post by MrRat »

It should, If you create your ASA device type
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests