Skip to content

Commit

Permalink
Merge pull request MichaIng#275 from rhkean/testing
Browse files Browse the repository at this point in the history
V116 NETDATA
  • Loading branch information
Fourdee committed Apr 14, 2016
2 parents abb3879 + cde3213 commit 5826edf
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ AUTO_DietpiSoftware_Install_DIETPICAM=0
AUTO_DietpiSoftware_Install_DELUGE=0
AUTO_DietpiSoftware_Install_RASPCONTROL=0
AUTO_DietpiSoftware_Install_LINUXDASH=0
AUTO_DietpiSoftware_Install_NETDATA=0
AUTO_DietpiSoftware_Install_PIHOLE=0
AUTO_DietpiSoftware_Install_SUBSONIC=0
AUTO_DietpiSoftware_Install_WEAVED=0
Expand Down Expand Up @@ -252,4 +253,4 @@ dietpi_emonhub_apikey=
# D I E T - P I
# Dev settings
#------------------------------------------------------------------------------------------------------
gitbranch=master
gitbranch=master
5 changes: 4 additions & 1 deletion dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"mariadb"
"redis-server"
"emonhub"
"netdata"
)

aSERVICE_AVAILABLE=0
Expand All @@ -68,6 +69,8 @@
elif [ -f /etc/init.d/"${aSERVICE_NAME[$i]}" ]; then
aSERVICE_AVAILABLE[$i]=1

elif [ -f /etc/systemd/system/"${aSERVICE_NAME[$i]}".service ]; then
aSERVICE_AVAILABLE[$i]=1
fi

done
Expand Down Expand Up @@ -185,4 +188,4 @@
#-----------------------------------------------------------------------------------
exit
#-----------------------------------------------------------------------------------
}
}
66 changes: 66 additions & 0 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
EMONCMS=0
EMONHUB=0
RPIMONITOR=0
NETDATA=0
BAIKAL=0

#Linux Software
Expand Down Expand Up @@ -344,6 +345,7 @@ SQUEEZELITE $SQUEEZELITE
EMONHUB $EMONHUB
EMONCMS $EMONCMS
RPIMONITOR $RPIMONITOR
NETDATA $NETDATA
BAIKAL $BAIKAL
Expand Down Expand Up @@ -462,6 +464,7 @@ _EOF_
EMONHUB=$(cat "$FP_INSTALLED_FILE" | grep -m1 'EMONHUB ' | awk '{print $2}')
EMONCMS=$(cat "$FP_INSTALLED_FILE" | grep -m1 'EMONCMS ' | awk '{print $2}')
RPIMONITOR=$(cat "$FP_INSTALLED_FILE" | grep -m1 'RPIMONITOR ' | awk '{print $2}')
NETDATA=$(sed -nr 's/^NETDATA\s+(.*)/\1/p' "$FP_INSTALLED_FILE")
BAIKAL=$(cat "$FP_INSTALLED_FILE" | grep -m1 'BAIKAL ' | awk '{print $2}')

#Linux
Expand Down Expand Up @@ -1932,6 +1935,34 @@ _EOF_

fi

#NETDATA
if (( $NETDATA == 1 )); then
INSTALL_DESCRIPTION='netdata'
Banner_Installing

#check, is online
INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/netdata_1.0.0_armhf.tgz'
/DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS"
#[ -f /boot/custom/netdata-armhf.tgz ]

#Install
if (( $? == 0 )); then

# AGI --no-install-recommends zlib1g-dev autoconf autogen automake nodejs
AGI --no-install-recommends zlib1g-dev nodejs
wget "$INSTALL_URL_ADDRESS" -O package.tgz
tar -xzvf package.tgz -C /
rm package.tgz

else
Error_NoConnection_NoInstall

#Abort failed install
NETDATA=0
fi

fi

#BAIKAL
if (( $BAIKAL == 1 )); then
INSTALL_DESCRIPTION='BaiKal'
Expand Down Expand Up @@ -4238,6 +4269,21 @@ _EOF_

fi

#NETDATA
if (( $NETDATA == 1 )); then

getent group netdata > /dev/null || groupadd -r netdata
getent passwd netdata > /dev/null || useradd -r -g netdata -c netdata -s /sbin/nologin -d / netdata

for x in /var/cache/netdata /usr/share/netdata/web /etc/netdata /var/log/netdata; do
chown -R netdata.netdata $x
chmod 0755 $x
done

NETDATA=2

fi

#BAIKAL
if (( $BAIKAL == 1 )); then

Expand Down Expand Up @@ -5807,6 +5853,16 @@ _EOF_
fi
fi

#NETDATA
local netdata_w="off"
if (( $NETDATA > 0 )); then
netdata_w="on"
#Reset to 0. Menu checklists will apply back to 1
if (( $NETDATA == 1 )); then
NETDATA=0
fi
fi

#-----------------------------------------------------------------------------
WHIP_TITLE='DietPi Optimized Software Selection'

Expand Down Expand Up @@ -5840,6 +5896,7 @@ _EOF_
"DietPi-Cloudshell" "System stats for your LCD display or monitor." $dietpicloudshell_w \
"LinuxDash" "Web interface system stats." $linuxdash_w \
"PhpSysInfo" "Web interface system stats." $phpsysinfo_w \
"netdata" "real-time performance monitoring" $netdata_w \
"" "────System Security────────────────────────" "off" \
"Fail2Ban" "Prevents brute-force attacks with IP ban." $fail2ban_w \
"" "────Webserver Stacks───────────────────────" "off" \
Expand Down Expand Up @@ -5953,6 +6010,7 @@ _EOF_
"DietPi-Cloudshell" "System stats for your LCD display or monitor." $dietpicloudshell_w \
"LinuxDash" "Web interface system stats." $linuxdash_w \
"PhpSysInfo" "Web interface system stats." $phpsysinfo_w \
"netdata" "real-time performance monitoring" $netdata_w \
"" "────System Security────────────────────────" "off" \
"Fail2Ban" "Prevents brute-force attacks with IP ban." $fail2ban_w \
"" "────Webserver Stacks───────────────────────" "off" \
Expand Down Expand Up @@ -6033,6 +6091,7 @@ _EOF_
"DietPi-Cloudshell" "System stats for your LCD display or monitor." $dietpicloudshell_w \
"LinuxDash" "Web interface system stats." $linuxdash_w \
"PhpSysInfo" "Web interface system stats." $phpsysinfo_w \
"netdata" "real-time performance monitoring" $netdata_w \
"RPi-Monitor" "Web interface system stats." $rpimonitor_w \
"" "────System Security────────────────────────" "off" \
"Fail2Ban" "Prevents brute-force attacks with IP ban." $fail2ban_w \
Expand Down Expand Up @@ -6105,6 +6164,7 @@ _EOF_
"Raspcontrol" "Web interface system stats." $raspcontrol_w \
"LinuxDash" "Web interface system stats." $linuxdash_w \
"PhpSysInfo" "Web interface system stats." $phpsysinfo_w \
"netdata" "real-time performance monitoring" $netdata_w \
"" "────System Security────────────────────────" "off" \
"Fail2Ban" "Prevents brute-force attacks with IP ban." $fail2ban_w \
"" "────Webserver Stacks───────────────────────" "off" \
Expand Down Expand Up @@ -6475,6 +6535,12 @@ _EOF_
INSTALL_DIETPI_CHOICESMADE=true
fi
;;
netdata)
if (( $NETDATA == 0 )); then
NETDATA=1
INSTALL_DIETPI_CHOICESMADE=true
fi
;;
esac
done < /tmp/dietpi-software_results
rm /tmp/dietpi-software_results &> /dev/null
Expand Down
8 changes: 7 additions & 1 deletion dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,12 @@ _EOF_

elif (( $VERSION_CURRENT == 115 )); then
#-------------------------------------------------------------------------------
# Add netdata to existing dietpi.txt automation file
DietPi_Software_Addition NETDATA 0
if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_NETDATA=') == 0 )); then
sed -i "/AUTO_DietpiSoftware_Install_LINUXDASH=/a AUTO_DietpiSoftware_Install_NETDATA=0" /DietPi/dietpi.txt
fi

# + DietPi.txt Proxy settings
if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^proxy_address=') == 0 )); then
cat << _EOF_ >> /DietPi/dietpi.txt
Expand All @@ -595,4 +601,4 @@ _EOF_
#-------------------------------------------------------------------------------
exit
#-------------------------------------------------------------------------------
}
}

0 comments on commit 5826edf

Please sign in to comment.