2006-06-24 11:17:20 +00:00
|
|
|
#!/bin/sh
|
2008-03-09 22:09:11 +00:00
|
|
|
#
|
|
|
|
# 2006-2008 Nico Schottelius (nico-ccollect at schottelius.org)
|
|
|
|
#
|
|
|
|
# This file is part of ccollect.
|
2006-06-24 11:17:20 +00:00
|
|
|
#
|
2008-03-09 22:09:11 +00:00
|
|
|
# ccollect 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.
|
|
|
|
#
|
|
|
|
# ccollect 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 ccollect. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# Initially written on 24-Jun-2006
|
2006-06-24 11:17:20 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
CCOLLECT_CONF=${CCOLLECT_CONF:-/etc/ccollect}
|
|
|
|
CCOLLECT_INTERVALS="$CCOLLECT_CONF/defaults/intervals"
|
|
|
|
|
2007-08-16 21:39:18 +00:00
|
|
|
me="$(basename $0)"
|
|
|
|
|
|
|
|
_echo()
|
|
|
|
{
|
|
|
|
echo "$me> $@"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -d "${CCOLLECT_INTERVALS}" ]; then
|
|
|
|
_echo "No intervals defined in ${CCOLLECT_INTERVALS}"
|
|
|
|
exit 1
|
2006-06-24 11:17:20 +00:00
|
|
|
fi
|
|
|
|
|
2007-08-16 21:39:18 +00:00
|
|
|
set -e
|
|
|
|
cd "${CCOLLECT_INTERVALS}"
|
2006-06-24 11:17:20 +00:00
|
|
|
|
|
|
|
for interval in *; do
|
2007-08-16 21:39:18 +00:00
|
|
|
eval int_${interval}=$(cat "${interval}");
|
|
|
|
eval echo ${interval}: \$int_${interval};
|
2006-06-24 11:17:20 +00:00
|
|
|
done
|