Skip to content

Commit

Permalink
Merge branch 'hostnumber_fix_34' into 'OVIS-3.4'
Browse files Browse the repository at this point in the history
Hostnumber fix for 3.4

batch of systemd genders init script updates (see commit comments) based on production feedback at lanl and snl.

See merge request !996
  • Loading branch information
narategithub committed Jul 12, 2018
2 parents 44249e7 + b3db198 commit e74f77b
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 29 deletions.
2 changes: 1 addition & 1 deletion ldms/man/ldms-static-test.man
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ If input_file is not found in the current directory, it is checked for in $docdi
.TP
.I $test_dir/logs/vg.$k.%p
.br
The valgrind log for the kth daemon, if valgrind is active.
The valgrind log for the kth daemon with PID %p, if valgrind is active.
.TP
.I $test_dir/logs/$k.txt
.br
Expand Down
17 changes: 13 additions & 4 deletions util/sample_init_scripts/genders/man/ldms-attributes.man
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@ ldmsd_use_inet_socket=V If the value V is "yes", an INET socket for
ldmsd_config_port=R Defines the port number R of the INET socket. If
not present and INET socket is used, defaults to
410.
ldmsd_id=EX Define per-node component_id. EX is an expression per
"Attribute value substitution with node name
fragments" below. The result must be decimal.
Overrides ldmsd_idbase and ldmsd_idsuffix.
ldmsd_idbase=IDMIN Defines the least component_id for a node type.
For a class of node names differing only in an
integer ISUFFIX, component_id is IDMIN+ISUFFIX.
component_id of 0 is reserved;
ensure IDMIN+ISUFFIX>0.
component_id of 0 is reserved; ensure IDMIN+ISUFFIX>0.
Overrideable with the LDMSD_IDBASE environment
variable, which is not recommended except for
debugging.
debugging. Overrideable with ldmsd_id.
ldmsd_idsuffix=EX Define per-node component_id ISUFFIX. EX is an
expression per "Attribute value substitution with
node name fragments" below. The result is added to
IDMIN. If not defined, the equivalent of %0D is used.
ldmsd_dbg=LEVEL Defines the daemon binary's logging level, with
values as defined in ldmsd(8) and NONE,
which routes all logging to /dev/null.
Expand Down Expand Up @@ -128,6 +135,8 @@ ldmsd_config_gen_SUFFIX=PROG Defines SUFFIX plugin config file
# For example:
ldmsd_procnetdev=PARAMLIST Defines config flags of procnetdev.
ldmsd_sysclassib=PARAMLIST Defines config flags of sysclassib.
ldmsd_meminfo=schema/gw_meminfo Defines meminfo while overriding the schema name.
Schema renaming can prevent conflicts at csv stores.
ldmsd_config_text_meminfo=yes Appends /etc/sysconfig/ldms.d/plugins-conf/meminfo
to the standard plugin startup line.
ldmsd_config_gen_vmstat=yes Runs /etc/sysconfig/ldms.d/plugins-conf/gen.vmstat
Expand Down Expand Up @@ -275,7 +284,7 @@ If nodes mon[1-4] are themselves to be monitored by montop, then they must have
.SH Attribute value substitution with node name fragments

Libgenders supports replacing "%n" (unqualified node name) in attribute values.
LDMS attribute processing extends this to include extraction and reuse of various node name fragments by position. This enables the collapse of certain voluminous attribute definitions into a single line. The additional substitutions supported are %N[d,m,u] which take the Nth fragment of the type indicated by d, m, or u from the node name. The fragment types d, m, u are, respectively, an integer segment embedded in the node name, a segment separated by the '-' character from other segments of the node name, and a segment separated by the '_' character from other segments. Note that the m and u segment types do not exclude digits within. Segments are numbered from 0.
LDMS attribute processing extends this to include extraction and reuse of various node name fragments by position. This enables the collapse of certain voluminous attribute definitions into a single line. The additional substitutions supported are %N[d,D,m,u] which take the Nth fragment of the type indicated by d, D, m, or u from the node name. The fragment types d, D, m, u are, respectively, an integer segment embedded in the node name, an integer segment trimmed of leading zeroes, a segment separated by the '-' character from other segments of the node name, and a segment separated by the '_' character from other segments. Note that the m and u segment types do not exclude digits within. Segments are numbered from 0.

For example the attribute definitions:
.nf
Expand Down
14 changes: 14 additions & 0 deletions util/sample_init_scripts/genders/man/ldmsd-genders.man
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,19 @@ If defined, this overrides the ldmsd_store_plugins gender.
If set, overrides gender ldmsd_interval_default used to control sampling rate.

.B LDMSD_OFFSET_DEFAULT=DT

If set, overrides gender ldmsd_interval_default used to control sampling rate.

.B VGBIN=/usr/bin/valgrind

