Page 1 of 4

Return code of 13 is out of bounds

Posted: Wed May 18, 2016 2:51 pm
by Giperboloid
What should I do in order to fix that? I've tried almost every solution from the Internet.
Image

command.cfg

Code: Select all

#check_proc_cpu
define command{
    command_name    check_proc_cpu
    command_line    $USER1$/check_proc_cpu -H $HOSTADDRESS$ $ARG1$
    }

# 'check_cpu' command definition
# w = Warning level (if CPU % idle falls below this level - must be a percentage)
# c = Critical level
define command{
command_name check_cpu
command_line $USER1$/check_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
}

# 'check_swap' command definition
# w = Warning level (if % or MB swap free drops below this level)
# c = Critical level
define command{
command_name check_swap_cpu
command_line $USER1$/check_swap_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
}

# 'check_ram' command definition
# w = Warning level defined as percentage (with % sign) or in megabytes (without % sign)
# c = Critical level (can be defined as percentage or MB independently of warning)
# o = below|above --> if mem [free drops BELOW] or [used rises ABOVE] thresholds
define command{
command_name check_ram_cpu
command_line $USER1$/check_ram_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$ -o $ARG3$
}

# 'check_load' command definition
# w = Warning levels (alert if n,n,n (1,5,15 minute load averages) go above these levels)
# c = Critical levels
define command{
command_name check_load_cpu
command_line $USER1$/check_load_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
} 
clients.cfg

Code: Select all

define service {
    use            generic-service
    host_name        node_1
    service_description    SSH
    check_command        check_ssh
    #notifications_enabled    0
}
define service {
    use            generic-service
    host_name        node_1
    service_description    Current_cpu_usage
    check_command        check_proc_cpu
    #notifications_enabled    0
}

define service {
    use            generic-service
    host_name        node_1
    service_description    Processor_usage
    check_command        check_cpu
}

define service {
    use            generic-service
    host_name        node_1
    service_description    Processor_swap
    check_command        check_swap_cpu
}

define service {
    use            generic-service
    host_name        node_1
    service_description    RAM
    check_command        check_ram_cpu
}

define service {
    use            generic-service
    host_name        node_1
    service_description    Processor_load
    check_command        check_load_cpu
}

Re: Return code of 13 is out of bounds

Posted: Wed May 18, 2016 3:09 pm
by hsmith
What happens when you run this check from the terminal?

Re: Return code of 13 is out of bounds

Posted: Wed May 18, 2016 4:01 pm
by Giperboloid
hsmith wrote:What happens when you run this check from the terminal?
What do you mean?

Re: Return code of 13 is out of bounds

Posted: Wed May 18, 2016 4:36 pm
by hsmith
If you try to run this from the bash terminal of your Nagios server, what happens?

Code: Select all

/usr/local/nagios/libexec/check_proc_cpu -H yourhostname.com

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 4:57 am
by Giperboloid
hsmith wrote:If you try to run this from the bash terminal of your Nagios server, what happens?

Code: Select all

/usr/local/nagios/libexec/check_proc_cpu -H yourhostname.com
Image

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 5:03 am
by rhassing
I cannot see the last image you posted.

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 6:16 am
by Giperboloid
rhassing wrote:I cannot see the last image you posted.
And now?

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 9:44 am
by rkennedy
It doesn't look like you are passing the right arguments over the command line. Also, what are the permissions of the file?

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 10:29 am
by Giperboloid
rkennedy wrote:It doesn't look like you are passing the right arguments over the command line. Also, what are the permissions of the file?
As you can see I execute that command as a root so file permissions doesn't matter here. But yes, key -H is invalid for some reason.

Re: Return code of 13 is out of bounds

Posted: Thu May 19, 2016 11:32 am
by rhassing
It's a localhost check. So you don't have to tell it which host to check. It only works for the host where the check is executed.