This file contains 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
#! /bin/bash | |
# Note: run from /var/lib/ganglia directory, no need for subdir | |
# Run with: find /var/lib/ganglia/rrds/ -type d -exec sh -c 'cd "{}" ; /var/lib/ganglia/rrd_exporter.sh ;' \; | |
mkdir -p /tmp/ganglia-export/xml/ | |
RUNDATE="$(date --date='now' +%F-%R)" | |
BACKUPFILE="/tmp/ganglia-export/rrds-${RUNDATE}.tar" | |
EXPORTFILE="/tmp/ganglia-export/xml-export-${RUNDATE}.tar" | |
# backup current rrd files -- tar all and place in /tmp |
This file contains 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
def explode_from_fields(df, target_columns: list, separator: str): | |
""" df = dataframe to split, | |
target_columns = list of the columns containing the values to split, | |
if the elements returned from the split are not the | |
same for each columns, the shorter ones are extended | |
to the longest. | |
separator = the symbol used to perform the split | |
returns: A dataframe with each entry for the target column separated, | |
with each element moved into a new row. | |
The values in the other columns are duplicated across the newly divided rows.""" |