Skip to content

Instantly share code, notes, and snippets.

Created November 9, 2014 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9f0e1a763385b549d008 to your computer and use it in GitHub Desktop.
Save anonymous/9f0e1a763385b549d008 to your computer and use it in GitHub Desktop.
/etc/profile.d/50-landscape-sysinfo.sh - Update to turn of for certain users.
#!/bin/sh
cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
[ "$cores" -eq "0" ] && cores=1
threshold="${cores:-1}.0"
if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $threshold" | bc) -eq 1 ]; then
if [ ! -f ~/.no_stats ]; then
echo
echo -n " System information as of "
/bin/date
echo
/usr/bin/landscape-sysinfo
fi
else
echo
echo " System information disabled due to load higher than $threshold"
fi
#added line 5 and line 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment