plugin for download/upload routers switches configuration

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
pgus
Cacti User
Posts: 55
Joined: Fri Feb 10, 2006 9:54 am

Install TFTP Server

Post by pgus »

Hi!

Can someone give me some help to install a TFTP server?
Im using Centos 4.3.

My final gool is to get it to work for configmanager and pancho.

Thanks in advance
Patric
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

Hello pepj

I have a pb with the directory created.
For exemple I want to create a directory save20060816/ and to save in it, the same for savetwo20060816/ but if I saved every day I see that a directory isn't created for savetwo20060815/ but when I have seen the log it was rigth and also I see my files in savetwo20060814/ and today I don't see savetwo20060816/ but my files are saved in savetwo2004/ so all my files are saved in savetwo20060814/. And for the first it's ok save20060816/ all are ok i have the directory save20060814/ save20060815/ and save20060816/.
So I d'ont understand I have a jump with directory.
Can you explain me what is it?

I have the impression that I have to start twice pancho or cacti in order to work.
I have a pre and a post command do youfind that is it a mistake or not?
Thank you pepj .
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

sorry
savetwo20060814/ line 5
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: Install TFTP Server

Post by pepj »

pgus wrote:Can someone give me some help to install a TFTP server?
Im using Centos 4.3.
Can you post again in ... http://forums.cacti.net/viewforum.php?f=2 or www.cactiusers.net/forums
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

jduchesne wrote:I have a pb with the directory created. save20060816 savetwo20060816/
Can you explain it again I don't understand your problem ?

PS: which system, what is your PRE and POST command in the config file or in the settings.

PS: For creating two directories it should be no problem, but pay attention when you want duplicate your files because TFTP is asynchrone, you have to insert a delay in your scripts in order to be sure all your files have been totally downloaded (depending on the speed of the line and router).
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
ddonohue
Cacti User
Posts: 77
Joined: Mon Jul 10, 2006 10:36 am
Contact:

Post by ddonohue »

Pepji, I figured out a way we could actually make this a little easier for the Telnet version.

create a user that has an auto command for show run, then, just have it log it, then you are set.

IE

username cacticfgmgr password changeme
username cacticfgmgr autocommand show run

donohue
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

Ok pepj,

I try to explain you

So every day I downloaded configurations so I saved this configuration in a directory with the date. So in my pre command I start my script shell to create my directory with the date and after the download in this directory.With the post command I remove my directory that is old of one year.

So pre command I create the directoy 20060816
post commant I remove the directory 20050816
and this every day.

And I have a pb because I make this for different configmanager and for two configmanager in 3 no new directory is created and all the configurations are saved in the same directory

so in the directory 20060814 I have the configurations host.20060814.runing-config host.20060815.runnin-config host.20060816.running-config ...

And in my log normaly cacti have to create each directory 20060815 and 20060816 but He dont create this directory.

My config file

Listing of the config /etc/cacti/sauvegardelildtdid7.conf
[global]
TftpServer=172.2.x.x
TftpRoot=/usr/cacti/tftp/
TftpPath=/sauvegardelildtd20060817
LogFile=/etc/cacti/sauvegardelildtdid7.conf.log
ForkLimit=10
StylePattern=::HOST::.::DATE::.running-config
StyleDate=%Y%m%d
SnmpVersion=1
SnmpRetries=1
SnmpWait=5.2
SnmpMtu=1500
SnmpDebug=0
SnmpCommunity=public
[10.16.x.x]
IpAddress=10.16.2.x
pre=/home/jduchesne/cacti.sh 20060817 sauvegardelildtd
post=/home/jduchesne/cactieffacement.sh 2006 0817 sauvegardelildtd
[10.16.x.x]
IpAddress=10.1.x.x
pre=/home/jduchesne/cacti.sh 20060817 sauvegardelildtd
post=/home/jduchesne/cactieffacement.sh 2006 0817 sauvegardelildtd

My log file

