Hey guys,
I have a situation, where I have a process check for a server, and the status is "Critical" for one of the process but not showing up under "status information" column. I have to click on the process to see which one of the processes is critical
Status Information
Status Information
You do not have the required permissions to view the files attached to this post.
Re: Status Information
What plugin are you using? It looks like you have three lines of output, and it's only showing the first one. This is intended behavior to keep the status screen from looking too messy.
Former Nagios Employee.
me.
me.
Re: Status Information
Hey Smith,
here is the plugin that i got
here is the plugin that i got
Code: Select all
#!/bin/bash
#Script to check the ownwer of processes
exit_var=0
cat /usr/local/nagios/libexec/std_processes.cfg | ( while read line
do
process=`echo ${line} | sed 's/^.\|[a-z][A-Z] /\[&]/g'`
tmp_process=`ps aux | grep ${process} | grep -v root | grep -v $0`
ps_user=`echo ${tmp_process} | awk '{print $1}'`
ps_stat=`echo ${tmp_process} | awk '{print $11}'`
if [[ ! -z $tmp_process ]]
then
case $ps_user in
"fsgapp")
output_string="OK - $ps_user is the owner for ${line}"
echo $output_string
exitvar=0
;;
*)
output_string="CRITICAL - $ps_user is the owner for ${line}"
echo $output_string
exitvar=2
;;
esac
elif [ -z $tmp_process ]
then
output_string="CRITICAL - $line Process is not running"
echo $output_string
exitvar=2
fi
exit_var=$(( $exit_var + $exitvar ))
done
if [[ $exit_var -gt 0 ]]; then
new_exitvar=2
else
new_exitvar=0
fi
exit $new_exitvar
)Re: Status Information
Ah, there may be an issue with the bash script then.
Should the bash script be returning all 3 results, or are you looking for it to only return one of those results?
Should the bash script be returning all 3 results, or are you looking for it to only return one of those results?
Former Nagios Employee
Re: Status Information
hey Kennedy,
Yea i want all 3 result to show up in the "status information"
Yea i want all 3 result to show up in the "status information"
Re: Status Information
Ok - a bit different as this usually isn't how a plugin is setup, but here's what needs to be done.
- Each plugin can only exit once, so you will need to decide how this script will exit properly (as right now, there is 1 OK and 2 CRIT )
- From there, instead of echo $output_string, I would assign each $output_string to a new $var. Then, at the end of your script, echo the results before the scripts exits with echo $var1 $var2 $var3. This will have all of the results on one line, rather then 3.
- Each plugin can only exit once, so you will need to decide how this script will exit properly (as right now, there is 1 OK and 2 CRIT )
- From there, instead of echo $output_string, I would assign each $output_string to a new $var. Then, at the end of your script, echo the results before the scripts exits with echo $var1 $var2 $var3. This will have all of the results on one line, rather then 3.
Former Nagios Employee