some new explorers wich are handy if you must tune for example sap or
oracle to the systemtype, cpu cores and/or physical memory
This commit is contained in:
parent
2afa0ad2fc
commit
e8f5d4c340
4 changed files with 143 additions and 0 deletions
31
cdist/conf/explorer/cpu_cores
Executable file
31
cdist/conf/explorer/cpu_cores
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2014 Daniel Heule (hda at sfs.biz)
|
||||||
|
# 2014 Thomas Oettli (otho at sfs.biz)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]; then
|
||||||
|
cores="$(cat /proc/cpuinfo | grep "core id" | sort | uniq | wc -l)"
|
||||||
|
if [ ${cores} -eq 0 ]; then
|
||||||
|
cores="1"
|
||||||
|
fi
|
||||||
|
echo "${cores}"
|
||||||
|
fi
|
31
cdist/conf/explorer/cpu_sockets
Executable file
31
cdist/conf/explorer/cpu_sockets
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2014 Daniel Heule (hda at sfs.biz)
|
||||||
|
# 2014 Thomas Oettli (otho at sfs.biz)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]; then
|
||||||
|
sockets="$(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
|
||||||
|
if [ ${sockets} -eq 0 ]; then
|
||||||
|
sockets="$(cat /proc/cpuinfo | grep "processor" | wc -l)"
|
||||||
|
fi
|
||||||
|
echo "${sockets}"
|
||||||
|
fi
|
54
cdist/conf/explorer/machine_type
Executable file
54
cdist/conf/explorer/machine_type
Executable file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2014 Daniel Heule (hda at sfs.biz)
|
||||||
|
# 2014 Thomas Oettli (otho at sfs.biz)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]; then
|
||||||
|
# this should only exist on virtual guest machines,
|
||||||
|
# tested on vmware, xen, kvm
|
||||||
|
if grep -q "hypervisor" /proc/cpuinfo; then
|
||||||
|
# this file is aviable in xen guest systems
|
||||||
|
if [ -r /sys/hypervisor/type ]; then
|
||||||
|
if grep -q -i "xen" /sys/hypervisor/type; then
|
||||||
|
echo virtual by xen
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -r /sys/class/dmi/id/product_name ]; then
|
||||||
|
if grep -q -i 'vmware' /sys/class/dmi/id/product_name; then
|
||||||
|
echo "virtual by vmware"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
if grep -q -i 'bochs' /sys/class/dmi/id/product_name; then
|
||||||
|
echo "virtual by kvm"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "virtual by unknown"
|
||||||
|
else
|
||||||
|
echo "physical"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "unknown"
|
||||||
|
fi
|
27
cdist/conf/explorer/memory
Executable file
27
cdist/conf/explorer/memory
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2014 Daniel Heule (hda at sfs.biz)
|
||||||
|
# 2014 Thomas Oettli (otho at sfs.biz)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
if [ -r /proc/meminfo ]; then
|
||||||
|
echo "$(cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')"
|
||||||
|
fi
|
Loading…
Reference in a new issue