HP Insight Cluster Management Utility User Manual
Page 110
[root@cmumaster ~]# sinfo -t alloc -o "%N" -h
node[10-12,14,20-21,33-39,41-48,50-55]
[root@cmumaster ~]#
To use an HP Insight CMU tool for expanding names to create a space-separated list of allocated
nodes:
[root@cmumaster ~]# sinfo -t alloc -o "%N" -h | /opt/cmu/tools/cmu_expand_names -s " "
node10 node11 node12 node14 node20 node33 node34 node35 node36 node37 node38 node39 node41 node42 node43 node44
node45 node46 node47 node48 node50 node51 node52 node53 node54 node55
[root@cmumaster ~]#
To apply this example to your workload scheduler, replace this SLURM command with the
appropriate command from your workload scheduler.
To submit this data into HP Insight CMU:
/opt/cmu/bin/cmu_submit_extended_metrics
The ‘help’ option describes how to submit data into HP Insight CMU:
[root@cmumaster ~]# /opt/cmu/bin/cmu_submit_extended_metrics -h
Usage: /opt/cmu/bin/cmu_submit_extended_metrics -f <filename>
The filename must exist and contain per-node metric data in the following format:
BEGIN_NODE <nodelist>
metric1_name metric1_value
metric2_name metric2_value
...
metricN_Name metricN_value
BEGIN_NODE <nodelist>
metric1_name metric1_value
metric2_name metric2_value
...
The nodelist is typically one node name, but can be a space-separated list of node names if
the subsequent metrics and values apply to a given list of nodes.
To obtain and submit this data, write a bash script:
[root@cmumaster ~]# cat ./allocated_nodes.sh
#!/bin/bash
CMU_EXPAND=/opt/cmu/tools/cmu_expand_names
CMU_SUBMIT=/opt/cmu/bin/cmu_submit_extended_metrics
CMU_NODES=/opt/cmu/bin/cmu_show_nodes
file=/tmp/alloc_nodes.txt
alloc_nodes=`sinfo -t alloc -o "%N" -h | $CMU_EXPAND -s " "`
# find the list of nodes that are unallocated
all_nodes=`$CMU_NODES`
free_nodes=””
for n in $all_nodes; do
found=0
for a in $alloc_nodes; do
if [ $a = $n ]; then
found=1
break
fi
done
if [ $found = 0 ]; then
free_nodes=”$free_nodes $n”
fi
done
# write the file and submit to CMU
rm –f $file
echo “BEGIN_NODE $alloc_nodes” > $file
echo “allocated 1” >> $file
110
Monitoring a cluster with HP Insight CMU