Search found 6 matches

by ddk
Tue Aug 20, 2013 9:52 am
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

Re: custom bash script

env HOSTNAME=hostname SHELL=/bin/bash TERM=xterm HISTSIZE=1000 USER=nagios LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01; PAGER=less PATH=/root/bin:/root/sbin:/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin ...
by ddk
Mon Aug 19, 2013 3:55 pm
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

Re: custom bash script

Lets just make sure that it works without the bash error: On teh remote host: su nagios cd /home/nagios/ /usr/lib64/nagios/plugins//check_mysql_query_custom -H 192.168.0.1 -d DB -w 1 -c 2 -u USER -p PASS -t 1 there is no such directory 'nagios' home dir is - /var/spool/nagios so: # su nagios bash-4...
by ddk
Mon Aug 19, 2013 3:09 pm
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

Re: custom bash script

Code: Select all

# su nagios
bash-4.1$ /usr/lib64/nagios/plugins//check_mysql_query_custom -H 192.168.0.1 -d DB -w 1 -c 2 -u USER -p PASS -t 1
/bin/bash: /root/.bashrc: Permission denied
CRITICAL: 2  warn:1; crit:2 ID: 5 Desc:192.168.0.2 Date: 2013-08-19 20:07:17
by ddk
Mon Aug 19, 2013 2:54 pm
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

Re: custom bash script

while in console it returns normal results, like: CRITICAL: 2 Shouldn't it be returning the whole string, not just the $RESULT but also $WARN, $CRIT and $ADDINFO? CRITICAL: $RESULT warn:$WARN; crit:$CRIT $ADDINFO it's copy-paste fail, sorry. it is returninng full string as it's writing in script
by ddk
Mon Aug 19, 2013 10:06 am
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

Re: custom bash script

here it is
by ddk
Mon Aug 19, 2013 8:26 am
Forum: Open Source Nagios Projects
Topic: custom bash script
Replies: 11
Views: 4364

custom bash script

Hi all! I wrote custom bash script for Nagios Core, but in web interface it returns: Current Status: WARNING Status Information: (null) while in console it returns normal results, like: CRITICAL: 2 Exit codes are from manual: if [ $RESULT -ge $WARN ] && [ $RESULT -lt $CRIT ]; then echo "...