LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-29-2016, 11:08 PM   #1
vadoodc
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Rep: Reputation: Disabled
Nagios | Return code of 255 is out of bounds


I am using Nagios for our monitoring system. Recently added plugin check_url.pl to check site availability with http response codes. Plugin is working fine but it frequently reporting an invalid response code of 255. Below is the exact message displayed on dashboard and it is disappearing automatically. It looks like some attempt is failing or getting invalid response code.

SERVICE ALERT: MAINSite ;Main site URL Check;CRITICAL;SOFT;1;(Return code of 255 is out of bounds


Here is my configuration details.

Defined command like below.

define command{
command_name url_check
command_line $USER1$/check_url.pl $ARG1$
}

Here is host configuration


define host{
use linux-server ; Inherit default values from a template
host_name MAINSite ; The name we're giving to this host
alias MAINSite ; A longer name associated with the host
address abcblabla.com ; IP address of the host
check_command check_tcp!80
}

define service{
use frequent-service
host_name MAINSite
service_description Main site URL Check
check_command url_check!abcblabla.com
}


Kindly share your thoughts/experience over this.

Attached screen shot for one event.

Thanks,
Abdul
Attached Thumbnails
Click image for larger version

Name:	Nagios.PNG
Views:	138
Size:	8.4 KB
ID:	21309  

Last edited by vadoodc; 03-29-2016 at 11:48 PM. Reason: Attachment
 
Old 03-30-2016, 02:09 AM   #2
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
Looking at the code of the check_url.pl script, my best guess would be that you are occasionally getting a timeout (see line 23).

This is the perl script I assumed you're using.
https://exchange.nagios.org/director...ck_url/details

I'm not so impressed with that script, as you can't pass many things in as arguments. Ie - timeout, or whether it should be using --no-check-certificates for wget which its doing by default ...

I haven't used nagios in a coupld years, but I would probably use the built in check_url which would be much more widely used, and more likely more robust.
 
Old 03-30-2016, 02:27 AM   #3
vadoodc
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Dear fmattheus,

Thank you for the update.

Plugin is working as expected, but for some checks it is reporting invalid response code and I confirmed that those alerts are false positive.

Anybody here faced this issue? it looks like a common issue while searching in Google. but no one mentioned the fix for same.

Thanks,
Abdul

Last edited by vadoodc; 03-30-2016 at 10:11 PM.
 
Old 04-03-2016, 12:37 AM   #4
vadoodc
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Dear Friends,

Any helping hands here?

Thanks,
Abdul
 
Old 04-03-2016, 02:47 AM   #5
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
As I posted above, looking at the code, it looks like 255 means its running into a timeout.

I would, however, recommend not using that check and using the builtin 'check_url' check instead as it looks more robust, and provides better options like setting the timeout different per check.
 
Old 04-03-2016, 03:28 AM   #6
vadoodc
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
I can not see default commend for check_url with latest version of Nagios. is it still there?
Can you please give me this plugin download page?
 
Old 04-03-2016, 10:18 AM   #7
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
Apperently the main check is now called check_http ... Why look outside the core checks when there is something there already?
 
Old 04-04-2016, 02:28 AM   #8
vadoodc
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
fmattheus,

Thanks! for your help.
Default plugin is working as expected. I changed all configs to use same.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios - Return code of 127 for check of service sriramsreedhar Linux - General 5 11-14-2016 02:32 PM
exit(communication error), terminated by calling exit(), return code: 255 miliboy Linux - Newbie 11 02-27-2013 01:51 PM
[SOLVED] return -1 of main but get exit code is 255? why? pls advise. youxi600 Linux - Newbie 13 06-30-2011 02:14 PM
What is this -> SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=128 ID carves Linux - Networking 5 08-17-2008 09:26 PM
Logs full of hits to 255.255.255.255; how to stop logging? mac_phil Mandriva 2 02-23-2004 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration