Return code of 13 is out of bounds

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Return code of 13 is out of bounds

Post 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
}
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Return code of 13 is out of bounds

Post by hsmith »

What happens when you run this check from the terminal?
Former Nagios Employee.
me.
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post by Giperboloid »

hsmith wrote:What happens when you run this check from the terminal?
What do you mean?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Return code of 13 is out of bounds

Post 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
Former Nagios Employee.
me.
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post 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
Last edited by Giperboloid on Thu May 19, 2016 6:16 am, edited 1 time in total.
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Return code of 13 is out of bounds

Post by rhassing »

I cannot see the last image you posted.
Rob Hassing
Image
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post by Giperboloid »

rhassing wrote:I cannot see the last image you posted.
And now?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Return code of 13 is out of bounds

Post 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?
Former Nagios Employee
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post 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.
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Return code of 13 is out of bounds

Post 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.
Rob Hassing
Image
Locked