[Nagiosplug-devel] check_real (nagios-plugins 1.3.0) 1.4

Subhendu Ghosh sghosh at sghosh.org
Wed Apr 16 16:36:36 CEST 2003


Lets keep this on one list.
Matthias reported the same problem a couple of minutes earlier.

The only change in check_real was some option handling cleanup bteween 
beta2 and release.

The only relevant change seems to be in line 65-66 - initalization changed 
from NULL to "" and "/" for hostname and url respectively.

So it looks like we are sending a default url "/" 
This causes the second part of the check - stream exists - to be invoked.
Previously, "stream exists" would only be checked if the -u option was 
provided.


Please post a SF bug report - I'll get a patch in for the old behavior.

-sg


On Wed, 16 Apr 2003, Magnus Glantz wrote:

> Hiyas, didnt know where to send this exatly to.. 
> I sending it in hope that it might be of help to someone.
> 
> I noticed that after upgrading from check_real (nagios-plugins 1.3.0-beta2) 1.2
> to check_real (nagios-plugins 1.3.0) 1.4, all my "regular" Real tests:
> 
> ./check_real -H hostname
> 
> Started to get: "RTSP/1.0 404 Not Found"
> 
> When not looking for anything, this is an strange error message..
> 
> I noticed in the source for check_real that the server_url pointer had been changed to
> char *server_url = "/"; to prevent software failure. Now.. with this as 'default url' the plugin will look for "/" in the server.
> That was what was causing the error messages. The streaming servers I check demand that you give a valid URL and "/" is not one. 
> 
> I don't know if this is actually a good solution, it's a quick dirty hack that worked out good for me.
> Even though I never have experienced any problems..
> beware.. the author writes about his change: 
> 
> ----------snip-----------
> 2003-01-28  kdebisschop at alert.infoplease.com  <kdebisschop>
> 
>         * plugins/check_real.c:
>         make sure host_name is set and remove NULL string inits that can lead to segfaults
> ----------snip-----------
> 
> The system that I compiled on is Linux Redhat 7.2 (i386) with 2.4.18-27.7.x Kernel.
> I can't see any reason why this shouldnt work on most systems though.
> 
> What to do;
> Change below syntax in check_real.c: 
> 
> --------------original source snip----------------
> int server_port = PORT;
> char *server_address = "";
> char *host_name = "";
> 
> char *server_url = "/";
> 
> char *server_expect = EXPECT;
> int warning_time = 0;
> int check_warning_time = FALSE;
> int critical_time = 0;
> int check_critical_time = FALSE;
> int verbose = FALSE;
> --------------snip----------------
> TO
> 
> --------------original source snip----------------
> int server_port = PORT;
> char *server_address = "";
> char *host_name = "";
> 
> char *server_url = NULL;
> 
> char *server_expect = EXPECT;
> int warning_time = 0;
> int check_warning_time = FALSE;
> int critical_time = 0;
> int check_critical_time = FALSE;
> int verbose = FALSE;
> --------------snip----------------
> 
> 
> AND
> 
> --------------original source snip----------------
>         /* Part II - Check stream exists and is ok */
>         if (result == STATE_OK) {
> ---------------------snip-------------------------------
> 
> TO
> 
>  /* Part II - Check stream exists and is ok */
>         if ((result == STATE_OK) && (server_url != NULL)) {
> 
> 
> And recompile.
> 
> Cheers,
> //Magnus Glantz
> 
> 

-- 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list