wertarbyte / hetzner-robot-perl Goto Github PK
View Code? Open in Web Editor NEWPerl module and command line tool for control over the Hetzner robot
Home Page: http://wertarbyte.de/
Perl module and command line tool for control over the Hetzner robot
Home Page: http://wertarbyte.de/
Hetzner::Robot / hetzner-robot.pl by Stefan Tomanek <[email protected]> http://github.com/wertarbyte/hetzner-robot-perl Control the Hetzner robot from your Perl scripts or console. The script hetzner-robot.pl can be used as a standalone program as well as an object oriented Perl module in your own scripts. It uses the JSON-Webservice deployed by Hetzner (http://wiki.hetzner.de/index.php/Robot_Webservice) and encapsulates it into a class/object structure. Many default operations are provided through a command line interface. == Examples for standalone operation == # retrieve reverse DNS entry for IP address 1.2.3.4 hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode rdns --get --addr 1.2.3.4 # set reverse DNS entry for address 1.2.3.4 to "foobar.example.org" hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode rdns --set --addr 1.2.3.4 --hostname foobar.example.org # instruct the hetzner robot to trigger a hardware reset at server 1.2.3.4 hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode reset --address 1.2.3.4 --method hw # enable the rescue system for server 1.2.3.4 hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode rescue --address 1.2.3.4 --system linux --arch 64 # send Wake-On-LAN signal to system 1.2.3.4 hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode wol --address 1.2.3.4 # switch failover address to server 1.2.3.4 hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode failover --address 5.6.7.8 --target 1.2.3.4 # retrieve status of a failover address hetzner-robot.pl --user "USERNAME" --password "PASSWORD" \ --mode failover --address 5.6.7.8 --status # to hide the password from the command line, it can be read from stdin: echo "passphrase" | hetzner-robot.pl --user "USERNAME" --readpw ... == Examples for use in scripts == #!/usr/bin/perl # load module use Hetzner::Robot; my $robot = new Hetzner::Robot("username", "password"); my $serverA = $robot->server("1.2.3.4"); # enumerate subnets assigned to server for my $n ($serverA->subnets) { print $n->address."/".$n->netmask, "\n"; } # send WOL signal to all servers for my $sys ($robot->servers) { print "Waking up ".$sys->address."\n"; $sys->wol->execute; # $sys->reset->execute("sw"); # we could trigger a soft reboot as well ;-) } The examples directory also contains a simple CGI script to grant customers limited access to the reverse DNS capabilities of the robot; each customer can access the RDNS records of the addresses associated with their username.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.