Task #3307
Story #3306: Nagios configuration corrections
Fix mk_hazelcast plugin
100%
Description
The check_mk_agent plugin "mk_hazelcast" is not environment aware, causing it to fail or return incorrect results.
The plugin is located in /usr/lib/check_mk_agent/plugins
#!/bin/sh
PATH=${PATH}:/sbin:/usr/lib/nagios/plugins
export PATH
host=hostname -f
hosts='UCSB UNM ORC'
ports='5701 5702 5703'
echo "<<>>"
for port in ${ports}; do
for host in ${hosts}; do
result="check_tcp -H cn-${host}-1.dataone.org -p ${port}
"
if [ "X${result}" = "XConnection refused" ]; then
result="TCP CRIT - ${result}"
fi
echo "${host}/${port} : ${result}"
done
done
History
#1 Updated by Dave Vieglais about 12 years ago
This script is better, but need to add support for -2, -3, ... in the hsotname
#!/bin/sh
PATH=${PATH}:/sbin:/usr/lib/nagios/plugins
export PATH
thishost=hostname -f
hosts='UCSB UNM ORC'
ports='5701 5702 5703'
echo "<<>>"
for port in ${ports}; do
for host in ${hosts}; do
testhost=$(echo $thishost | sed s/-[a-z]*-1/-${host}-1/)
result="check_tcp -H ${testhost} -p ${port}
"
if [ "X${result}" = "XConnection refused" ]; then
result="TCP CRIT - ${result}"
fi
echo "${host}/${port} : ${result}"
done
done
#2 Updated by Dave Vieglais about 12 years ago
- Status changed from New to In Progress
And this version will work with different numbered hosts:
#!/bin/sh
PATH=${PATH}:/sbin:/usr/lib/nagios/plugins
export PATH
thishost=hostname -f
hosts='UCSB UNM ORC'
ports='5701 5702 5703'
echo "<<>>"
for port in ${ports}; do
for host in ${hosts}; do
testhost=$(echo $thishost | sed s/-[a-z]*-([0-9])/-${host}-\1/)
result="check_tcp -H ${testhost} -p ${port}
"
if [ "X${result}" = "XConnection refused" ]; then
result="TCP CRIT - ${result}"
fi
echo "${host}/${port} : ${result}"
done
done
#3 Updated by Dave Vieglais about 12 years ago
- Status changed from In Progress to Closed
- translation missing: en.field_remaining_hours set to 0.0
Change committed to trunk with rev:10355
Modified the sed command a bit:
testhost=$(echo $thishost | sed s/-[a-z]*-1/-${host}-1/)
will look into further generalization under #3333
#4 Updated by Dave Vieglais about 12 years ago
- Status changed from Closed to Testing
- Estimated time set to 0.00
#5 Updated by Chris Jones almost 12 years ago
- Target version changed from Sprint-2012.41-Block.6.1 to Sprint-2012.50-Block.6.4
#6 Updated by Dave Vieglais almost 12 years ago
- Status changed from Testing to In Review
#7 Updated by Chris Jones over 11 years ago
- Target version changed from Sprint-2012.50-Block.6.4 to 2013.10-Block.2.1
#8 Updated by Dave Vieglais over 11 years ago
- Target version changed from 2013.10-Block.2.1 to 2013.35-Block.5.1
#9 Updated by Dave Vieglais almost 11 years ago
- Status changed from In Review to Closed