plugin for download/upload routers switches configuration
Moderators: Developers, Moderators
hello pepj ,
It's ok for the creation file that you see but I can't run a file in .sh so I add the line in the pre command in my configuration.
mkdir /usr/cacti/tftp/sauvegardelilcit%y%%m%%d% | chmod 777 /usr/cacti/tftp/sauvegardelilcit%y%%m%%d%
and it works
But now for example if I saved a file xxx.2006.07.31 I want to remove all the files that are older than a year or a month so I thought that I could make this with the file to start after in the setting tab but It seems to not work with this syntax:
./home/jduchesne/cacti.sh
I just try to create a directory in this .sh and nothing happen.
DO you have some explication?
and if you have make this automaticaly could you explain me how you make?
PS: I want to make this bcause I use a server and in order to kepp CPU memory I want to delete the old files saved.
Thank pepj
It's ok for the creation file that you see but I can't run a file in .sh so I add the line in the pre command in my configuration.
mkdir /usr/cacti/tftp/sauvegardelilcit%y%%m%%d% | chmod 777 /usr/cacti/tftp/sauvegardelilcit%y%%m%%d%
and it works
But now for example if I saved a file xxx.2006.07.31 I want to remove all the files that are older than a year or a month so I thought that I could make this with the file to start after in the setting tab but It seems to not work with this syntax:
./home/jduchesne/cacti.sh
I just try to create a directory in this .sh and nothing happen.
DO you have some explication?
and if you have make this automaticaly could you explain me how you make?
PS: I want to make this bcause I use a server and in order to kepp CPU memory I want to delete the old files saved.
Thank pepj
upload a file
hello pepj
I want to upload a configuration and i want to know what are the blanks in the configuration manager that i have to fill.
just to follow me :
1 the path for the configuration file is necessary
2 path for the data too
3 file to upload :it is the name of the file
4 fileformat: it is necessary
pre : not necessary
post : not necessary
in my case I want to choice the file host.date.running-config in /usr/cacti/tftp/sauvegades/
if I take this :
path for the data:sauvegardes/
is it OK?
I want to upload a configuration and i want to know what are the blanks in the configuration manager that i have to fill.
just to follow me :
1 the path for the configuration file is necessary
2 path for the data too
3 file to upload :it is the name of the file
4 fileformat: it is necessary
pre : not necessary
post : not necessary
in my case I want to choice the file host.date.running-config in /usr/cacti/tftp/sauvegades/
if I take this :
path for the data:sauvegardes/
is it OK?
- Attachments
-
- exemple.doc
- (56.5 KiB) Downloaded 355 times
Re: upload a file
1 the path for the configuration file is necessaryjduchesne wrote:I want to upload a configuration
1 the path for the configuration file is necessary
2 path for the data too
3 file to upload :it is the name of the file
4 fileformat: it is necessary
pre : not necessary
post : not necessary
2 path for the data too (if it is not in the file to upload)
3 file to upload :it is the name of the file to upload or containing the commands (!! it is relative to the TFTP root path because the TFTP server has to find it)
4 fileformat: it is NOT necessary for "upload" (but let it)
pre : not necessary
post : not necessary
At this time the change are only on the running-config
I will post soon an other release because I have realised I forgot some choice like
- commit (in order to save the config on the router/switch)
- start (to download the running or the startup 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
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
Re: upload a file
UPGRADE: for upgrading from an old releasepepj wrote: New release 0.4f1 to download (in the first post)
(version 0.4f1 only template.txt has change since 0.4f little mistake)
- take care about your own secure.cfg and securecompare.cfg files and your scripts under 'plugins/configmanager/scripts if you have some
- execute this command after having copied the files
php .../configmanager/database_upgrade.php
Changes
04.08.2006 method TFTP: add some function like :
commit (save configuration on the device)
download/upload direct of/to startup configuration of the device
03.08.2006 method TFTP: some changes for choosing a file to upload (year,month,...)
13.07.2006 correct the Unix error "Running PHP5 / PHP Warning: Call-time pass-by-reference has been deprecated"
The atached file was a too old version and has been removed
Last edited by pepj on Thu Apr 10, 2008 5:17 pm, edited 2 times 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
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
FYI
impreza:/cacti-0.8.6h/plugins/configmanager/scripts # /cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh ip address /var/depot/target.cfg
sleep: missing operand
Try `sleep --help' for more information.
/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh: line 2: $4: ambiguous redirect
csplit: missing operand after `/show run/'
Try `csplit --help' for more information.
mv temp01
mv: missing destination file operand after `temp01'
Try `mv --help' for more information.
impreza:/cacti-0.8.6h/plugins/configmanager/scripts # /cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh ip address /var/depot/target.cfg
sleep: missing operand
Try `sleep --help' for more information.
/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh: line 2: $4: ambiguous redirect
csplit: missing operand after `/show run/'
Try `csplit --help' for more information.
mv temp01
mv: missing destination file operand after `temp01'
Try `mv --help' for more information.
You need more parameters to test this script.ddonohue wrote:#/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh ip address /var/depot/target.cfg
missing operand
all parameters are important, the sleep is very important, one of my secrets for this script.
/cacti-0.8.6h/plugins/configmanager/scripts/telnetdownloadunix.sh ipaddress_or_hostname user password /var/depot/target.cfg timeforsleep
I tried it under linux.
PS: But in the template.txt I put "(windows)" and "(unix)" one time on the wrong place. It should be behind "help=" like this -->
name=sftp-firewall-putty-windows
command=pscp -l %u% -pw %w% -sftp %n%:TMP/* %p%/%y%%m%%d%/
help=(windows) Here an example for secure FTP SFTP with pscp of putty.
name=telnet-cisco-unix
command=%g%/configmanager/scripts/telnetdownloadunix.sh %n% %u% %w% /var/depot/%n%.cfg 4
help=(unix) download with Telnet of the running-config of a Cisco router. The last parameter is for sending a sleep in order to wait for the logging. The parameters are: the router, user, password and destinationsfile.
Here attached is the right template.txt file
- Attachments
-
- template.txt
- (2.84 KiB) Downloaded 295 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
with the new template file, i can't even try telnet. but i'm getting this error when trying to do a tftp version. When running the poller w/ a -d
Aug 04 15:02:37 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:02:42 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:11:07 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:12:59 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:16:56 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Pre process 'if test -d '/data/20060804' then mkdir /data/20060804 fi' failed for xxx.xxx.xxx.xx. Not processing host.
Aug 04 15:17:46 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Pre process 'if test -d '/data/20060804' then mkdir /data/20060804 fi' failed for xxx.xxx.xxx.xx. Not processing host.
In the posted file above, i found that you have problems w/ your commandblah blah blah.
You are missing some places
command=<text>
Aug 04 15:02:37 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:02:42 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:11:07 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:12:59 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Aug 04 15:16:56 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Pre process 'if test -d '/data/20060804' then mkdir /data/20060804 fi' failed for xxx.xxx.xxx.xx. Not processing host.
Aug 04 15:17:46 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Pre process 'if test -d '/data/20060804' then mkdir /data/20060804 fi' failed for xxx.xxx.xxx.xx. Not processing host.
In the posted file above, i found that you have problems w/ your commandblah blah blah.
You are missing some places
command=<text>
authorizationError(16) is the message error of SNMP for authorisation's problem your switch/router is sending back (RFC1905, RFC3231).ddonohue wrote:pancho: (ERROR) xxx.xxx.xxx.xx Received authorizationError(16) error-status at error-index 0
Have you check if the snmp community or password or ACL are the same between the pancho configuration and the device?
Did you try setting only the snmp "contact" parameter?
snmpset -v 2c -c rwcommunity device .1.3.6.1.2.1.1.4.0 s thisisthenewcontact
I am searching if it could be an other problem, but without more information it could be difficult.
The snmp answer says clearly authorizationError.
+ Try giving again on the device the community string. Years ago it was a problem on a release where I had to put the community again in order the device accept it.
I think I had a wrong example for unix. The command should be the same as on unix.ddonohue wrote:Aug 04 15:16:56 [MDT/-0600] pancho: (ERROR) xxx.xxx.xxx.xx Pre process 'if test -d '/data/20060804' then mkdir /data/20060804 fi' failed for xxx.xxx.xxx.xx. Not processing host.
here I think 'if test ! -d '/data/20060804'; then mkdir /data/20060804; fi'
I am not very good in unix and I cannot check with a cacti unix server.ddonohue wrote:In the posted file above, i found that you have problems w/ your commandb
But you had right the csplit and the test were not good. Some little mistakes and I do not copy the right test file. (But the download was ok).
Here I attached the corrected version. (sorry, but I need unix feedback in order to improve the plugin)
- Attachments
-
- unixscripts.zip
- corrected version of telnetdownloadunix.sh and telnetdownloadSVNunix.sh
- (706 Bytes) Downloaded 277 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
Pepj, looking much better now
impreza:/cacti-0.8.6h/plugins/configmanager/depot # cat temp01
6509-b1-s2>show run
^
% Invalid input detected at '^' marker.
6509-b1-s2>exi
Course, a non Priviledged account, can't run a show run, on our 6509's you have to logon, then enable.
For, the tftp version, i'm seeing this.
impreza:/cacti-0.8.6h/plugins/configmanager # perl -I/usr/local/src/Pancho-9.3. 9/lib /usr/local/bin/pancho --download --pre --post --config /data/testid10.c onf
error: [2020] Net::SNMP::__ANON__(): Received usmStatsUnknownEngineIDs.0 Report- PDU with value 5434 during discovery
error: [2102] Net::SNMP::__ANON__(): Received usmStatsNotInTimeWindows.0 Report- PDU with value 15 during synchronization
debug: [2137] Net::SNMP::_discovery_synchronization_cb(): discovery and synchron ization complete
sh: -c: line 1: syntax error: unexpected end of file
ERROR (xxx.xxx.208.2): Pre process 'if test -d '/data/20060807' then mkdir /data/ 20060807 fi' failed for xxx.xxx.208.2. Not processing host.
donohue
impreza:/cacti-0.8.6h/plugins/configmanager/depot # cat temp01
6509-b1-s2>show run
^
% Invalid input detected at '^' marker.
6509-b1-s2>exi
Course, a non Priviledged account, can't run a show run, on our 6509's you have to logon, then enable.
For, the tftp version, i'm seeing this.
impreza:/cacti-0.8.6h/plugins/configmanager # perl -I/usr/local/src/Pancho-9.3. 9/lib /usr/local/bin/pancho --download --pre --post --config /data/testid10.c onf
error: [2020] Net::SNMP::__ANON__(): Received usmStatsUnknownEngineIDs.0 Report- PDU with value 5434 during discovery
error: [2102] Net::SNMP::__ANON__(): Received usmStatsNotInTimeWindows.0 Report- PDU with value 15 during synchronization
debug: [2137] Net::SNMP::_discovery_synchronization_cb(): discovery and synchron ization complete
sh: -c: line 1: syntax error: unexpected end of file
ERROR (xxx.xxx.208.2): Pre process 'if test -d '/data/20060807' then mkdir /data/ 20060807 fi' failed for xxx.xxx.208.2. Not processing host.
donohue
hello pepj,
All is Ok with cacti but I have a question.
I want to create an acces-list in my router in order to have my server and one computer to speak with my router and also I work with the access list extended and not with the standard ACL so
what is the protocol to accept:
I think about TFTP of course
telnet,snmp and the ping(for me just to have this fonction)
But when I make this I have an error no response from the remote host.
Can you say me if I forget an other protocol in order to have the files saved?
Thank a lot pepj.
All is Ok with cacti but I have a question.
I want to create an acces-list in my router in order to have my server and one computer to speak with my router and also I work with the access list extended and not with the standard ACL so
what is the protocol to accept:
I think about TFTP of course
telnet,snmp and the ping(for me just to have this fonction)
But when I make this I have an error no response from the remote host.
Can you say me if I forget an other protocol in order to have the files saved?
Thank a lot pepj.
You naturally need an user having the right to read the config of the device. (You can also retrict an user for only with this cisco command "privilege exec level nevelnumber thecommand", the user should have the same level)ddonohue wrote:unix script for method "multi"
[I write this explanation for any people which read this post ... and who is interesting for this]
usmStatsUnknownEngineIDs===>The total number of packets received by the SNMP engine which were dropped because they referenced an snmpEngineID that was not known to the SNMP engine.ddonohue wrote: error: [2020] Net::SNMP::__ANON__(): Received usmStatsUnknownEngineIDs.0 Report- PDU with value 5434 during discovery
error: [2102] Net::SNMP::__ANON__(): Received
usmStatsNotInTimeWindows.0 Report- PDU with value 15 during synchronization
debug: [2137] Net::SNMP::_discovery_synchronization_cb(): discovery and synchron ization complete
Which IOS release do you have ? Do you have a special config for snmp on your 6xxx?
Could you check by Cisco if your release has some snmp caveats?
(I have several model of 65xx with several releases but until now I never become such snmp problems?
Did you try to do a download manually:
(FIRST read http://www.cisco.com/en/US/customer/tec ... 4aa6.shtml)
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.2.900 i 1
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.3.900 i 4
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.4.900 i 1
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.5.900 a "<server ip address>"
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.6.900 s "nameofthedownloadedfile"
snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.14.900 i 4
Perhaps you don't need the "
And under unix I am not sure for :snmpset -v 2c -c rwcommunity devicename .1.3.6.1.4.1.9.9.96.1.1.1.1.6.900 s "nameofthedownloadedfile"
because it should be a type octetstring
You PRE command should be the same as on unix (except the %y%, %d%,%m% which are parameters automatically changed by the configmanager plugin).ddonohue wrote: Pre process 'if test -d '/data/20060807' then mkdir /data/ 20060807 fi' failed for xxx.xxx.208.2. Not processing host.
here I think in your case 'if test ! -d '/data/%y%%m%%d%'; then mkdir /data/%y%%m%%d%; fi'
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
[quote="jduchesne"]
I want to create an acces-list in my router in order to have my server and one computer to speak with my router and also I work with the access list extended and not with the standard ACL so
...
telnet,snmp and the ping
[quote]
try with something like this
no access-list 101
access-list 101 permit icmp host 2.3.4.5 host 1.3.4.5
access-list 101 permit udp host 2.3.4.5 any eq snmp
access-list 101 permit udp host 2.3.4.5 any eq tftp
access-list 101 permit tcp host 2.3.4.5 any eq telnet
int vlan 1
ip access-group 101 in
I want to create an acces-list in my router in order to have my server and one computer to speak with my router and also I work with the access list extended and not with the standard ACL so
...
telnet,snmp and the ping
[quote]
try with something like this
no access-list 101
access-list 101 permit icmp host 2.3.4.5 host 1.3.4.5
access-list 101 permit udp host 2.3.4.5 any eq snmp
access-list 101 permit udp host 2.3.4.5 any eq tftp
access-list 101 permit tcp host 2.3.4.5 any eq telnet
int vlan 1
ip access-group 101 in
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
Install TFTP Server
Hi!
Can someone give me some help to install a TFTP server?
I
Can someone give me some help to install a TFTP server?
I
Who is online
Users browsing this forum: No registered users and 0 guests