Aug 17 09:03:28 [CEST/+0200] pancho: (SUCCESS) copied 10.16.x.10:running-config to 172.x.x25:sauvegardelildtd20060816/10.1.x.150.20060817.running-config by cactiuser on ntwdidxx
Aug 17 09:03:36 [CEST/+0200] pancho: (SUCCESS) copied 10.16.x.151:running-config to 172.x.x.45:sauvegardelildtd20060816/10.16.x.x.20060817.running-config by cactiuser on ntwdidxx
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

You can see that the tftppath and the locaton where the files are saved it's not the same.
So I don't understand why?
I think about that I have a post command so It could be a pb.

Thank in advence pepj.
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

jduchesne wrote:tftppath and the locaton where the files are saved it's not the same.
Try to remove the / in the Tftppath

It means in the configmanager
something like sauvegardelildtd%y%%m%%d% instead /sauvegardelildtd%y%%m%%d%

You can also check it quickly and directly in changing
TftpPath=/sauvegardelildtd20060817
to
TftpPath=sauvegardelildtd20060817
(let only one host in the config if you want)

and starting pancho manually with this config
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

ok pepj I try
and an other question when the files are downloaded I want to have host.date.running-config but I have ip.date.running-config how can I change ip in host.

let take a look at this

Thank pepj
Attachments
pb.doc
(29 KiB) Downloaded 323 times
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

ddonohue wrote:a little easier for the Telnet version.
create a user that has an auto command for show run, then, just have it log it, then you are set.
username cacticfgmgr password changeme
username cacticfgmgr autocommand show run
good idea too. :) .

I have wrote this script (telnetdownloadunix.sh) as example and wanted to be open.

If you want to do this way you can
+ either you change nothing in this release
. and put your special user & password in the config of configmanager

+ or change/create the script 'telnetdownload-auto-unix.sh' and template.txt like below (but in this case the password and user are in the script)
- create a script 'telnetdownload-auto-unix.sh'
#!/bin/sh
(echo "cacticfgmgr"; echo "tobechanged"; echo "show run"; echo "exit"; sleep $3
) | telnet $1 > temp
csplit -k -f temp temp '/show run/'
rm -f temp
if test -f temp00 ; then rm -f temp00; fi
if test ! -f temp01 ; then exit; fi
echo mv temp01 $2
mv temp01 $2
- add in template.txt
name=telnet-cisco-automatically-unix
command=%g%/configmanager/scripts/telnetdownload-auto-unix.sh %n% /var/depot/%n%.cfg 4
help=(unix) download with Telnet of the running-config automatically from a Cisco router. The user and password have to be insert in the script 'telnetdownload-auto-unix.sh' . The last parameter is for sending a sleep in order to wait for the logging. The other parameters are: the router and destinationsfile. On the device create a user with the two commands 'username cacticfgmgr password tobechanged'and 'username cacticfgmgr autocommand show run'
PS: Can you test it (I can not I have a windows cacti) ? If it is ok I can add it to the next release in order to let the choice open (of the way to download).[/quote][/b]
Attachments
template.zip
example how the new template.txt could be done
(1.24 KiB) Downloaded 255 times
telnetdownload-auto-unix.zip
example of script
(311 Bytes) Downloaded 215 times
Last edited by pepj on Thu Aug 17, 2006 10:42 am, edited 1 time in total.
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

jduchesne wrote:ip / host.
You have to insert in the hosts of cacti (or mactrac) the hostname not the ip !
In the second part of the view "List of the hosts to insert (using cacti devices)" are the value loaded from the hosts cacti database.

The values for the host are exactly copied from the hosts cacti database (resp. mactrac).
Only the ip is calcucated
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

sorry pepj,

I don't really understand what you say.
I don't have the plugin mactrac and I just add a host with devices and after I have just the ip in the field host and ip.
I have to install mactrac plugin in order to have the name of the host or not?

thank a lot pepj :D
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

Just to see hat i say i poste the graphs

thank pepj
Attachments
pb1.doc
(158 KiB) Downloaded 219 times
jduchesne
Posts: 30
Joined: Fri Jul 07, 2006 7:50 am

Post by jduchesne »

Sorry pepj I am stupid I understand what you say it is ok.

And for the directory I wait one or 2 days in order to see if it works.

Thank a lot pepj
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests