<commit_before>#!/bin/bash
#Author: <NAME> <<EMAIL>>
Log() {
        msg="echo $1"
        cmd=$2
        file=$3
        format="echo "---------------------------------------------------""

        $format >> $file
        $msg >> $file
        echo "Command Used:" $2 >> $3
        eval $cmd >> $file
        $format >> $file

        2>/dev/null
}

intro() {
##Create the Directory in Which Logs would be stored
currtime=$(date +"%b%d%Y-%H-%M-%S");
#hostnm=$(hostname)
hostnm=""
#dirname="LIS-Logs-"${hostnm};
dirname="LIS-Logs"
mkdir $dirname;
}

Collect_Waagent_Logs() {
echo "Collecting Waagent Details...."
Log "Collecting Waagent Details at" 'date' $dirname/Waagent.txt
Log "Waagent Process Running Status" 'ps -ef | grep waagent' $dirname/Waagent.txt
Log "Waagent Version is" '/usr/sbin/waagent --version' $dirname/Waagent.txt
Log "Root Device Timeout" 'cat /sys/block/sda/device/timeout' $dirname/Waagent.txt
if [[ $dist == *Debian* ]] || [[  $dist == *Ubuntu* ]]
then
Log "Waagent Package Details" 'dpkg -p walinuxagent' $dirname/Waagent.txt
else
Log "Waagent Package Details" 'rpm -qil WALinuxAgent' $dirname/Waagent.txt
fi
Log "Waagent.log file" 'cat /var/log/waagent.log' $dirname/Waagent.log
}

Collect_OS_Logs() {
echo "Collection Operating System Logs....."
Log "Collection Operating System Details at" 'date' $dirname/OS.log 
Log "Kernel Version" 'uname -a' $dirname/OS.log 
Log "Distro Release Details" 'cat /etc/issue' $dirname/OS.log 
Log "Additional Kernel Details" 'cat /proc/version' $dirname/OS.log 
Log "Mount Points" 'mount' $dirname/OS.log 
Log "System Limits" 'ulimit -a' $dirname/OS.log 
#Log "NFS Shares on System" 'showmount -e' $dirname/OS.log 
Log "Hosts File Details" 'cat /etc/hosts' $dirname/OS.log <commit_msg>Update LIS-LogCollector.sh for CoreOS<commit_after>#!/bin/bash
#Author: <NAME> <<EMAIL>>
Log() {
        msg="echo $1"
        cmd=$2
        file=$3
        format="echo "---------------------------------------------------""

        $format >> $file
        $msg >> $file
        echo "Command Used:" $2 >> $3
        eval $cmd >> $file
        $format >> $file

        2>/dev/null
}

intro() {
##Create the Directory in Which Logs would be stored
currtime=$(date +"%b%d%Y-%H-%M-%S");
#hostnm=$(hostname)
hostnm=""
#dirname="LIS-Logs-"${hostnm};
dirname="LIS-Logs"
mkdir $dirname;
}

Collect_Waagent_Logs() {
echo "Collecting Waagent Details...."
Log "Collecting Waagent Details at" 'date' $dirname/Waagent.txt
Log "Waagent Process Running Status" 'ps -ef | grep waagent' $dirname/Waagent.txt
if [ -f /usr/share/oem/bin/waagent ]
then
Log "Waagent Version is" '/usr/share/oem/python/bin/python /usr/share/oem/bin/waagent --version' $dirname/Waagent.txt
else
Log "Waagent Version is" '/usr/sbin/waagent --version' $dirname/Waagent.txt
fi
Log "Root Device Timeout" 'cat /sys/block/sda/device/timeout' $dirname/Waagent.txt
if [[ $dist == *Debian* ]] || [[  $dist == *Ubuntu* ]]
then
Log "Waagent Package Details" 'dpkg -p walinuxagent' $dirname/Waagent.txt
else
Log "Waagent Package Details" 'rpm -qil WALinuxAgent' $dirname/Waagent.txt
fi
Log "Waagent.log file" 'cat /var/log/waagent.log' $dirname/Waagent.log
}

Collect_OS_Logs() {
echo "Collection Operating System Logs....."
Log "Collection Operating System Details at" 'date' $dirname/OS.log 
Log "Kernel Version" 'uname -a' $dirname/OS.log 
Log "Distro Release Details" 'cat /etc/issue' $dirname/OS.log 
Log "Additional Kernel Details" 'cat /proc/version' $dirname/OS.log 
Log "Mount Points" 'mount' $dirname/OS.log 
Log "System Limits" 'ulimit -a' $dirname/OS.log 
#Log "NFS Shares on System" 'showmount -e' $dirname/OS.log 
Log "Hosts File Details" 'cat /etc/hosts' $dirname/OS.log 
{'fraction_non_alphanumeric': 0.18709327548806942, 'fraction_numerical': 0.0032537960954446853, 'mean_word_length': 3.2746234067207416, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, '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': '4649993', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1267, 'n_words': 355}