show "Return code of 255 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.
Locked
maronggang
Posts: 14
Joined: Tue May 19, 2015 6:10 am

show "Return code of 255 is out of bounds"

Post by maronggang »

Ask for help! My email is maronggang@163.com.
I want to know why the field "Status information" showes "Return code of 255 is out of bounds" and the field "Status" showes "OK".
I check the nagios status file "status.dat" as follow:
servicestatus {
host_name=oracle_session_check
service_description=VOUCHER_1.114_db_session
modified_attributes=0
check_command=check_db_session!VOUCHER_1.114!vcquery!123456
check_period=24x7
notification_period=24x7
check_interval=1800.000000
retry_interval=10.000000
event_handler=
has_been_checked=1
should_be_scheduled=1
check_execution_time=0.057
check_latency=0.000
check_type=0
current_state=255 last_hard_state=255
last_event_id=0
current_event_id=8
current_problem_id=896
last_problem_id=0
current_attempt=3
max_attempts=3
state_type=1
last_state_change=1432085539
last_hard_state_change=1432085559
last_time_ok=1432085539
last_time_warning=0
last_time_unknown=0
last_time_critical=0
plugin_output=(Return code of 255 is out of bounds) long_plugin_output=
performance_data=
last_check=1432107159
next_check=1432108959
check_options=0
current_notification_number=0
current_notification_id=0
last_notification=0
next_notification=0
no_more_notifications=0
notifications_enabled=1
active_checks_enabled=1
passive_checks_enabled=1
event_handler_enabled=1
problem_has_been_acknowledged=0
acknowledgement_type=0
flap_detection_enabled=1
process_performance_data=1
obsess=1
last_update=1432108253
is_flapping=0
percent_state_change=4.67
scheduled_downtime_depth=0
}

Hope offer me your help! Thank U!
Attachments
oracle_session_check.jpg
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: show "Return code of 255 is out of bounds"

Post by jolson »

Interesting. It looks like you're using some sort of Oracle plugin? If so, which one?

Are you using check_nrpe or similar to help process these checks?

Finally, if you run the checks manually from the command line, do you get the same results? (OK Return code of 255 is out of bounds)
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
maronggang
Posts: 14
Joined: Tue May 19, 2015 6:10 am

Re: show "Return code of 255 is out of bounds"

Post by maronggang »

To jolson:

My detail info of the .cfg files as follow:

my service cfg:
define host{
use check_remote
host_name oracle_session_check
alias oracle session check
address 127.0.0.1
contact_groups admins
}

define service{
use generic-service
host_name oracle_session_check
check_interval 1800
retry_interval 10
contact_groups admins
service_description VOUCHER_1.114_db_session
check_command check_db_session!VOUCHER_1.114!vcquery!123456
}

command.cfg:
#check_db_session

define command{
command_name check_db_session
command_line check_db_session
command_line $USER1$/check_db_session.pl $ARG1$ $ARG2$ $ARG3$
}


resource.cfg:
$USER1$=/home/nagios/monitor/nagios/libexec

This is the output that I run the script mannually from the command line:
[nagios@a1a162 ~]$ /home/nagios/monitor/nagios/libexec/check_db_session.pl VOUCHER_1.114 vcquery 123456
****: HOST->a1a75.rh6.sh OS_USER->culws DB_USER->VOUCHER PRO->JDBCThinClient Normal[1] != 2
****: HOST->a1a151.rh6.sh OS_USER->culws DB_USER->VOUCHER PRO->JDBCThinClient Normal[1] != 2
****: HOST->voucher-appweb OS_USER->voucher DB_USER->VOUCHER PRO->JDBCThinClient Normal[5] != 6
VOUCHER_1.114 OK!
------Check End.
[nagios@a1a162 ~]$ echo $?
0
[nagios@a1a162 ~]$ id
uid=500(nagios) gid=500(nagios) groups=500(nagios)
[nagios@a1a162 ~]$
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: show "Return code of 255 is out of bounds"

Post by tgriep »

Could you upload the check_db_session.pl script to this post so we can review it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
maronggang
Posts: 14
Joined: Tue May 19, 2015 6:10 am

Re: show "Return code of 255 is out of bounds"

Post by maronggang »

Hi, tgriep

Pls see the atachment.
Attachments
check_db_session.pl
(3.19 KiB) Downloaded 245 times
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: show "Return code of 255 is out of bounds"

Post by ssax »

Everything looks proper, my assumption is that these are not being set:

ORACLE_HOME
LD_LIBRARY_PATH

Check what they should be with the command below:

Code: Select all

env
Try adding them to the top of the perl script script under the use statements:

Code: Select all

$ENV{'ORACLE_HOME'} = '/your/path';
$ENV{'LD_LIBRARY_PATH'} = 'your/path2';
maronggang
Posts: 14
Joined: Tue May 19, 2015 6:10 am

Re: show "Return code of 255 is out of bounds"

Post by maronggang »

Thanks. Indeed, the "env" causes.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: show "Return code of 255 is out of bounds"

Post by tgriep »

I just want to verify that if the issue resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
maronggang
Posts: 14
Joined: Tue May 19, 2015 6:10 am

Re: show "Return code of 255 is out of bounds"

Post by maronggang »

To tgriep:
Yes, my issue has been resolved.
Thanks!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: show "Return code of 255 is out of bounds"

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked