|
|
| Author |
Message |
lga
Joined: 23 May 2005 Posts: 21 Location: Belgium
|
Posted: Thu Dec 14, 2006 1:36 pm Post subject: |
|
|
Hi pepj,
I applied your patch and all works fine !! Big thks !
I use your plugins to backup more than 400 devices and it works very fine.
Continue the improvement of this plugin
Regards,
Lionel.
|
|
| Back to top |
|
 |
timi Cacti User
Joined: 09 Nov 2005 Posts: 138 Location: Timisoara, Romania
|
Posted: Tue Dec 19, 2006 7:44 am Post subject: |
|
|
i have a problem, in the log file i have this:
Dec 19 14:31:52 [EET/+0200] pancho: (ERROR) 192.168.5.5 Source Configuration doesnt exist.
the config file looks like this:
[global]
TftpServer=192.168.5.1
TftpRoot=/data
TftpPath=/data
LogFile=/data/testid2.conf.log
ForkLimit=10
StylePattern=::HOST::.::DATE::.cfg
StyleDate=%Y%m%d
SnmpVersion=2c
SnmpRetries=2
SnmpWait=5.2
SnmpMtu=1500
SnmpDebug=0
SnmpCommunity=writecom
[10.128.0.3]
IpAddress=192.168.5.5
what can i do ?
i'm running cacti .6h, and the device is "IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE (fc1)"
|
|
| Back to top |
|
 |
kos
Joined: 01 Nov 2006 Posts: 20 Location: Singapore
|
Posted: Wed Dec 20, 2006 9:09 am Post subject: can not create config files |
|
|
Hi Pepj,
I installed the plugin but I can't create config files. Under "manage configs" I select "add" and get the template to configure a file.
After clicking "create" the page gets refreshed, but no file is created. The sql tables "plugin_cfgmng_xxx" remain empty - in other words: nothing happened.
How can I solve the issue?
kos
| Description: |
|
| Filesize: |
83.03 KB |
| Viewed: |
1959 Time(s) |

|
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Wed Dec 20, 2006 5:49 pm Post subject: |
|
|
| timi wrote: |
pancho: (ERROR) 192.168.5.5 Source Configuration doesnt exist.
|
1/
Are you sure that pancho can download the router/switch configuration when you startet it manually from the shell ?
with
| Code: |
/usr/bin/perl -I/usr/src/redhat/SOURCES/Pancho-9.3.7/bin /usr/local/bin/pancho.pl --download --post --config /usr/local/tftp/data/configmanagerid12.conf.conf
|
You can try aso without "--post"
2/ could you try with snmp version 1
3/ check if the view for version 2 allow you to download the config
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Wed Dec 20, 2006 5:53 pm Post subject: Re: can not create config files |
|
|
| kos wrote: |
nothing happened.
|
I saw the detected IP remote address is empty ...
Could you check the file secure.cfg ?
|
|
| Back to top |
|
 |
kos
Joined: 01 Nov 2006 Posts: 20 Location: Singapore
|
Posted: Thu Dec 21, 2006 2:44 am Post subject: Can not see config files |
|
|
Hi Pepj,
the remote IP address is visible, I just deleted it in the pic.
| Quote: | Cacti Version - 0.8.6i
Plugin Architecture - 1.0
Poller Type - Cactid v0.8.6f
Server Info - Windows NT 5.2
Web Server - Microsoft-IIS/6.0
PHP - 5.1.4
PHP Extensions - bcmath, calendar, com_dotnet, ctype, date, ftp, hash, iconv, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, ISAPI, gd, mysql, snmp, sockets
MySQL - 5.0.24-community-nt
RRDTool - 1.2.15
SNMP - 5.3.0.1
PluginsRead-only Devices Tab (devices - v0.4)
PHP Network Weathermap (weathermap - v0.82)
Update Checker (update - v0.3)
Device Monitoring (monitor - v0.7)
Host Info (hostinfo - v0.1)
Simple Links page (links - v0.3)
RRD Cleaner - v1.2
Configuration manager (configmanager - v0.5b)
NAM Viewer (nam - v0.1)
Simple library page (library - v0.3) |
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Thu Dec 21, 2006 3:06 pm Post subject: Re: Can not see config files |
|
|
Could you show me was you put in the config before to click on create button ?
Could you click first on a button for method tftp or scp ?
Thanks
|
|
| Back to top |
|
 |
