Print log if error occurs
This commit is contained in:
parent
481392d75c
commit
ac406e652e
|
@ -24,7 +24,6 @@ collectors=$(cat << COLLECTORS
|
||||||
megacli
|
megacli
|
||||||
COLLECTORS
|
COLLECTORS
|
||||||
)
|
)
|
||||||
|
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
port="$((10000 + (RANDOM % 10000)))"
|
port="$((10000 + (RANDOM % 10000)))"
|
||||||
|
@ -74,11 +73,13 @@ fi
|
||||||
echo $! > "${tmpdir}/node_exporter.pid"
|
echo $! > "${tmpdir}/node_exporter.pid"
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
if [ ${verbose} -ne 0 ]
|
if [ $? -ne 0 -o ${verbose} -ne 0 ]
|
||||||
then
|
then
|
||||||
echo "LOG ====================="
|
cat << EOF >&2
|
||||||
cat "${tmpdir}/node_exporter.log"
|
LOG =====================
|
||||||
echo "========================="
|
$(cat "${tmpdir}/node_exporter.log")
|
||||||
|
=========================
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${update} -ne 0 ]
|
if [ ${update} -ne 0 ]
|
||||||
|
|
Loading…
Reference in New Issue