Transaction Timeout Anomalies for SSH Access

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Transaction Timeout Anomalies for SSH Access

Post by mbellerue »

That is really strange. Is it printing the <br /> tags? I would think if it's not even printing them, it should be parsing them at least.

You could try putting the tags at the beginning of each return line. Other than that, I don't know why it's not giving you proper new lines. If your next test fails, can you post another screenshot? Or is the output still the same as the last one?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
louissiong
Posts: 32
Joined: Wed Nov 20, 2019 1:07 am

Re: Transaction Timeout Anomalies for SSH Access

Post by louissiong »

Yes, it is but not showing the service status line by line.
Anything that I could have missed out ? Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Transaction Timeout Anomalies for SSH Access

Post by mbellerue »

Oh I'm sorry, I think I may be misunderstanding something here. In that screen shot, the middle line, do you want it to look like this,

Code: Select all

QMPGCT01 ABT: The Following Channels Are Running:
ABT.SVRCONN
Like that?

I think this is going to require that we go into the check_mq_channel.sh script to add the new lines. Can you post that script?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
louissiong
Posts: 32
Joined: Wed Nov 20, 2019 1:07 am

Re: Transaction Timeout Anomalies for SSH Access

Post by louissiong »

it is supposed to show the service status followed by the channel name line after line.
Let me know. Thanks.

#!/usr/bin/sh

retresult=3

#qmiib01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMIIB01 ABT*)
#qmpgct01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMPGCT01 ABT*)
#qmpgs01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMPGS01 ABT*)

cd /usr/local/nagios/check/
if [[ ! -f check_mq_channel.sh ]]; then
retresult=2
else
qmiib01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMIIB01 ABT*)
checkmq1=$?
qmpgct01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMPGCT01 ABT*)
checkmq2=$?
qmpgs01abt=$(/usr/local/nagios/check/check_mq_channel.sh QMPGS01 ABT*)
checkmq3=$?

if [ $(($checkmq1 + $checkmq2 + $checkmq3)) -gt 0 ]; then
retresult=2
else
retresult=0
fi
#echo "QMIIB01 ABT: ${qmiib01abt}\n"
#echo "QMPGCT01 ABT: ${qmpgct01abt}\n"
#echo "QMPGS01 ABT: ${qmpgs01abt}"
echo "<br \>QMIIB01 ABT: ${qmiib01abt}>"
echo "<br \>QMPGCT01 ABT: ${qmpgct01abt}<br \>"
echo "QMPGS01 ABT: ${qmpgs01abt}"
fi
# echo " | QMPGCT01 ABT: ${qmpgct01abt}\n"
# echo " | QMPGS01 ABT: ${qmpgs01abt}"
exit $retresult
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Transaction Timeout Anomalies for SSH Access

Post by benjaminsmith »

Hi Louis,

Michael was not able to make it today, but he should be back tomorrow and will be able to provide more feedback on your script.

Thanks for your patience.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
louissiong
Posts: 32
Joined: Wed Nov 20, 2019 1:07 am

Re: Transaction Timeout Anomalies for SSH Access

Post by louissiong »

Hi Michael, any update on the case ? Thanks.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Transaction Timeout Anomalies for SSH Access

Post by mbellerue »

Okay, yes, I think we will have to take a look at the check_mq_channel.sh script. Can you attach that script here? I'll take a look and see what the output is, and what we can do to make it output the way you want it.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
louissiong
Posts: 32
Joined: Wed Nov 20, 2019 1:07 am

Re: Transaction Timeout Anomalies for SSH Access

Post by louissiong »

Sure, thanks. Here u go.
Is there any Nagios XI built in functions to use ?

#!/usr/bin/sh

RUNMQSC="/usr/bin/runmqsc"

# NAGIOS EXIT STATES
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3

USAGE="Usage `basename $0` <QMANAGER> <CHANNEL>."
NOTE="check channel status if running."

# Print usage
if [[ $# -ne 2 ]]; then
echo -e "Use: $USAGE\n\n"
echo -e "Note: $NOTE\n\n"
exit $STATE_UNKNOWN
else
QMANAGER=$1
CHANNEL=$2
fi

NOT_RUNNING_CHANNELS=`echo "dis chstatus(${CHANNEL}) where(STATUS NE RUNNING)" | runmqsc ${QMANAGER} | grep -e 'CHANNEL\((.*)\)' | sed s/CHANNEL\(/=/g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}'`


for CHAN in $NOT_RUNNING_CHANNELS
do
MESSAGE="${MESSAGE} : ${CHAN}"
done


if [ -n "$MESSAGE" ]; then
echo "Following Channels are not running ${MESSAGE}"
exit $STATE_CRITICAL
else
echo "Channels are running"
exit $STATE_OK
fi
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Transaction Timeout Anomalies for SSH Access

Post by mbellerue »

I'm hoping that we don't need to add the new line to the NOT_RUNNING_CHANNELS variable. That doesn't look like fun. Let's try this one first.

Code: Select all

for CHAN in $NOT_RUNNING_CHANNELS
do
    MESSAGE="${MESSAGE} : ${CHAN}\n"
done
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
louissiong
Posts: 32
Joined: Wed Nov 20, 2019 1:07 am

Re: Transaction Timeout Anomalies for SSH Access

Post by louissiong »

Ok. Tested still not working.
Does the service status variable need to be added first ?
You do not have the required permissions to view the files attached to this post.
Locked