lynxus Posted July 8, 2008 Share Posted July 8, 2008 Hi guys, I have spent the passed year or so making massive php scripts that output cisco config based on a few simple bits of data.. Anyway. Ive come across a problem where just echoing to a blank page for me to copy and paste to the device just isnt an option ( Need to configure 32 switches everytime i make i change ) So, What id like to do is have the script telnet to my devices and do the code for me. Summat along the lines of below : ( My main issue is the telnet part, and how to confirm the command was sent correctly and the router is now ready for the next command ) 1) Select the devices from a database ie: 10.0.0.1 10.0.0.2 10.0.0.3 2) Telnet to 10.0.0.1 and start doing my lines of code.. IE: conf t int blaa description blaa 2.5) Do point 2 again, but for the next device ( 10.0.0.2 ) Does anyone have any idea how to achieve this? Thanks Graham Quote Link to comment Share on other sites More sharing options...
Wolphie Posted July 8, 2008 Share Posted July 8, 2008 You will need to use socket in PHP to acheive this. Although, I don't see why you wouldn't just use a shell script. Quote Link to comment Share on other sites More sharing options...
lynxus Posted July 8, 2008 Author Share Posted July 8, 2008 Shell script? Sorry i probably woudlnt know where to start with that lol Quote Link to comment Share on other sites More sharing options...
trq Posted July 8, 2008 Share Posted July 8, 2008 Yeah, I'm really not sure php is the best solution to such a problem. Id'e be inclined to use Bash and Expect. Quote Link to comment Share on other sites More sharing options...
lynxus Posted July 8, 2008 Author Share Posted July 8, 2008 Humm ok. Maybe ill try perl and the telnet::cisco plugin.. Thanks Guys Quote Link to comment Share on other sites More sharing options...
mbeals Posted July 8, 2008 Share Posted July 8, 2008 Humm ok. Maybe ill try perl and the telnet::cisco plugin.. Thanks Guys that would be the way to go. It will be the most flexible of the options, especially in terms of error handling Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.