Routerconfigs not work
Moderators: Developers, Moderators
Routerconfigs not work
Hello! At start backup in auto and a manual mode in the table "plugin_routerconfigs_devices" mysql there is an error lasterror = "ERROR: Unable to open telnet network connection". That it is necessary to check up. I understand that the script can't create connection to a host. How it is possible to include detailed debug works of this script? In a cacti.log the information routerconfigs isn't displayed. The usual telnet from the server on a host passes without problems. In advance I am sorry for my English, I use the translator.
Re: Routerconfigs not work
I don't use ssh, only telnet
Re: Routerconfigs not work
Ah, sorry.slava75 wrote:I don't use ssh, only telnet
Probably it fails fsockopen() function in 'plugins/routerconfigs/functions.php'.
In 'Settings -> General', change "Poller Logging Level" to DEBUG then look into cacti.log for details.
Re: Routerconfigs not work
And unless poller participates in process if to press manually the button backup? Whether Should occur backup during each start poller? In quality poller costs spine. Debug level is inconvenient, as for 2 intervals (for 5 minutes) the size логфайла > 10Mb. For 2 periods in a broad gull there are no lines containing "router"
Re: Routerconfigs not work
Then, try this test code:slava75 wrote:Debug level is inconvenient, as for 2 intervals (for 5 minutes) the size логфайла > 10Mb. For 2 periods in a broad gull there are no lines containing "router"
Parameters in blue should be specified by yourself.<?php
include("./include/global.php");
include("./plugins/routerconfigs/functions.php");
$devicetype = array('username' => 'sername:',
'password' => 'assword:',
'copytftp' => 'copy start tftp',
'version' => 'show version',
'forceconfirm' => 0,
'checkendinconfig' => 1
);
$connection = new PHPTelnet();
$result = $connection->Connect("IP address", "username", "password", "enable password", $devicetype);
echo "\nResult: $result\n";
$connection->DoCommand("show clock", $result);
echo "\nResult: $result\n";
$connection->Disconnect();
?>
In my case: (*** is unreadable character)
Code: Select all
% php telnet_test.php
*******
User Access Verification
Username: *************
Password:
Switch>en
Password:
Switch#
Result: 0
Result: 17:15:42.319 JST Wed Nov 16 2011
Re: Routerconfigs not work
This script works without errors
Code: Select all
php -f ./test_backup.php
User Access Verification
Username: xxxx
Password:
C3560>en
Password:
C3560#
Result: 0
Result: show users
Line User Host(s) Idle Location
* 1 vty 0 xxxxx idle 00:00:00 xxx.xxx.xxx.xxx
Interface User Mode Idle Peer Address
C3560#
Re: Routerconfigs not work
Hmm, then, please check (again) your configurations in "Router Configs" menu.slava75 wrote:This script works without errors
Especially,
- "IP Address" and "Authentication Account" in 'Devices' tab
- All settings in 'Authentication' tab
Re: Routerconfigs not work
All options are made according to the documentation. To be mistaken there it is difficult. The command a telnet isn't carried out. tcpdump doesn't fix any package to a switch. Can be a problem eth0 has IP no address? At me are lifted subinterfeises (eth0.3, eth0.4)??
Re: Routerconfigs not work
Sorry I'm not sure about that.slava75 wrote:Can be a problem eth0 has IP no address? At me are lifted subinterfeises (eth0.3, eth0.4)??
Once again..
If you executed the above test script as poller user (e.g. cactiuser) or web server user (e.g. nobody, apache),
does it work fine?
Re: Routerconfigs not work
Has inserted in crones a line
Code: Select all
*/5 * * * * cacti php /etc/cacti/test_backup.php > /var/log/testcacti.log
Code: Select all
cat /var/log/testcacti.log
Warning: session_start(): open(/var/lib/php/session/sess_4ii6ek3hh5tl0l2vbtm0dt6ji2, O_RDWR) failed: Permission denied (13) in /etc/cacti/include/global.php on line 151
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /etc/cacti/include/global.php:151) in /etc/cacti/include/global.php on line 151
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /etc/cacti/include/global.php:151) in /etc/cacti/include/global.php on line 151
............
User Access Verification
Username: .. ........'...xxxx
Password:
C3560>en
Password:
C3560#
Result: 0
Result: show users
Line User Host(s) Idle Location
* 1 vty 0 xxxxx idle 00:00:00 xxx.xxx.xxx.xxx
Interface User Mode Idle Peer Address
C3560#
Warning: Unknown: open(/var/lib/php/session/sess_4ii6ek3hh5tl0l2vbtm0dt6ji2, O_RDWR) failed: Permission denied (13) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
Re: Routerconfigs not work
Try this: (added "2>&1")
If same result is recorded, it (=telnet by PHP) seems to work.. There might be another reasons.
I'm not sure whether the above warnings about session affected your problem.
Code: Select all
*/5 * * * * cacti php /etc/cacti/test_backup.php > /var/log/testcacti.log 2>&1
I'm not sure whether the above warnings about session affected your problem.
Re: Routerconfigs not work
I too think that function (=telnet PHP) works, it is strange why doesn't work in the general context
Who is online
Users browsing this forum: No registered users and 0 guests