Created
April 6, 2011 21:09
-
-
Save vvuksan/906528 to your computer and use it in GitHub Desktop.
Produce Rundeck compliant node list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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