If set, overrides gender ldmsd_vg defining the wrapper tool location. Must be a full path.
May be any wrapper tool, not just valgrind.

.B VGOPT="argument list"

If set, overrides argument data pointed to in gender ldmsd_vgargfile.
Ignored if VGBIN and gender ldmsd_vg are both undefined.

.PP

.SH FILES
Expand All @@ -214,6 +225,9 @@ Home of the ldmsd configuration processing scripts: ldmsd, ldms-functions.
.I /etc/sysconfig/ldms.d/ldmsd.local.conf
Environment variables and override settings for monitoring the local host.
.TP
.I /etc/sysconfig/ldms.d/ldmsd.all_instances.conf
Optional environment variables and override settings for multiple hosts.
.TP
.I /etc/sysconfig/ldms.d/plugins-conf
Plugin configuration text fragments, configuration text generation programs, or
entire configuration files are kept. The fragments, files, and generators are used only as directed by genders. See ldms-attributes(5) for details of their use.
Expand Down
24 changes: 19 additions & 5 deletions util/sample_init_scripts/genders/src/ldmsctl_args3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class genders_api : public virtual ldms_config_info {
*
* output: substituted genderval based on the following:
* replace %#d with the #'th integer substring in hostname
* replace %#D with the #'th integer substring in hostname 0 left stripped
* replace %#m with the #'th - separated substring in hostname
* replace %#u with the #'th _ separated substring in hostname
* Any case where # is greater than the number of such
Expand All @@ -184,9 +185,25 @@ class genders_api : public virtual ldms_config_info {
string ghost(host);
regex ire("[0-9]*");
sregex_iterator i(ghost.begin(), ghost.end(), ire);
sregex_iterator j(ghost.begin(), ghost.end(), ire);
sregex_iterator end;

int n = 0;
// make number-based replacements %#D
while ( j != end) {
if ((*j).length()) {
ostringstream oss;
oss << "%" << n << "D";
string sub = oss.str();
string jval = j->str();
string kval = jval.substr( jval.find_first_not_of( "0" ) );
replace_all(val, sub, kval);
n++;
}
++j;
}

n = 0;
// make number-based replacements %#d
while ( i != end) {
if ((*i).length()) {
Expand Down Expand Up @@ -289,19 +306,16 @@ class genders_api : public virtual ldms_config_info {
string offsets = prefix + "_offset_default";
string tmp;
if (has_property(host, ports, tmp)) {
if (dbg > 0) {
cerr << "For port of " << prefix << " parsed " << tmp << endl;
}
t.port = tmp;
istringstream ss(tmp);
int chk;
ss >> chk;
if (chk < 1) {
cerr << ports << " of " << tmp << " bogus for " << host <<endl;
cerr << "INFO: " << ports << " of " << tmp << " not integer for " << host <<endl;
} else {
if (dbg > 0) {
cerr << "For port of " << prefix << " parsed " << tmp << endl;
}
t.port = tmp;
}
} else {
t.port = LDMS_PORT_DEFAULT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ldmsd \
ldms-functions \
ldmsd.local.conf \
ldmsd.agg.conf \
ldmsd.all_instances.conf.example \
README
endif

Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ check_genders_file() {
v="$v, $val"
fi
done
x=`$NODEATTR $NODEATTRFILE -n -A |grep ^ldmsd`
y=`$NODEATTR $NODEATTRFILE -n -A |grep ^ldmsaggd`
if test -n "$x" -o -n "$y"; then
logger -p syslog.err "Found ldms genders without hostnames: $x $y."
((n++))
fi
if test $n -gt 0; then
logger -p syslog.err "Gender file problems: $n ($v). These genders need to be removed, replaced, correctly spelled, or punctuated as noted."
logger -p syslog.err "Review $NODEATTRFILE"
Expand Down Expand Up @@ -320,6 +326,7 @@ echoq()
# input: hostname input_val
# output: substituted value based on the following:
# replace %#d with the #'th integer substring split from hostname
# replace %#D with the #'th integer substring split from hostname less lead 0s
# replace %#m with the #'th - separated substring split from hostname
# replace %#u with the #'th _ separated substring split from hostname
# Any case where # is greater than the number of such
Expand All @@ -336,11 +343,21 @@ gender_substitute () {
echo ""
return
fi
ilist=$(echo $ghost | sed -e 's/[-_a-zA-Z]*/ /g')
ilist=`echo $ghost | sed -e 's/[-_a-zA-Z]\+/ /g'`
wlist=$(echo $ghost | sed -e 's/-/ /g')
ulist=$(echo $ghost | sed -e 's/_/ /g')
vnew=$val
n=0
for i in $ilist; do
sub="%${n}D"
j=`echo $i | sed -e 's/^0*//'`
if test -z "$j"; then
j=0
fi
vnew=$(echo ${vnew//$sub/$j})
((n++))
done
n=0
for i in $ilist; do
sub="%${n}d"
vnew=$(echo ${vnew//$sub/$i})
Expand Down Expand Up @@ -462,14 +479,21 @@ start_ldmsd_plugins () {
grok="`config_from_gender $configtmp`"
eval extraconfig='$grok'
conf="0"
schema=""
if test -n "$extraconfig"; then
conf="v2"
schema=`echo $extraconfig|sed -e 's/.*schema//g' -e 's/ .*//g' -e 's/^=//'`
if test -n "$schema"; then
instance=${producer}/$schema
else
instance=${producer}/${pi}
fi
fi

# plugin options from per-plugin plain text file
cattext=`$NODEATTR $NODEATTRFILE -v $host ldmsd_config_text_${pi} 2>/dev/null`
if test -n "$cattext"; then
if test $conf = "1"; then
if test $conf != "0"; then
logger -p syslog.warning -t ldmsd.config.$pi "Skipping plugin $pi. Specifying both ldmsd_config_text_${pi} and ldmsd_${pi} is not allowed."
continue
fi
Expand Down Expand Up @@ -524,8 +548,11 @@ start_ldmsd_plugins () {

echoq "Generating config for metric plugin <${pi}>"
# write stuff to out as determined from gender values
if test -z "$instance"; then
instance=${producer}/${pi}
fi
ARGS_START="name=$pi interval=$interval offset=$offset"
ARGS_CONFIG="name=$pi producer=$producer instance=${producer}/${pi} component_id=${COMPONENT_ID}"
ARGS_CONFIG="name=$pi producer=$producer instance=${instance} component_id=${COMPONENT_ID}"
echo load name=${pi} >> $out
case $conf in
v2)
Expand Down Expand Up @@ -828,6 +855,6 @@ generate_transform_config() {
}

#export -f start_ldms_plugins start_add_hosts start_stores
export generate_collector_config generate_aggregator_config generate_store_config generate_transform_config build_genders_file check_genders_file
export generate_collector_config generate_aggregator_config generate_store_config generate_transform_config build_genders_file check_genders_file check_log_option


#LDMS_POST_INSTALLED=0 do not change this line
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#
# Example of centrally defining ports and timing on a multi-cluster
# aggregation host. Each cluster has its own daemon for level two on
# host milly. The set of clusters is managed by the CAPVIZ team.
#
# This contains includable logic common to all aggregators that tweaks by target.
# Ports on milly need to be consistently defined and timing needs to
# not produce NIC contention.
# The variable ALL_PICKY can be set to make the failure to match a configured
# host fatal.

# in order of who aggregates first. used in other utility scripts, not here.
clusterlist="skybridge chama serrano solo uno ghost doom eclipse hazel cts1x"

# cluster csv ldmsds start at 413 (411, 412 reserved for milly)
# web serving ldmsds start at 453 eventually
# job serving ldmsds start at 473 eventually
# coll serving ldmsds start at 493 eventually
case $LDMSCLUSTER in
milly)
export MILLY_PORT=411
;;
agg)
export MILLY_AGG_PORT=412
;;
solo)
export CAPVIZ_AGG_PORT=413
;;
chama)
export CAPVIZ_AGG_PORT=414
;;
skybridge)
export CAPVIZ_AGG_PORT=415
;;
serrano)
export CAPVIZ_AGG_PORT=416
;;
uno)
export CAPVIZ_AGG_PORT=417
;;
ghost)
export CAPVIZ_AGG_PORT=418
;;
cts1x)
export CAPVIZ_AGG_PORT=419
;;
doom)
export CAPVIZ_AGG_PORT=420
;;
eclipse)
export CAPVIZ_AGG_PORT=421
;;
hazel)
export CAPVIZ_AGG_PORT=422
;;
*)
if test -n "$ALL_PICKY"; then
echo "PORT: unset for $LDMSCLUSTER in ldmsd.all_instances.conf"
exit 1
fi
esac



# timing on a shared network link needs to be consistent and noncontending.
# current schedule is 2 second gap between clusters. larger may need longer.
base_interval=60000000
# max offset is 29999999
case $LDMSCLUSTER in
solo)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=8200000
;;
chama)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=4200000
;;
skybridge)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=2200000
;;
serrano)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=6200000
;;
uno)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=10200000
;;
ghost)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=12200000
;;
cts1x)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=18200000
;;
doom)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=14200000
;;
eclipse)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=16200000
;;
hazel)
export CAPVIZ_AGG_INTERVAL=$base_interval
export CAPVIZ_AGG_OFFSET=16200000
;;
*)
if test -n "$ALL_PICKY"; then
echo "TIMING: unset for $LDMSCLUSTER in ldmsd.all_instances.conf"
exit 1
fi
esac
Loading

0 comments on commit e74f77b

Please sign in to comment.