warnesj Cacti User
Joined: 29 May 2005 Posts: 163
|
Posted: Mon Dec 25, 2006 4:00 pm Post subject: |
|
|
Hey Pepj, great plugin! I just got it running on my Fedora Core 6 Cacti installation and it's downloading the configs for many of my switches and routers (mainly Nortel stuff).
Here were some of the things I had to do to get it running in my environment,
- It took a bit of time to get the Pancho configuration right. My TFP server is different then my Cacti server. I have my TftpRoot set to / and the TftpPath of my TFTP config set to the subdirectory of my TFTP server where my configs are saved.
- When creating a TFTP config I needed to have a fully-qualified path for the Pancho config file location. ie: /usr/share/cacti/plugins/configmanager/configs. And this path needs to be writable for the cacti user.
- I needed to modify the Baystack.pm module for Pancho for my Nortel 5500 series of switches. Easy enough to do, find
| Code: | my %types = (
BayStack => "Nortel/Baystack family",
'Business Policy Switch 2000' => "Nortel/Baystack family"
); | and change it to | Code: | my %types = (
BayStack => "Nortel/Baystack family",
'Business Policy Switch 2000' => "Nortel/Baystack family",
'Ethernet Routing Switch 55' => "Nortel/Baystack family"
); | .
The Nortel switches are limited to 30 characters. So if you're using IP addresses and Dates for the filename format of your downloaded files, the downloads may fail because the names are too long.
|
|
| Back to top |
|
 |
