Bug 530519 - "Apache: Uptime" probe tries incorrect URL
Summary: "Apache: Uptime" probe tries incorrect URL
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Monitoring
Version: 520
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Petr Sklenar
URL:
Whiteboard: Fixed in the 5.4.0 Release - GA'd 201...
Depends On:
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2009-10-23 09:30 UTC by Jan Hutař
Modified: 2018-10-27 13:43 UTC (History)
4 users (show)

Fixed In Version: perl-NOCpulse-Probe-1.184.3-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-28 15:02:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2009-10-23 09:30:50 UTC
Description of problem:
I have created probe "Apache: Uptime" and it attempts to access "http://10.16.98.211%20%20%20%20:80/server-status" instead of expected "http://10.16.98.211:80/server-status".


Version-Release number of selected component (if applicable):
both 520 and 521


How reproducible:
always


Steps to Reproduce:
1. create probe "Apache: Uptime"
2. push RHN monitoring Scout config
3. Observe the error message in the probe "Status:" field


Actual results:
UNKNOWN, HTTP error found at http://10.16.98.211%20%20%20%20:80/server-status: 500 Can't connect to 10.16.98.211 :80 (connect: timeout)


Expected results:
UNKNOWN, HTTP error found at http://10.16.98.211:80/server-status: 500 Can't connect to 10.16.98.211 :80 (connect: timeout)

(but I also think probe really tries to access that URL, as on my satellite where various other probes works correctly, this is the only one in UNKNOWN status)


Additional info:
https://rlx-1-04.rhndev.redhat.com/rhn/systems/details/probes/ProbeDetails.do?sid=1000010023&probe_id=2

Comment 1 Jan Pazdziora 2009-10-23 10:15:36 UTC
If this problem exists on Satellite 5.3.0 as well, this bugzilla should be aligned to sat531-triage. If it does not exist in 5.3.0, this bugzilla should probably be closed as WONTFIX.

Comment 2 Jan Pazdziora 2009-10-23 10:20:22 UTC
The issue is caused by spaces in the rhnservernetwork table:

SQL> select replace(ipaddr, ' ', '+') from rhnservernetwork where server_id = 1000010023 ;

REPLACE(IPADDR,'
----------------
10.16.98.211++++

SQL> 

I wonder why other probes are not affected.

We should either strip the spaces in monitoring code, or (preferred) strip them in rhnservernetwork and ensure we never have spaces there, via trigger and check or something.

Comment 3 Jan Hutař 2009-10-23 12:14:38 UTC
I have tested on 530 (sputnik-stage.brq.redhat.com) and I see there:

Status:	UNKNOWN, HTTP error found at http://192.168.122.141%20:80/server-status: 500 Can't connect to 192.168.122.141 :80 (connect: timeout)

(tested on a dead system, so that "connect: timeout" is not important IMO)

https://sputnik-stage.brq.redhat.com/rhn/systems/details/probes/ProbeDetails.do?probe_id=167&sid=1000011378

Adding "sat531-triage", removing "sat52maint".

Comment 4 Miroslav Suchý 2010-08-06 14:16:11 UTC
It is only in probes which use ./NP/Probe/DataSource/HTTP.pm

becouse of this usage of URI::URL


use URI::URL;

my $uri = new URI::URL('/foooo');
$uri->scheme('http');
$a='127.0.0.1   ';
$uri->host($a);
$uri->port('80');

print $uri;  

which will print:
http://127.0.0.1%20%20%20:80/foooo

Comment 5 Miroslav Suchý 2010-08-06 14:24:19 UTC
I fixed HTTP.pm so it strips spaces before passing to URI::URL - commit 8026a276261a9f1f91ae131850fef134ce6b9625

And I also change schema to make column ipaddr varchar(16) as char(16) does not have much sense. commit e539f359155bebeae80e8f41edac2f9e0d4bd0e6

Comment 7 Petr Sklenar 2010-09-22 11:57:54 UTC
I added probes with Apache: Processes/Requests/Uptime;
All was using server-status and probes works as expected.

log:
Probe(s) assigned to system have an OK status   	 Apache: Processes   	 Max transferred per child 0.090 MB; Max transferred per slot 0.090 MB  	 System

Probe(s) assigned to system have an OK status 	Apache: Requests 	Traffic 0.217 Kbytes/sec; Request rate 0.050/sec; Current requests 1 	System

Probe(s) assigned to system have an OK status 	Apache: Uptime 	Apache Server uptime: 11 minutes 41 seconds 	System
--
Verified with Satellite-5.4.0-RHEL5-re20100910.2

Comment 8 Clifford Perry 2010-10-28 15:02:43 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


Note You need to log in before you can comment on or make changes to this bug.