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

Magnus Glantz magnus at hacka.net
Wed Apr 16 06:10:04 CEST 2003


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nagios-plugins.org/archive/devel/attachments/20030416/e3dc8ab0/attachment.html>


More information about the Devel mailing list