plugin for download/upload routers switches configuration

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

StarLog wrote:Can someone tell me what is not active.?

2008-04-05 00:47:08 Error: download. RESULT: Error: function in developpement ....... not activ.

2008-04-05 00:47:08 INFO: execute the upload/download configuration 1 (/data/configmanagerid1.conf) with php tftp.
I am getting exactly the same issue - anyone have any ideas on this ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
fourier
Posts: 5
Joined: Fri Sep 29, 2006 3:52 am

plugin for download/upload routers switches configuration

Post by fourier »

I am getting error when create database for configmanager.
cacti:/usr/local/cacti-0.8.7b/plugins/configmanager0.76 # mysql --user=root --password cacti < /usr/local/cacti-0.8.7b/plugins/configmanager0.76/configmanager.sql
Enter password:
ERROR 1062 (23000) at line 7: Duplicate entry '1' for key 1

Please help me to solve this problem.

Thanks a lot!!
123ralle
Posts: 15
Joined: Wed Dec 20, 2006 7:32 am

Post by 123ralle »

Hi,

I've the config manager running with the cisco tftp method and
could successfully build an telnet netscreen script for downloading
the config.
Now i've an cisco pix 525, which is only accessible via ssh from the cacti host. The cacti host is running under linux.
Does anybody have an script for ssh for an cisco pix or another ssh based script for another device as sample for me ?

Ralf
123ralle
Posts: 15
Joined: Wed Dec 20, 2006 7:32 am

Post by 123ralle »

Hi,

just anther question :

How do i get an colored diff on a linux system, or is it only supported on windows systems ?

Ralf
pjkks
Posts: 10
Joined: Fri Oct 17, 2008 2:02 pm

Post by pjkks »

AARRRRGGG!!!! :)

Regretfully there is not any decent document on installing pancho on Windows server.

Here is what I've done so far to get this up and running.

-installed 3CDaemon tftp/ftp server
-Placed configmanager in cacti/plugins - modified global.php
-copied diff.exe and gzip.exe to cacti/plugins/configmanager
-placed sharednetworkclass in cacti/plugins - modified global.php
-sql database was created through the program as instructed
-downloaded/installed ActivePerl for Windows

tried to use without pancho first but here is what I get.

)
[binair] => 0
[usepancho] => 0
[accepttrap] => 0
[tftp] => 10.X.X.X
[startup] => 1
[commit] => 0
[templatename] =>
[fileformat] => ::HOST::.::DATE::.cfg
[post] =>
[pre] =>
[command] =>
[snmp_community] => oxxxxxxx
[snmp_priv_protocol] => DES
[snmp_priv_passphrase] =>
[snmp_auth_protocol] => MD5
[snmp_password] =>
[snmp_username] =>
[snmp_version] => 1
[sun] => 0
[sat] => 0
[fri] => 1
[thu] => 0
[wed] => 0
[tue] => 0
[mon] => 0
[monthly] => 0
[state] => up
[fileupload] => /data/upload.cfg
[pathdata] => /data
[path] => /data
[date] => 2008-10-24 10:49:00
[up_download] => download
[configtype] => tftp
[name] => configmanager
[id] => 2
(
data to save are :Array
24/10/2008 10:48:10 SQL Save configuration's parameters in tables plugin_cfgmng. -> id result=2, code=0 errortext=
24/10/2008 10:48:10 start SQL Save configuration's parameters in tables
2008-10-24 10:32:40 create pancho config for configmanager(configid=2) --> \data\configmanagerid2.conf!24/10/2008 10:48:01 start ADD / EDIT configuration's parameters



Any ideas?

Thanks
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

has anyone successfully gotten the --pre cmds to work ...I can get my configs ( about 40 roght now ) tftp'd down to my cacti server but cant get the --pre cmd to work where it will create a folder first to put them in with the day's date/// I just used the ex. in the config page..

if test -d '/tftpboot/switchconfigs/%y%%m%%d%'; then mkdir /tftpboot/switchconfigs/%y%%m%%d% fi

I dont' seem to get this porttion to work..it dumps all configs in my /switchconfigs/ dir.

Any ideas???

Thanks
eracouze
Posts: 3
Joined: Tue Sep 23, 2008 5:51 am

Post by eracouze »

Hi Pepj and all

Could Pepj or anyone help me? I can't download configuration via tftp.My Cacti server is base on Fedora core 9, Cacti version 0.8.7b, PIA 2.1, configmanager 0.76, sharednetwork 0.40, Config::IniFiles 2.39-6 and Parallel::ForkManager 0.7.5-2

Pancho method:
My config is
[global]
TftpServer=10.1.20.200
TftpRoot=/usr/share/cacti/plugins/configmanager
LogFile=/usr/local/etc/pancho.log
ForkLimit=5
StylePattern=::Host::-confg
StyleDate=%Y%m%d
SnmpVersion=1
SnmpRetrives=1
SnmpWait=5.0
SnmpMtu=1500
SnmpDebug=0
SnmpCommunity=privaterw
[Cisco7506]
IpAddress=172.16.20.1
My device is Cisco 7506 IOS version 12.0(26)S.
When I used command "perl -w -I/usr/local/lib /usr/local/bin/pancho --download --config /usr/local/etc/pancho.conf".
I got "ERROR (cisco-7513): Network timeout" :(
[root@CactiServer ~]# perl -w -I/usr/local/lib /usr/local/bin/pancho --download --config /usr/local/etc/pancho.conf

ERROR (cisco-7513): Network timeout
Shell script method:
Command is "sh telnetdownloadunix.sh 172.16.20.1 user pass test.cfg 10". Result is "sleep: invalid time interval `10\r'". :o
[root@CactiServer ~]# sh telnetdownloadunix.sh 172.16.20.1 user pass test.cfg 10
sleep: invalid time interval `10\r'
Try `sleep --help' for more information.
Connection closed by foreign host.
csplit: cannot open `temp' for reading: No such file or directory
telnetdownloadunix.sh: line 10: syntax error: unexpected end of file
Pure PHP method:
I tried with command "php example8_tftp_snmp_networkclass.php -i=172.16.20.1 -v=1 -c=privatemoe -p=161 -d=1 -l=1 -m=1 -a=/usr/bin --tftpdirection=download --filesource=run --filedestination=test.cfg --tftpserver=10.1.20.200". I got "PHP Notice: Undefined offset: 0 in /usr/share/cacti/plugins/sharednetworkclass/snmp_cisco.class.php on line 936" and "DEBUG: HOST:172.16.20.1 RESULT:n". :-?
[root@CactiServer sharednetworkclass]# php example8_tftp_snmp_networkclass.php -i=172.16.20.1 -v=1 -c=cloudmoe -p=161 -d=1 -l=1 -m=1 -a=/usr/bin --tftpdirection=download --filesource=run --filedestination=test.cfg --tftpserver=10.1.20.200
initialisation:OK
show the sysDescr
Found data query XML file at './MIBXML/MIBtoLoad.xml'
sysDescr-> result=Cisco Internetwork Operating System Software IOS (tm) RSP Software (RSP-PV-M), Version 12.0(26)S, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2003 by cisco Systems, Inc. Compiled Mon 25-Aug-03 10:2
vendor class used is Cisco(oid=.1.3.6.1.4.1.9)
parameter passed to the classArray
(
[startup] => 0
[source] => download
[tftpip] => 10.1.20.200
[filesrc] => run
[filedest] => test.cfg
[binary] => 0
)

Found data query XML file at './MIBXML/MIBtoLoad.xml'
DEBUG tftp typtransfert=ciscoIOS
DEBUG CiscoTFTPIOStransfert: random number=888, source=run, source's file=4, destination=tftp, thedestination's file=1
DEBUG CiscoTFTPIOStransfert: random number=888, source=run, source's file=4, destination=tftp, thedestination's file=1
PHP Notice: Undefined offset: 0 in /usr/share/cacti/plugins/sharednetworkclass/snmp_cisco.class.php on line 936
DEBUG CiscoTFTPIOStransfert result: result=
DEBUG: HOST:203.146.15.246 RESULT:n
Could Pepj or anyone help me? I try to solve these problem for more than 3 days. But I still can't solve these although I read all pages in this topic.
Thank so much for your help and, thanks Pepj for great plugin which make Cacti more powerful. And sorry for my poor English. :cry:

Boy
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

New release of configmanager 0.8x

Post by pepj »

Hello

sorry for the long long delay. I will try to help you again ...

First there is a new release of configmanager 0.8x.
I have :
  • add some sort function,
    add some scripts examples (ex for llinux download with password and expect) or examples which can pass the log of the script to the configmanager cacti-plugin.
    changed the name method "multi" to "script"
    and other little changing for the log, some views, ...
PS: I have see now that some unix script are in dos format. Please use dos2unix to convert it or remove the cariage return. I will change it as soon as possible. (it is the problem of "eracouze" I think).

now I will answer to your problems this week ....
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 »

mcutting wrote:
StarLog wrote:Can someone tell me what is not active.?
2008-04-05 00:47:08 Error: download. RESULT: Error: function in developpement ....... not activ.
2008-04-05 00:47:08 INFO: execute the upload/download configuration 1 (/data/configmanagerid1.conf) with php tftp.
I am getting exactly the same issue - anyone have any ideas on this ?
please install again the version configmanager0.8 and sharednetworkclass0.42

The problem was your linux php do not support the function "snmp_set_oid_output_format" in order to give back an numeric oid and you do not activated the setting of configmanager "net-snmp".
To give you the both possiblities (with php or net-snmp) I have add the function "snmp_set_oid_numeric_print" in sharednetworkclass0.42. On CatiEZ it is functioning.
If the problem persist (that mean your php do accept neither snmp_set_oid_output_format nor snmp_set_oid_numeric_print, you will have to select the option net-snmp in the setting of configmanager.
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

Re: Update ..

Post by pepj »

blugger wrote:Here the output of the logging in the case I manually trigger a SW download:
2008-07-13 11:09:06 exec_background(/srv/www/htdocs/plugins/configmanager/scripts/save_cfg_switchrouter.pl 10.65.0.10 admin ***
As you can see this works (MANUALLY)!
Did you solve your problem ?
If not could we check step by step (the execution I think your config is OK).
1/ set cacti-log to POLLER_VERBOSITY_MEDIUM at least.
2/ change the time of the execution, something after the actual time. Do a reset in 5 minutes.
3/ do you see in the cacti log something like : CFG MANAGER POLLER:EXEC=
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 »

jrego wrote:ok i got it installed i think..
can someone help with this error when i run php configmanager_poller.php -d
PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/share/cacti/plugins/configmanager/configmanager_poller.php on line 11
Do you have still this error with configmanager0.8x ?
If yes
Try to change in configmanager_poller.php

Code: Select all

if (is_file("./include/global.php")) {
  include("./include/global.php");
} else {
  // old cacti + plugin architecture (before 0.8.7)
  include("./include/config.php");
}
in to

Code: Select all

  include("./include/global.php");
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

Re: plugin for download/upload routers switches configuratio

Post by pepj »

fourier wrote:I am getting error when create database for configmanager.
ERROR 1062 (23000) at line 7: Duplicate entry '1' for key 1
Please help me to solve this problem.
Thanks a lot!!
It should not be an error. But Configmanager was quicker as you and installed already the SQL tables. (you do not need to install sql manually)
Can you check if you have following SQL tables?
plugin_cfgmng
plugin_cfgmng_basis
plugin_cfgmng_data
plugin_cfgmng_trap
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 »

123ralle wrote:Hi,
I've the config manager running with the cisco tftp method and
could successfully build an telnet netscreen script for downloading
the config.
Now i've an cisco pix 525, which is only accessible via ssh from the cacti host. The cacti host is running under linux.
Does anybody have an script for ssh for an cisco pix or another ssh based script for another device as sample for me ?
Ralf
I will prefer ssh.
You have to ways. First notice what you do manually.
1/ with the linux ssh, but you have to work with public/private key because ssh do not accept a password. Create an user in pix and cacti, create a public key for him on both system and install the public key of the cactiuser in the .ssh/authorized_keys of pix for this user.
create a script which send the commands you do manually to ssh.
ps: The script will no function if the key has been changed.
2/ If you want to give the password from configmanager or directly in script, you have to work we expect (to be installed).
have a look at the script ssh-ios-config.sh (and file ssh-ios-config.exp)
If you need only two commands to do that you want, you do not have to change something (only pass in configmanager your commands instead show run). If you have a lot of commands you have to pass a file with your commands and change the line with "spawn ssh $user@$host $arg1 $arg2"
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 »

123ralle wrote: Does anybody have an script for ssh for an cisco pix or another ssh based script for another device as sample for me ?f
see post before.
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 »

pjkks wrote:AARRRRGGG!!!!
1/ with sharednetworkclass you need neither pancho nor perl.
2/ what is your problem ?
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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests