Page 2 of 2

Re: Simple wrapper plugin gets "return code of 127" error

Posted: Wed Nov 05, 2014 11:26 am
by Bryan Quesada
Check the permissions of the script you have time:

1- chmod + x scriptname.sh

Also within the main script calling the check_http plugin is done, this should be the absolute path>

2 - /usr/local/nagios/libexec/check_http

----------------------------------
Example

#! / bin / bash
hostname = www.hardcoded.hostname.com
uri = / path.to.file.html? parameter1 = value1 \ parameter2 = value2 & \ & parameter3 = value3
warn = 10
crit = 30

while getopts "w: c:" opt; do
    case $ opt in
       w)
          warn = $ OPTARG
          ;;
       c)
          crit = $ OPTARG
    esac
donate

/usr/local/nagios/libexec/check_http -H $ uri $ hostname -u -r "\! (This account has-been locked out)" -w -c $ warn $ crit

Re: Simple wrapper plugin gets "return code of 127" error

Posted: Wed Nov 05, 2014 4:26 pm
by sreinhardt
I believe we covered it being executable, but pathing is a very good point. Especially considering nagios daemon and plugins are generally not started from the libexec directory.