Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Automate Linodes
PostPosted: Mon Jun 08, 2009 5:04 am 
Offline
Newbie

Joined: Mon Jun 08, 2009 4:48 am
Posts: 4
I would like to be able to automate the linode control panel based on a set of user defined rules.

For example: For my business I want to set up a personal server cloud where all of my linodes are clustered together as a single server (which I can already do). But at times I will need more linodes than usual and as things are now I will have to add those linodes manually then turn right around and remove them.

Instead I would like a control panel feature where actions in the control panel can be triggered by an event( say running out of bandwidth).


Top
   
 Post subject:
PostPosted: Mon Jun 08, 2009 7:46 am 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
I believe Linode provisioning methods are going to be added to the API soon. (Too lazy to cite my source)


Top
   
 Post subject:
PostPosted: Mon Jun 08, 2009 9:19 am 
Offline
Senior Member

Joined: Mon Feb 28, 2005 7:21 pm
Posts: 76
mwalling wrote:
I believe Linode provisioning methods are going to be added to the API soon. (Too lazy to cite my source)


Would love to see that. Backups first, though! :)


Top
   
 Post subject:
PostPosted: Mon Jun 08, 2009 2:48 pm 
Offline
Newbie

Joined: Mon Jun 08, 2009 4:48 am
Posts: 4
That's good to hear but I wish they would do it soon.


Top
   
 Post subject:
PostPosted: Tue Jun 09, 2009 2:59 am 
Offline
Newbie

Joined: Mon Jun 08, 2009 4:48 am
Posts: 4
I just thought that I would post this in case someone else finds it useful.

I found a way to automate linode( or any site for that matter). My solution can only automate, it isn't a replacement for an API (but automation is all I need).

The answer is Lynx scripts. Lynx is a text (console web browser).
In lynx you use the keyboard to navigate websites and you can have lynx record your key strokes on a given site to a file and then play them back later (lynx script).

Create a script at the command-line type:
Code:
lynx -cmd_log=filename siteURL

Then do what ever task you want to automate and press q ( to quit) when done.

Run script:
Code:
lynx -cmd_script=filename siteURL


You must use the same file and url or it won't work.


Top
   
PostPosted: Tue Jun 23, 2009 9:08 pm 
Offline
Newbie

Joined: Tue Jun 23, 2009 7:45 pm
Posts: 3
That lynx trick is cute. Of course, it doesn't get you very far if you need to parameterize the session in any way.

A more robust tool for screen scraping type of automation is curl (apt-get install curl). It allows as much flexibility and parameterization in the script as you need. I have found two practical ways of using it:

1. If you just need to poke/grab one web page, encapsulate the curl command in a shell script that carries the command line args to curl params/options.
2. If the automation script needs to "go places", or generally maintain state (cookies etc.) over multiple PUTs/GETs, the easiest is to use the PHP bindings for curl and use the command line interface version of PHP, also known as "PHP (cli)".
Code:
apt-get install php5-cli php5-curl

Of course, seeing that a Linode API will soon be here, there's hopefully no longer any need to use this form of automation on Linode specifically.

_________________
Unix/Linux programmer (20 years experience) available for remote work. PM me.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group