Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
It doesn't follow that rule set. I put an enable command in there and it doesn't run it at all.
I've tried setting the device as auto detect and cisco ios without change.
Youre still running it from the command line? If so does it eventually error out or just hang forever or what? It ought to work fine. I have updated code if you'd like to try it. (I've now extended it to work with HP and Foundry devices)
It gets to the enable prompt and doesn't go any further. The command you mentioned above where it looks for the enable prompt is there, but I couldn't say why it is not finding the enable prompt :/
Thanks for the update Ill give it a try when I'm near a computer next.
Yeah, I'd run it from cli using php /cactipath/plugins/routerconfigs/router-download.php and watch it til it completes. Ive removed some of the echo stuff from the script (cause I didnt need it) and as such the debug information isnt always useful. When it finishes it'll either say failed or success and why. Post that.
[root@localhost ~]# php /var/www/html/plugins/routerconfigs/router-download.php
Processing asa
PHP Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
PHP Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 127
Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 127
PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 142
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 142
ÿûÿûÿûÿû
User Access Verification
Username: admin
Password: **********
Type help or '?' for a list of available commands.
ASA-01> Login failed333PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 207
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 207
Saving Debug
Processing switch
PHP Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
ÿûÿûÿýÿý
User Access Verification
Username: ÿþ ÿúÿðÿþ'ÿýadmin
Password:
3750-1>Login failed333Saving Debug
04/26/2010 10:58:39 AM - RouterConfigs: Poller[0] -1272279345 seconds
0 devices backed up successfully.
2 devices failed to backup.
These devices failed to backup
--------------------------------
asa - Login failed
switch - Login failed
[root@localhost ~]#
Here is the complete output under the command line. Thanks for helping.. I've tried to get it working myself but any changes I make to the functions.php either don't work or run or I get a blank page with a php syntax error when I load the page..
It almost looks like theres a syntax error in functions that while not severe enough to cause it to not run, has made it unaware of the enablepw variable. Back that file up and try this one out of the box from the command line again and post the results if you would.
[root@localhost ~]# php /var/www/html/plugins/routerconfigs/router-download.php
Processing asa
PHP Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
PHP Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 127
Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 127
PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 142
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 142
ÿûÿûÿûÿû
User Access Verification
Username: admin
Password: **********
Type help or '?' for a list of available commands.
ASA-01> Login failed333PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 207
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 207
Saving Debug
Processing switch
PHP Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
Notice: Undefined index: enablepw in /var/www/html/plugins/routerconfigs/functions.php on line 337
PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 140
ÿûÿûÿýÿý
User Access Verification
Username: ÿþ ÿúÿðÿþ'ÿýadmin
Password:
3750-1>Login failed333Saving Debug
04/26/2010 02:26:15 PM - RouterConfigs: Poller[0] -1272291801 seconds
0 devices backed up successfully.
2 devices failed to backup.
These devices failed to backup
--------------------------------
asa - Login failed
switch - Login failed
[root@localhost ~]#
Right below this comment (//If non-cisco use PHPTelnetHP class vs standard
) is a select statement that's then run through a foreach and if block. Let's add the following to it: (underneath the foreach and then its opening brace)
Then run it again and post the output. I just want to make sure that the select is functioning as expected. After that run well throw some additional echos in to see whats breaking and why.
[root@localhost ~]# php /var/www/html/plugins/routerconfigs/router-download.php
Processing asa
PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 126
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 126
value is PHP Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 1
Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/routerconfigs/functions.php on line 128
PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 141
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 141
PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 143
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 143
ÿûÿûÿûÿû
User Access Verification
Username: admin
Password:
Username: Login failed333PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 208
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 208
Saving Debug
Processing switch
PHP Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 126
Notice: Undefined variable: value in /var/www/html/plugins/routerconfigs/functions.php on line 126
value is PHP Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 141
Notice: Undefined variable: result in /var/www/html/plugins/routerconfigs/functions.php on line 141
ÿûÿûÿýÿý
User Access Verification
Username: ÿþ ÿúÿðÿþ'ÿýadmin
Password:
% Authentication failed
Username:
% Username: timeout expired!Login failed333Saving Debug
04/27/2010 11:26:48 AM - RouterConfigs: Poller[0] -1272367436 seconds
0 devices backed up successfully.
2 devices failed to backup.
These devices failed to backup
--------------------------------
asa - Login failed
switch - Login failed
[root@localhost ~]#
Strange, I dont see that echo in your output. It looks like the select is what's breaking. (select being the if $value == "HP" line) For some reason it looks like it's not executing that if block. Underneath the if $value == HP line add in a
//end class use
if ($result == 0) {
// If HP skip re-connecting to the device and causing a false positive
if ($value !="HP") {
I'm wondering what PHP version you are using, sicne I'm not using the latest. I'm using the CactiEZ pre-built software. I have just started a fresh with your original final functions.php file and it doesnt work then so it isnt breaking because of any thing I have done, but I am wondering if it's because of the php version I am using.
I'll try upgrading, and if I don't break everything else in the process I'll re-try and see what happens.
In the meantime, since I have two servers I can pursue both simultaneously - I just cannot see the == HP line, unless you mean != HP