Routerconfigs plugin / how it works?
Moderators: Developers, Moderators
I tried updating the php version and broke everything on that server.
The PHP version is 5.1.6.
Anyway,
If I enter these lines before if ($enablepw != '') { then it enables and logs in but doesnt run any copy commands.. can you help me remove the IF commands so that it proceeds onwards? I've tried commenting them out but I get all sorts of PHP errors relating to something called nesting
Thanks!!
The PHP version is 5.1.6.
Anyway,
If I enter these lines before if ($enablepw != '') { then it enables and logs in but doesnt run any copy commands.. can you help me remove the IF commands so that it proceeds onwards? I've tried commenting them out but I get all sorts of PHP errors relating to something called nesting
Thanks!!
Code: Select all
@fputs($this->fp, "en\r");
@fputs($this->fp, "$pass\r");
Sorry for the delayed response here. Things have been hectic @ the office lately and I haven't had a moment to spare. So at this point you've upgraded php and things are working other than cisco device backups? Heres my php ver:
Also, do you use the same account (within router configs) to back up both ciscos and HP's?
Code: Select all
PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Hi,
I couldnt upgrade to 5.2 so I'm back using 5.1 (the same as you) which is okay as we have the same PHP ver.
I'm using different credentials, and have actually managed to try this on a different group of devices at a different location, without success.
If you see the post above, I can get the plugin to login to Cisco devices is I tell it not to check for the > prompt, so something is wrong with the checking the " > " feature.
I was going to try and replace the phptelnet class but I think I wont be able to, as I don't know enough to complete that task
I couldnt upgrade to 5.2 so I'm back using 5.1 (the same as you) which is okay as we have the same PHP ver.
I'm using different credentials, and have actually managed to try this on a different group of devices at a different location, without success.
If you see the post above, I can get the plugin to login to Cisco devices is I tell it not to check for the > prompt, so something is wrong with the checking the " > " feature.
I was going to try and replace the phptelnet class but I think I wont be able to, as I don't know enough to complete that task
OK, was just wondering about the different accounts as I'm using different accounts here. If you want to skip checking for > you'd want to comment out the following lines: (lines 469 - 501 in my functions file)
...strange that were having issues getting it going there. It's working fine here for cisco, HP and Foundry ServerIrons.
Code: Select all
if ($enablepw != '') {
# Get > to show we are at the command prompt and ready to input the en command
$res = '';
$x = 0;
while ($x < 10) {
sleep(3);
$this->GetResponse($r);
echo $r;
$res .= $r;
if (strpos($r, '>') !== FALSE) {
break;
}
$x++;
}
@fputs($this->fp, "en\r");
# Get the password prompt again to input the enable password
$res = '';
$x = 0;
while ($x < 10) {
sleep(3);
$this->GetResponse($r);
echo $r;
$res .= $r;
if (strpos($res, $devicetype['password']) !== FALSE) {
break;
}
$x++;
}
$r=explode("\n", $r);
@fputs($this->fp, "$enablepw\r");
}
Sweet as. That now logs in to HP and Cisco.
There is an issue somewhere as the HP reports "protocol error" when it tries to back up, and the Cisco ASA reports "%Error opening system:150.20.1.140 (No such file or directory)" but, I can fix this when I have more time I'm quite certain.
Many thanks for your help for the past 6 pages. Each time I came to a dead end you have assisted. Cheers!
Once I test / fix my issues I will re-upload the functions.php
There is an issue somewhere as the HP reports "protocol error" when it tries to back up, and the Cisco ASA reports "%Error opening system:150.20.1.140 (No such file or directory)" but, I can fix this when I have more time I'm quite certain.
Many thanks for your help for the past 6 pages. Each time I came to a dead end you have assisted. Cheers!
Once I test / fix my issues I will re-upload the functions.php
-
- Posts: 6
- Joined: Wed Nov 11, 2009 12:13 pm
- Location: Germany
Hello,
i have installed the lates routerconfigs from www.cacti.net.
I am using cacti 0.8.7e and PIA 2.6. My php version is
if i run from cli as cacti user
the configs of my devices are stored in the DB. I can compare config and so on.
My problem is, that the download doesn't run automaticly. What triggers the automatic download? How can i debug this? What information do you need to help to solve this issue?
Thanks
Heiko
i have installed the lates routerconfigs from www.cacti.net.
I am using cacti 0.8.7e and PIA 2.6. My php version is
Code: Select all
PHP 5.3.1 (cli) (built: Feb 15 2010 17:27:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
Code: Select all
php /srv/www/htdocs/cacti/plugins/routerconfigs/router-download.php
My problem is, that the download doesn't run automaticly. What triggers the automatic download? How can i debug this? What information do you need to help to solve this issue?
Thanks
Heiko
Last edited by dertoaster on Thu May 06, 2010 9:56 am, edited 1 time in total.
-
- Posts: 6
- Joined: Wed Nov 11, 2009 12:13 pm
- Location: Germany
-
- Posts: 6
- Joined: Wed Nov 11, 2009 12:13 pm
- Location: Germany
I have looked in the logs. I can't see any issu that's indicate to the routerconfigs.
That's my crontab for the cacti user:
Can you give me a short explanation how routerconfigs work?
That's my crontab for the cacti user:
Code: Select all
php -q /srv/www/htdocs/cacti/poller.php >> /srv/www/htdocs/cacti/log/poller.log 2>&1
I personally don't know. But, I summise that, when the crontab runs, it also runs the routerconfigs plugin. The plugin checks the length of time since it last run, and if its larger than the time you specified (one day, etc) then it continues to run the routerconfigs plugin.
You may wish to start a thread on your exact issue, as this thread was to enable HP and ALL Cisco devices to be backed up by the routerconfigs plugin.
If I were you (If you can do this) look at the SQL database for the times of when the last routerconfigs run. And also look under each device in cacti how long you have specified to back up devices i.e. every day, every week etc.
You may wish to start a thread on your exact issue, as this thread was to enable HP and ALL Cisco devices to be backed up by the routerconfigs plugin.
If I were you (If you can do this) look at the SQL database for the times of when the last routerconfigs run. And also look under each device in cacti how long you have specified to back up devices i.e. every day, every week etc.
Okay so I have been working on the routerconfigs / cacti server. It backs up both HP and Cisco but when it does HP it doesnt realise it has saved the config so it reports as failed. However if I go to the TFTP directory then the config is there. Any ideas? Here is the output when run from the CLIgrady wrote:Sounds good.
Code: Select all
2610-01# copy start tftp 192.168.250.39 172.23.3.250
2610-01# Saving Debug
05/09/2010 03:23:51 PM - RouterConfigs: Poller[0] -1273436576 seconds
0 devices backed up successfully.
1 devices failed to backup.
These devices failed to backup
--------------------------------
172.23.3.250 -
[root@localhost ~]#
Who is online
Users browsing this forum: No registered users and 1 guest