warnesj Cacti User
Joined: 29 May 2005 Posts: 163
|
Posted: Wed Dec 27, 2006 1:34 am Post subject: |
|
|
Hey all, I made a little modification to the configmanager_poller.php script that I thought I'd share. I have about 96 devices and I'm using the TFTP (Pancho) method to backup their configs. I was curious as to why my cfgmng_logfile.txt log file only had some of the Pancho log (5 minutes worth of the file). I took a look at the code of the configmanager_poller.php script (I hope that's okay pepj) and it appears that the poller assumes that the backup should be done by the time the next polling period, which is 5 minutes. The problem I have is that not all my devices have finished backing up yet in the 5 minutes before the Pancho log file is copied to the cfgmng_logfile.txt file.
So I added a little bit to the configmanger_poller.php script it to look to see if all the devices that are in the config have reported a status to the Pancho log file. If not my addition doesn't allow the Pancho log file to be copied to until all devices have reported. Once all devices have reported a status the rest of pepj's code is ran which copies the Pancho log file to the cfgmng_logfile.txt file.
What I did was in the configmanager_poller.php find, | Code: | //$message=date("d/m/Y H:i:s ")."COPY LOGFILE ???$finishlog??? $configname.\n";
//cfgmng_log($message);
if ($finishlog=="1") {
$confignamelog = $configname .".log"; | and change it to, | Code: | //$message=date("d/m/Y H:i:s ")."COPY LOGFILE ???$finishlog??? $configname.\n";
//cfgmng_log($message);
//Check to see if all the devices have reported back in the log file
$logfilelinecount = count(file($configname . ".log"));
$sqlrequest = "select * from plugin_cfgmng_data where configmanagerid='" . $configid . "' and state = 'enable'";
$temp = db_fetch_assoc($sqlrequest);
$devicecount = count($temp);
if ($logfilelinecount!=$devicecount) {
$message=date("d/m/Y H:i:s ")."INFO: " . $configname . ".log has " . $logfilelinecount . " of " . $devicecount . " devices with a reported status. Not copying logfile yet.\n";
cfgmng_log($message);
$finishlog="0";
}
if ($finishlog=="1") {
$confignamelog = $configname .".log"; |
This should add a couple of new INFO messages to your configmanager logfile like these,
Hope this is helpful.
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Mon Jan 01, 2007 10:41 am Post subject: |
|
|
| warnesj wrote: |
I took a look at the code of the configmanager_poller.php script (I hope that's okay pepj) and it appears that the poller assumes that the backup should be done by the time the next polling period, which is 5 minutes. |
It's OK. I 've insert your changes in the new version 0.5c and also the correction for starting the UNIX script with ";" (some post before)
|
|
| Back to top |
|
 |
kos
Joined: 01 Nov 2006 Posts: 20 Location: Singapore
|
|
| Back to top |
|
 |
didx
Joined: 16 Jun 2006 Posts: 5
|
Posted: Thu Jan 04, 2007 11:38 am Post subject: problem with 0.5c |
|
|
Hi Pepj!
I've tried to install v0.5c but i get into trouble...
When I click on manage config and then the "Add" button, I get the form but the problem is that none but the "Cancel" button work
If I click on "Cancel" ... well ... it does cancel
But when I click either on "tftp method" or on "create" button... it simply does nothing...
I tried to simulate by calling "http://[...]/configmanager?action=save"
I got this message:
=======================
Notice: Undefined index: chk_config_state in /home/www/cacti/plugins/configmanager/configmanager.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/www/cacti/plugins/configmanager/configmanager.php:175) in /home/www/cacti/plugins/configmanager/configmanager.php on line 256
========================
When I come back in "manage config"... the config is saved but when I click on it ... I see this message on the top of the page (just befor "show final configuration file...."):
====================================
function SelectAllSeveralCheckbox(formname,prefix, checkbox_state) { for (var i = 0; i < document.forms[formname].elements.length; i++) { if ((document.forms[formname].elements[i].name.substr(0, prefix.length) == prefix) && (document.forms[formname].elements[i].style.visibility != 'hidden')) { document.forms[formname].elements[i].checked = checkbox_state; } } } function ShowConfigmanager(configid) { }
====================================
Furthermore, When click on "logfile", the cacti menu that should be on the left takes half the page... and the logfile appears at the bottom of it... not on the right side...
could you help me understand what is happenning?
Thanks for all the work you've already done...
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Thu Jan 04, 2007 4:50 pm Post subject: Re: problem with 0.5c |
|
|
| didx wrote: |
I've tried to install v0.5c but i get into trouble...
|
I have seen it. It seems the sql_save function of cacti do not save the data (or always with the same id). I am searching why ...
which was the last version without this problem.
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Thu Jan 04, 2007 6:45 pm Post subject: |
|
|
I have found the problem: The auto_increment is no more activated. I don't know why in setup.php this option "auto_increment" is not really executed when the tables are not manually created. (I've got no errors)
At this time to correct it, open a SQL session and apply:
| Code: |
ALTER TABLE plugin_cfgmng_data MODIFY column id INT NOT NULL AUTO_INCREMENT,ADD INDEX (id);
ALTER TABLE plugin_cfgmng MODIFY column id INT NOT NULL AUTO_INCREMENT,ADD INDEX (id);
|
I will try to do it automatically ...
|
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Fri Jan 05, 2007 4:11 am Post subject: |
|
|
| kos wrote: |
problem with configurations' creation
|
Hi
It is the same problem as the post before:
| Code: |
open a SQL session:
mysql.exe --user=root --password cacti
enter your password
then ....
ALTER TABLE plugin_cfgmng_data MODIFY column id INT NOT NULL AUTO_INCREMENT,ADD INDEX (id);
ALTER TABLE plugin_cfgmng MODIFY column id INT NOT NULL AUTO_INCREMENT,ADD INDEX (id);
|
I will correct it in the code.
|
|
| Back to top |
|
 |
|