plugin for download/upload routers switches configuration
Moderators: Developers, Moderators
I gave it a whirl, but still no soup for me. It feeds the MORE lines.
ie.
--MORE--
If there a way around this? The only way to feed in multipul automatic commands is on the 12.3 series IOS w/ TCL. But i'm not privileged enough to run that.
Also, after replacing the template.txt, it wasn't associating the script correctly, jsut a FYI.
Had to do this.
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'
Donohue
ie.
--MORE--
If there a way around this? The only way to feed in multipul automatic commands is on the 12.3 series IOS w/ TCL. But i'm not privileged enough to run that.
Also, after replacing the template.txt, it wasn't associating the script correctly, jsut a FYI.
Had to do this.
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'
Donohue
try puttingddonohue wrote: If there a way around this? The only way to feed in multipul automatic commands is on the 12.3 series IOS w/ TCL. But i'm not privileged enough to run that.
Code: Select all
(echo "cacticfgmgr"; echo "tobechanged"; for ((x=0;$x<5;x=x+1)); do echo ""; done; echo "exit"; sleep $3
PS: echo "exit"; could be removed, but I would let it in case of ...
a other way could be using the command privilege
Code: Select all
username cacticfgmgr privilege 1 password tobechanged
privilege exec level 1 show run
OK I changed it in the post beforeddonohue wrote:scripts/telnetdownload-auto-unix.sh
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
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
/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownload-auto-unix.sh xx.xxx.201.2 /cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg 4
telnet: /cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg: Name or service not known
/cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg: Unknown host
Then, when i feed in the IP addy again, i get this..
connection closed by host.
FYI, you don't have to EXIT outta the autorun, pretty much, just runs the command then exits. just have to feed the --MORE--
telnet: /cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg: Name or service not known
/cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg: Unknown host
Then, when i feed in the IP addy again, i get this..
connection closed by host.
FYI, you don't have to EXIT outta the autorun, pretty much, just runs the command then exits. just have to feed the --MORE--
It was because in this script the produced file had to be copiedddonohue wrote:/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownload-auto-unix.sh xx.xxx.201.2 /cacti-0.8.6h/plugins/configmanager/depot/xxx.xxx.201.2.cfg 4
like
Code: Select all
#!/bin/sh
(echo "cacticfgmgr"; echo "tobechanged"; for ((x=0;$x<50;x=x+1)); do echo " "; d
one; echo "exit"; sleep $3
) | telnet $1 > temp
echo mv temp $2
mv temp $2
So the only way at this time (when not IOS 12.3) is to create an user with privilege like this
Code: Select all
username cacticfgmgr privilege 1 password tobechanged
privilege exec level 1 show run
use the telnetdownloadunix.sh script giving the user and password in the configmanager config.
or
adapt the telnetdownloadunix.sh and template.txt like this
telnetdownload-auto-unix.sh:
Code: Select all
#!/bin/sh
(echo "cacticfgmgr"; echo "tobechanged"; echo "term len 0"; echo "show run"; echo "exit"; sleep $5
) | 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 $4
mv temp01 $4
Code: Select all
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 inserted 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'
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
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
Sorry pepj,
But I want to download with the snmp3 but it don't work I explain to you:
First I had two access list in order to select the user and the server so this is my two access list for snmp v1
access-list 1 permit 172.21.2.45
access-list 2 deny 172.21.2.45
access-list 2 permit any
snmp-server communty priverserver RW 1
snmp-server communty public RO 2
and now i want snmpv3 so I delete the five instruction before and I make
snmp-server user julien conseil v3 auth md5 supergenial
snmp-server group conseil v3 auth read v1default write v1default
snmp-server community public RW
and so in cacti I put snmpuser julien
password supergenial
community public
but in my log I have this
Listing of the config /etc/cacti/conftestid13.conf.log
Aug 23 10:06:44 [CEST/+0200] pancho: (ERROR) lilfor0007 SNMP session failed to be created for lilfor0007!
and my config file is :
Listing of the config /etc/cacti/conftestid13.conf
[global]
TftpServer=172.21.2.45
TftpRoot=/usr/cacti/tftp/
TftpPath=sauvegardetest20060823
LogFile=/etc/cacti/conftestid13.conf.log
ForkLimit=10
StylePattern=::HOST::.::DATE::.running-config
StyleDate=%Y%m%d
SnmpVersion=3
SnmpRetries=1
SnmpWait=5.2
SnmpMtu=1500
SnmpDebug=0
Snmpusername=julien
SnmpAuthPassword=supergenial
SnmpAuthProtocol=md5
[lilfor0007]
IpAddress=172.16.5.17
pre=/home/jduchesne/cacti.sh 20060823 sauvegardetest
post=/home/jduchesne/cactieffacement.sh 2006 0823 sauvegardetest
So I think that my mistake is on the snmpv3 for the router and not in cacti.
Can you say me what I have forgotten?
Thanks
But I want to download with the snmp3 but it don't work I explain to you:
First I had two access list in order to select the user and the server so this is my two access list for snmp v1
access-list 1 permit 172.21.2.45
access-list 2 deny 172.21.2.45
access-list 2 permit any
snmp-server communty priverserver RW 1
snmp-server communty public RO 2
and now i want snmpv3 so I delete the five instruction before and I make
snmp-server user julien conseil v3 auth md5 supergenial
snmp-server group conseil v3 auth read v1default write v1default
snmp-server community public RW
and so in cacti I put snmpuser julien
password supergenial
community public
but in my log I have this
Listing of the config /etc/cacti/conftestid13.conf.log
Aug 23 10:06:44 [CEST/+0200] pancho: (ERROR) lilfor0007 SNMP session failed to be created for lilfor0007!
and my config file is :
Listing of the config /etc/cacti/conftestid13.conf
[global]
TftpServer=172.21.2.45
TftpRoot=/usr/cacti/tftp/
TftpPath=sauvegardetest20060823
LogFile=/etc/cacti/conftestid13.conf.log
ForkLimit=10
StylePattern=::HOST::.::DATE::.running-config
StyleDate=%Y%m%d
SnmpVersion=3
SnmpRetries=1
SnmpWait=5.2
SnmpMtu=1500
SnmpDebug=0
Snmpusername=julien
SnmpAuthPassword=supergenial
SnmpAuthProtocol=md5
[lilfor0007]
IpAddress=172.16.5.17
pre=/home/jduchesne/cacti.sh 20060823 sauvegardetest
post=/home/jduchesne/cactieffacement.sh 2006 0823 sauvegardetest
So I think that my mistake is on the snmpv3 for the router and not in cacti.
Can you say me what I have forgotten?
Thanks
(In my environement it functions. I checked it now)jduchesne wrote:i want snmpv3
1/ do you have installed the following perl modules ?
- Crypt::DES (Perl Module needed for SNMPv3)
- Digest::MD5 (Perl Module needed for SNMPv3)
- Digest::SHA1 (Perl Module needed for SNMPv3)
- Digest::HMAC (Perl Module needed for SNMPv3)
2/ Do you have active the encryption on the router? (ip domain + crypto key) ? (check it with ssh)
I have used also
Code: Select all
snmp-server group conseil v3 auth write v1default
snmp-server user julien conseil v3 auth md5 supergenial
PS: What I 've forgotten is the possibility to use the pancho feature to a SnmpAuthKey for v3. I will add this later.
PS: Why do you put "snmp-server community public RW ". Do you like risk?
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
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
Try only withjduchesne wrote:I can not install Digest-MD5-2.36
Crypt::DES (Perl Module needed for SNMPv3)
Digest::SHA1 (Perl Module needed for SNMPv3)
Digest::HMAC (Perl Module needed for SNMPv3)
you should have already per default a MD5 package.
I don't know more about this problem (I try rewriting the perl part in native PHP, but need time), but on my system I have also not installed Digest::MD5, I think it uses my default MD5.
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
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
I think it is when it try to read the file 'plugins/configmanager/template.txt' and search the '#' and blank linecfybyair wrote:my configmanage have some error!
i don't know which reson
Fatal error: Maximum execution time of 30 seconds exceeded in D:\apache2\Apache2\htdocs\cacti\plugins\configmanager\configmanager.php on line 300
Code: Select all
$pattern = '/(^#)|( $)/';
if (!(preg_match($pattern, $linename, $matches))) {
- if you have an unix can you try to convert it in pure unix without carriage return
- or try changing the line 299 of configmanager.php to
Code: Select all
$pattern = '/(^#)/';
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
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
replace again the line 299 like before
and copy the template.txt file below (I converted it to unix format).
try again please
Code: Select all
$pattern = '/(^#)|( $)/';
try again please
- Attachments
-
- template.txt
- template in unix format
- (3.36 KiB) Downloaded 1097 times
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
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
Help with install
Ok, I was able to get through the first three steps.
But on the fourth step I got this error.
ERROR 1046 (3D000) at line 2: No database selected
Do I need to create a database first?
I
0/ You will need the plugin-architectur of Jimmy http://cactiusers.org
1/ Only If you want to use the "TFTP" method Install "pancho" www.pancho.org (with perl!!).
2/ copy the plugin under "your_cacti/plugins/configmanager"
3/ create the sql database
- "mysql --user=root --password cacti < your_cacti/plugins/configmanager/configmanager.sql"
But on the fourth step I got this error.
ERROR 1046 (3D000) at line 2: No database selected
Do I need to create a database first?
I
Who is online
Users browsing this forum: No registered users and 0 guests