<commit_before>#!/bin/bash
[ -z $BASH ] && echo "You must run this script in bash" && exit 1
if [ "$LOGNAME" != "root" ]
then
  echo "You must run this script as root"
  exit 1
fi

echo "Collecting diags"
echo "This script attempts to collect a wide range of diagnostics, some of which may not be available on your system - don't worry if this script produces warning messages for these."

ROUTE_FILE=route
CALICO_CFG=/etc/calico
CALICO_DIR=/var/log/calico
NEUTRON_DIR=/var/log/neutron
NOVA_DIR=/var/log/nova
date=`date +"%F_%H-%M-%S"`
diags_dir=./"$date"
system=`hostname`
echo "  creating dir $diags_dir"
mkdir "$diags_dir" || exit 2
pushd "$diags_dir" > /dev/null || exit 2

echo "  storing system state..."

echo DATE=$date > date
echo $system > hostname

facter > facter 2>&1
ps auwxx > ps 2>&1
df -h > df
ss -tnlp > ss 2>&1

dpkg -l > dpkg 2>&1
yum list > yum_list 2>&1
yum repolist > yum_repolist 2>&1

for cmd in "route -n" "ip route" "ip -6 route" "ip rule list"<commit_msg>Change diags collection dir name<commit_after>#!/bin/bash
[ -z $BASH ] && echo "You must run this script in bash" && exit 1
if [ "$LOGNAME" != "root" ]
then
  echo "You must run this script as root"
  exit 1
fi

echo "Collecting diags"
echo "This script attempts to collect a wide range of diagnostics, some of which may not be available on your system - don't worry if this script produces warning messages for these."

ROUTE_FILE=route
CALICO_CFG=/etc/calico
CALICO_DIR=/var/log/calico
NEUTRON_DIR=/var/log/neutron
NOVA_DIR=/var/log/nova
date=`date +"%F_%H-%M-%S"`
system=`hostname`
diags_dir=./calico-diags_"$system"_"$date"
echo "  creating dir $diags_dir"
mkdir "$diags_dir" || exit 2
pushd "$diags_dir" > /dev/null || exit 2

echo "  storing system state..."

echo DATE=$date > date
echo $system > hostname

facter > facter 2>&1
ps auwxx > ps 2>&1
df -h > df
ss -tnlp > ss 2>&1

dpkg -l > dpkg 2>&1
yum list > yum_list 2>&1
yum repolist > yum_repolist 2>&1

for cmd in "route -n" "ip route" "ip -6 route" "ip rule list"
{'fraction_non_alphanumeric': 0.13247011952191234, 'fraction_numerical': 0.01693227091633466, 'mean_word_length': 4.0225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1624490', 'n_tokens_mistral': 799, 'n_tokens_neox': 754, 'n_words': 269}