public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Matthias Fischer <matthias.fischer@ipfire.org>
To: development@lists.ipfire.org
Cc: dietzmann@brecht-schule.hamburg
Subject: Re: [PATCH 2/2] Redirect Apache status requests
Date: Mon, 22 Jun 2026 16:59:37 +0200	[thread overview]
Message-ID: <b887cfb8-3647-497f-bc1f-e1117838725b@ipfire.org> (raw)
In-Reply-To: <03c95271-dec0-4b62-868c-40c7fb25bbb8@brecht-schule.hamburg>

[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]

On 22.06.2026 16:20, Peer Dietzmann wrote:
> Hello,

Hi,
> there is also another patch required to make the module working. But I 
> just can't find the file in the repository that needs to be changed:

You won't find this file in the repository - that would be too easy. ;-)

This 'apache'-file is stored in the observium archive
(observium/scripts/agent-local/apache). And only there. It is extracted
during the build phase, and is then immediately deleted. This is
controlled via the lfs file:

Line 83 (to be sure: first delete and then unpack source):
...
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
...

Line 103 (clean up):
...
@rm -rf $(DIR_APP)
...

IMHO the best way to apply your changes would be a patchfile (see
attachment) which needs to be copied into the repository in the
directory '/src/patches/observium', e.g.).

Then the lfs file needs something like this in a new line *84*:
...
cd $(DIR_APP) && patch -Np1 <
$(DIR_SRC)/src/patches/observium/[NAME_OF_PATCHFILE]
...
HTH
Matthias

> Line 29 of /usr/lib/observium_agent/scripts-available/apache has to be 
> changed to:
> 
>          close INFILE;
> } else {
>          # grab the status URL (fresh data)
>          @data = split /(\n)/, LWP::Simple::get( 
> 'http://localhost:81/server-status?auto' )
>                  or die "Data fetch failure.\n";
> 
>          # write file
> 
> The *localhost* has to be changed to *localhost:81*
> 
> The concerned bug that should be fixed through those three patches is: 
> https://bugzilla.ipfire.org/show_bug.cgi?id=14017
> 
> Best,
> 
> Peer
> 
> On 22/06/2026 16:15, Peer Dietzmann wrote:
>> Redirect requests to Apache's status to it's backend, force local requests.
>> This is required to allow Observium's agent to pull metrics from Apache.
>>
>> Best,
>> Peer
>>
>> Signed-off-by: Peer Dietzmann <dietzmann@brecht-schule.hamburg>
>> ---
>>   config/httpd/httpd.conf | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/config/httpd/httpd.conf b/config/httpd/httpd.conf
>> index c694bffe2..09b10b50f 100644
>> --- a/config/httpd/httpd.conf
>> +++ b/config/httpd/httpd.conf
>> @@ -49,4 +49,10 @@ Include /etc/httpd/conf/default-server.conf
>>   # Virtual server configuration
>>   Include /etc/httpd/conf/vhosts.d/*.conf
>>   
>> +# Allow local clients to pull Apache's status
>> +<Location /server-status>
>> +    SetHandler server-status
>> +    Require local
>> +</Location>
>> +
>>   # EOF
> 

[-- Attachment #2: 01_redirect_apache_localhost_to_port_81.patch --]
[-- Type: text/plain, Size: 496 bytes --]

--- a/observium/scripts/agent-local/apache	Sun Oct  4 07:21:06 2015
+++ b/observium/scripts/agent-local/apache	Mon Jun 22 16:36:40 2026
@@ -26,7 +26,7 @@
         close INFILE;
 } else {
         # grab the status URL (fresh data)
-        @data = split /(\n)/, LWP::Simple::get( 'http://localhost/server-status?auto' )
+        @data = split /(\n)/, LWP::Simple::get( 'http://localhost:81/server-status?auto' )
                 or die "Data fetch failure.\n";
 
         # write file

  reply	other threads:[~2026-06-22 14:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 14:15 Peer Dietzmann
2026-06-22 14:20 ` Peer Dietzmann
2026-06-22 14:59   ` Matthias Fischer [this message]
2026-06-22 15:07   ` Matthias Fischer
2026-06-22 17:18   ` Matthias Fischer
2026-06-22 20:42     ` Peer Dietzmann
2026-06-23  7:39       ` Matthias Fischer
2026-06-23  9:21         ` Peer Dietzmann
2026-06-23 11:32           ` Matthias Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b887cfb8-3647-497f-bc1f-e1117838725b@ipfire.org \
    --to=matthias.fischer@ipfire.org \
    --cc=development@lists.ipfire.org \
    --cc=dietzmann@brecht-schule.hamburg \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox