and the rest of it...

This commit is contained in:
2024-12-11 13:03:15 -06:00
parent c2b1b821f7
commit f759149c11
26 changed files with 9767 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/bash
#Create index
time duc index / --fs-exclude=nfs
#Produce report
cd /root
TODAY="$(date +%m-%d)"
REPORT_FILENAME="$(hostname).$TODAY.png"
duc graph /
mv duc.png $REPORT_FILENAME
#Send report to central server
scp -i /root/.ssh/duc_rsa $REPORT_FILENAME duc_user@txn04-slack-master.tplab.tippingpoint.com:/var/www/html/space/

45
disk_space/install_duc.sh Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
#A script to install duc onto any KNEL managed system
duc-install()
{
echo "Installing duc..."
wget --quiet https://github.com/zevv/duc/releases/download/1.4.1/duc-1.4.1.tar.gz -O /tmp/duc.tar.gz
cd /tmp
tar xfz duc.tar.gz
cd duc-1.4.1
./configure
make
make install
cd /tmp
rm -rvf duc-1.4.1
rm -rvf duc.tar.gz
echo "Installed duc"
}
main-ubuntu()
{
apt-get install -y tokyocabinet-bin libncursesw5-dev libcairo2-dev libpango1.0-dev build-essential libtokyocabinet-dev
duc-install
}
main-centos()
{
yum -y install pango-devel cairo-devel tokyocabinet-devel gcc ncurses-devel
duc-install
}
#######################################################################################################################################################
#Step 1: Figure out what distro we are, call the appropriate function which begins execution
#######################################################################################################################################################
wget --quiet https://dl.turnsys.com/bootstrap/bin/distro -O /usr/bin/distro
chmod +x /usr/bin/distro
DISTRO_TYPE="$(distro |awk -F '|' '{print $4}'|tr '[:upper:]' '[:lower:]')"
if [ $DISTRO_TYPE = "ubuntu" ] ; then main-ubuntu ; fi
if [ $DISTRO_TYPE = "centos" ] ; then main-centos ; fi