Friday, August 12, 2011

Pacemaker / Perl : GetOptions


Pacemaker is a resource manager for clusters. It keeps track of which node services are working  and executes corrective actions for those that fail, and makes sure the application using those services is available. It will be interesting to find out under which criteria does it consider a service or node to be broken ( network timeouts?).

[caption id="attachment_400" align="aligncenter" width="300" caption="Introduction to pacemaker"][/caption]


GetOptions is a perl module that parses command line options you pass to a perl script. I found out about it while trying to make a perl script work. For instance, dissecting a perl script I'm dealing with:

[sourcecode language="perl"]
("H|help" => \$help,
"d|database=s" => \$database,
"h|host=s" => \$host,
"u|user=s" => \$user,
"c|cluster=s" => \$cluster,
"p|password=s" => \$password,
"P|port=i" => \$port,
"m|mailprog=s" => \$mailprog,
"f|finalquery=s" => \$finalquery,
"r|recipient=s" => \$recipient);


we see that in this particular script, we could specify flags such as -d databaseName, -h localhost and so on.

No comments:

Post a Comment