#!/bin/bash ISUCS="$(hostname |grep ucs -c)" if [ $ISUCS -ne 0 ]; then echo "Do not run this on ucs host. Exiting..." exit 1 fi ######################################## #Common to all systems ######################################## #Fix timezone unlink /etc/localtime ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime MGMT_INT=$(netstat -rn|grep 0.0.0.0|head -n1|awk '{print $NF}') PFV_MGMT_IP=$(ifconfig $MGMT_INT|grep inet|grep 10.251 -c) OVH_MGMT_IP=$(ifconfig $MGMT_INT|grep inet|grep 10.222 -c) if [ $PFV_MGMT_IP -eq 1 ]; then tsysSysLocation=pfv fi if [ $OVH_MGMT_IP -eq 1 ]; then tsysSysLocation=ovh fi ####################################################################################################################################################### #Fixup the /etc/hosts file ####################################################################################################################################################### if [ $PFV_MGMT_IP -eq 1 ]; then #Static /etc/hosts bits cat > /etc/hosts << HOSTFILESTATIC 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 HOSTFILESTATIC #Dynamic /etc/hosts bits cat >> /etc/hosts < /etc/hosts << HOSTFILESTATIC 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 HOSTFILESTATIC #Dynamic /etc/hosts bits cat >> /etc/hosts < /etc/mailname #Step 3: The usual suspects export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install snmpd ncdu iftop nethogs screen acct tshark tcpdump glances dstat htop sysdig sysstat rsync clamav logwatch zsh sl postfix molly-guard mailutils lldpd auditd rkhunter rsyslog ngrep ntp nut-client lm-sensors zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl python-dnspython python-mysqldb libssl-dev libuv1-dev # download it - the directory 'netdata' will be created cd /root git clone https://github.com/netdata/netdata.git --depth=100 cd netdata # run script with root privileges to build, install, start Netdata ./netdata-installer.sh --disable-cloud -u --dont-wait --stable-channel #Turn on process accounting echo "Turning on process accounting..." accton on newaliases slack tsys-$tsysSysLocation