Skip to content

Instantly share code, notes, and snippets.

@vvuksan
Created April 6, 2011 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvuksan/906528 to your computer and use it in GitHub Desktop.
Save vvuksan/906528 to your computer and use it in GitHub Desktop.
Produce Rundeck compliant node list
Stick the PHP file in your Ganglia Web directory. Then in
$RUNDECK_HOME/projects/Default/etc/project.properties
add following lines
project.resources.file = /opt/rundeck/projects/Default/etc/resources.yaml
project.resources.url = http://ganglia.local/ganglia/rundeck.php
In Rundeck web UI there will be a link that says
Update nodes for Project Default
<?php
$conf['ganglia_dir'] = dirname(__FILE__);
include_once $conf['ganglia_dir'] . "/eval_conf.php";
include_once $conf['ganglia_dir'] . "/functions.php";
include_once $conf['ganglia_dir'] . "/get_context.php";
$context = "cluster";
include_once $conf['ganglia_dir'] . "/ganglia.php";
include_once $conf['ganglia_dir'] . "/get_ganglia.php";
foreach ( $metrics as $node => $metric_array ) {
if ( isset($metric_array['os_name']['VAL']) ) {
print "$node:
description: Rundeck node
hostname: $node
nodename: $node
osArch: " . $metric_array['machine_type']['VAL'] . "
osFamily: unix
osName: " . $metric_array['os_name']['VAL'] . "
osVersion: " . $metric_array['os_release']['VAL'] . "
tags: ''
username: root
";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment