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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Return code of 13 is out of bounds

Post by tgriep »

That check is written to only run on the local host. If you want to run that check on a remote server, you would either have to install the NRPE agent on the remote system and use the check_nrpe command on the Nagios system to run the commands on the remote system.
Take a look at this PDF document that describes NRPE and how to install / configure it.

Code: Select all

http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
maksibonus
Posts: 7
Joined: Wed May 18, 2016 3:03 pm

Re: Return code of 13 is out of bounds

Post by maksibonus »

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?
I change permissions. But I have new problem
Image
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post by Giperboloid »

It turned out that the problem was in the access mode. I changed it but now another trouble has appeared: Missing Host or Password arguments. I found some solutions (like http://serverfault.com/questions/323229 ... -arguments) but I can't find out what changes must be done.
Image
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Return code of 13 is out of bounds

Post by rkennedy »

Can you post your /usr/local/nagios/var/objects.cache file for us to look at? I suspect something isn't configured properly.
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:Can you post your /usr/local/nagios/var/objects.cache file for us to look at? I suspect something isn't configured properly.
objects.cache

Code: Select all

########################################
#       NAGIOS OBJECT CACHE FILE
#
# THIS FILE IS AUTOMATICALLY GENERATED
# BY NAGIOS.  DO NOT MODIFY THIS FILE!
#
# Created: Fri May 20 09:45:37 2016
########################################

define timeperiod {
	timeperiod_name	24x7
	alias	24 Hours A Day, 7 Days A Week
	sunday	00:00-24:00
	monday	00:00-24:00
	tuesday	00:00-24:00
	wednesday	00:00-24:00
	thursday	00:00-24:00
	friday	00:00-24:00
	saturday	00:00-24:00
	}

define timeperiod {
	timeperiod_name	24x7_sans_holidays
	alias	24x7 Sans Holidays
	december 25	00:00-00:00
	july 4	00:00-00:00
	january 1	00:00-00:00
	thursday 4 november	00:00-00:00
	monday 1 september	00:00-00:00
	monday -1 may	00:00-00:00
	sunday	00:00-24:00
	monday	00:00-24:00
	tuesday	00:00-24:00
	wednesday	00:00-24:00
	thursday	00:00-24:00
	friday	00:00-24:00
	saturday	00:00-24:00
	}

define timeperiod {
	timeperiod_name	none
	alias	No Time Is A Good Time
	}

define timeperiod {
	timeperiod_name	us-holidays
	alias	U.S. Holidays
	january 1	00:00-00:00
	july 4	00:00-00:00
	december 25	00:00-00:00
	monday -1 may	00:00-00:00
	monday 1 september	00:00-00:00
	thursday 4 november	00:00-00:00
	}

define timeperiod {
	timeperiod_name	workhours
	alias	Normal Work Hours
	monday	09:00-17:00
	tuesday	09:00-17:00
	wednesday	09:00-17:00
	thursday	09:00-17:00
	friday	09:00-17:00
	}

define command {
	command_name	check-host-alive
	command_line	$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
	}

define command {
	command_name	check_cpu
	command_line	$USER1$/check_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
	}

define command {
	command_name	check_dhcp
	command_line	$USER1$/check_dhcp $ARG1$
	}

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

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

define command {
	command_name	check_http
	command_line	$USER1$/check_http -I $HOSTADDRESS$ $ARG1$
	}

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

define command {
	command_name	check_load_cpu
	command_line	$USER1$/check_load_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
	}

define command {
	command_name	check_local_disk
	command_line	$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
	}

define command {
	command_name	check_local_load
	command_line	$USER1$/check_load -w $ARG1$ -c $ARG2$
	}

define command {
	command_name	check_local_mrtgtraf
	command_line	$USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
	}

define command {
	command_name	check_local_procs
	command_line	$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
	}

define command {
	command_name	check_local_swap
	command_line	$USER1$/check_swap -w $ARG1$ -c $ARG2$
	}

define command {
	command_name	check_local_users
	command_line	$USER1$/check_users -w $ARG1$ -c $ARG2$
	}

define command {
	command_name	check_nt
	command_line	$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
	}

define command {
	command_name	check_ping
	command_line	$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
	}

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

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

define command {
	command_name	check_ram_cpu
	command_line	$USER1$/check_ram_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$ -o $ARG3$
	}

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

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

define command {
	command_name	check_ssh
	command_line	$USER1$/check_ssh $ARG1$ $HOSTADDRESS$
	}

define command {
	command_name	check_swap_cpu
	command_line	$USER1$/check_swap_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
	}

define command {
	command_name	check_tcp
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
	}

define command {
	command_name	check_udp
	command_line	$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
	}

define command {
	command_name	notify-host-by-email
	command_line	/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/sendmail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
	}

define command {
	command_name	notify-service-by-email
	command_line	/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/sendmail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
	}

define command {
	command_name	process-host-perfdata
	command_line	/usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
	}

define command {
	command_name	process-service-perfdata
	command_line	/usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
	}

define contactgroup {
	contactgroup_name	admins
	alias	Nagios Administrators
	members	nagiosadmin
	}

define hostgroup {
	hostgroup_name	linux-servers
	alias	Linux Servers
	members	localhost
	}

define contact {
	contact_name	nagiosadmin
	alias	Nagios Admin
	service_notification_period	24x7
	host_notification_period	24x7
	service_notification_options	r,w,u,c,f,s
	host_notification_options	r,d,u,f,s
	service_notification_commands	notify-service-by-email
	host_notification_commands	notify-host-by-email
	email	maksibonus@gmail.com
	minimum_importance	0
	host_notifications_enabled	1
	service_notifications_enabled	1
	can_submit_commands	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define host {
	host_name	localhost
	alias	localhost
	address	127.0.0.1
	check_period	24x7
	check_command	check-host-alive
	contact_groups	admins
	notification_period	workhours
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	10
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,d,u
	notifications_enabled	1
	notification_interval	120.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define host {
	host_name	node_1
	alias	server
	address	192.168.1.2
	check_period	24x7
	check_command	check-host-alive
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	5
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,d,u
	notifications_enabled	1
	notification_interval	30.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define host {
	host_name	node_2
	alias	server
	address	192.168.1.3
	check_period	24x7
	check_command	check-host-alive
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	5
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,d,u
	notifications_enabled	1
	notification_interval	30.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	Current Load
	check_period	24x7
	check_command	check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	Current Users
	check_period	24x7
	check_command	check_local_users!20!50
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	HTTP
	check_period	24x7
	check_command	check_http
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	0
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	PING
	check_period	24x7
	check_command	check_ping!100.0,20%!500.0,60%
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	Root Partition
	check_period	24x7
	check_command	check_local_disk!20%!10%!/
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	SSH
	check_period	24x7
	check_command	check_ssh
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	0
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	Swap Usage
	check_period	24x7
	check_command	check_local_swap!20!10
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	localhost
	service_description	Total Processes
	check_period	24x7
	check_command	check_local_procs!250!400!RSZDT
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	4
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	Current_cpu_usage
	check_period	24x7
	check_command	check_proc_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	Processor_load
	check_period	24x7
	check_command	check_load_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	Processor_swap
	check_period	24x7
	check_command	check_swap_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	Processor_usage
	check_period	24x7
	check_command	check_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	RAM
	check_period	24x7
	check_command	check_ram_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_1
	service_description	SSH
	check_period	24x7
	check_command	check_ssh
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_2
	service_description	Processor usage
	check_period	24x7
	check_command	check_proc_cpu
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	0
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

define service {
	host_name	node_2
	service_description	SSH
	check_period	24x7
	check_command	check_ssh
	contact_groups	admins
	notification_period	24x7
	initial_state	o
	importance	0
	check_interval	10.000000
	retry_interval	2.000000
	max_check_attempts	3
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	0
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	}

bwallace
Posts: 1146
Joined: Tue Nov 17, 2015 1:57 pm

Re: Return code of 13 is out of bounds

Post by bwallace »

Thanks for those details but I'm afraid I'm gonna have to request some more data. We'll need to see the full check_commands (as they are applied to node_1) for the following:

check_command check_load_cpu
check_command check_swap_cpu
check_command check_cpu

These checks correspond to the service descriptions seen in your screenshot (Processor_load, Processor_swap, Processor_usage)
Be sure to check out the Knowledgebase for helpful articles and solutions!
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post by Giperboloid »

bwallace wrote:Thanks for those details but I'm afraid I'm gonna have to request some more data. We'll need to see the full check_commands (as they are applied to node_1) for the following:

check_command check_load_cpu
check_command check_swap_cpu
check_command check_cpu

These checks correspond to the service descriptions seen in your screenshot (Processor_load, Processor_swap, Processor_usage)

Code: Select all

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$
}
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Return code of 13 is out of bounds

Post by Box293 »

You service definitions do not contain enough arugments.

For example:

Code: Select all

define service {
       host_name   node_1
       service_description   Processor_load
       check_period   24x7
       check_command   check_load_cpu
check_load_cpu is defined as:

Code: Select all

    define command {
       command_name   check_load_cpu
       command_line   $USER1$/check_load_cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $USER3$
       }
In your service, you have not provided the $ARG1$ and $ARG2$ values. These are separated by ! marks, for example:

Code: Select all

define service {
       host_name   node_1
       service_description   Processor_load
       check_period   24x7
       check_command   check_load_cpu!5!10
Also, does your resources.cfg file have an entry for $USER3$ ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Giperboloid
Posts: 21
Joined: Sat May 14, 2016 5:47 am

Re: Return code of 13 is out of bounds

Post by Giperboloid »

I've changed files on the monitoring server (2 files).

clients.cfg

Code: Select all

define host{
	use                             linux-server
	host_name                       node_1
	alias                           server
	address                         192.168.1.2
	max_check_attempts              5
	check_period                    24x7
	notification_interval           30
	notification_period             24x7
}

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!50
	#notifications_enabled	0
}

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

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

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

define service {
	use			generic-service
	host_name		node_1
	service_description	Processor_load
	check_command		check_load_cpu!70!90
}
resource.cfg

Code: Select all

###########################################################################
#
# RESOURCE.CFG - Sample Resource File for Nagios 4.0.4
#
#
# You can define $USERx$ macros in this file, which can in turn be used
# in command definitions in your host config file(s).  $USERx$ macros are
# useful for storing sensitive information such as usernames, passwords, 
# etc.  They are also handy for specifying the path to plugins and 
# event handlers - if you decide to move the plugins or event handlers to
# a different directory in the future, you can just update one or two
# $USERx$ macros, instead of modifying a lot of command definitions.
#
# The CGIs will not attempt to read the contents of resource files, so
# you can set restrictive permissions (600 or 660) on them.
#
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
#
# Resource files may also be used to store configuration directives for
# external data sources like MySQL...
#
###########################################################################

# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec

# Sets $USER2$ to be the path to event handlers
#$USER2$=/usr/local/nagios/libexec/eventhandlers

# Store some usernames and passwords (hidden from the CGIs)
$USER3$=someuser
#$USER4$=somepassword
The error as a result has also changed:
Image
I have an assumption that the problem is that I must install on the remote node all the plugins (check_swap_cpu,check_ram_cpu...) that have been installed on the monitoring server. If it's true how should I do that? Where I must locate that files?
Here is nrpe.cfg on the remote node:
Image
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Return code of 13 is out of bounds

Post by tgriep »

On your remote server, can you run the following and post the output?
ls -l /usr/lib64/nagios/plugins

The plugins may already be installed on your remote server, as the above command will verify that.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked