foreman-documentation icon indicating copy to clipboard operation
foreman-documentation copied to clipboard

update the FQDN when doing the doing the monitoring configuration

Open Imaanpreet opened this issue 1 year ago • 7 comments

  • [x] I am okay with my commits getting squashed when you merge this PR.
  • [ ] I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • [ ] Foreman 3.11/Katello 4.13
  • [ ] Foreman 3.10/Katello 4.12
  • [ ] Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9)
  • [ ] Foreman 3.8/Katello 4.10
  • [ ] Foreman 3.7/Katello 4.9 (Satellite 6.14)
  • [ ] Foreman 3.6/Katello 4.8
  • [ ] Foreman 3.5/Katello 4.7 (Satellite 6.13; orcharhino 6.6/6.7)
  • We do not accept PRs for Foreman older than 3.5.

Imaanpreet avatar Aug 05 '24 23:08 Imaanpreet

Problem Statement

Here is the link

https://docs.redhat.com/en/documentation/red_hat_satellite/6.15/html-single/monitoring_satellite_performance/index#configuring-pcp-data-collection_monitoring

and here is the recommendation

cd /var/lib/pcp/pmdas/openmetrics
echo "https://satellite.example.com/metrics" > config.d/foreman.url
./Install 

Instead, it could be something like

cd /var/lib/pcp/pmdas/openmetrics
echo "https://$(hostname -f)/metrics" > config.d/foreman.url
./Install 

The reason is because, in general, the customer will copy/paste the command and will move on, as consequence, the implementation will fail, once the FQDN is different.

Imaanpreet avatar Aug 05 '24 23:08 Imaanpreet

I don't think this is a good idea, especially for API requests, because those can be run from other machines than the Foreman server.

Lennonka avatar Aug 05 '24 23:08 Lennonka

from Triage:

Hi @Imaanpreet

changing the value of the attribute has huge implications on the whole docs, so this is not something that is feasible in this PR. However, you can temporarily "overwrite" this attribute in specific lines and/or modules:

diff --git a/guides/doc-Monitoring_Project/master.adoc b/guides/doc-Monitoring_Project/master.adoc
index 1236c376c7..d1289b0ca2 100644
--- a/guides/doc-Monitoring_Project/master.adoc
+++ b/guides/doc-Monitoring_Project/master.adoc
@@ -16,8 +16,14 @@ include::common/modules/con_setting-up-the-metrics-monitoring-solution.adoc[leve
 
 include::common/modules/proc_installing-pcp.adoc[leveloffset=+2]
 
+:parent-foreman-example-com: {foreman-example-com}
+:foreman-example-com: $(hostname -f)
+
 include::common/modules/proc_configuring-pcp-data-collection.adoc[leveloffset=+2]
 
+:foreman-example-com: {parent-foreman-example-com}
+:!parent-foreman-example-com: {foreman-example-com}
+
 include::common/modules/proc_verifying-pcp-configuration.adoc[leveloffset=+2]
 
 ifndef::foreman-deb[]

This results in the following rendered docs:

image

maximiliankolb avatar Aug 08 '24 12:08 maximiliankolb

I'd even suggest that if you really want to do this (and that's a big if) then we should modify the procedure to avoid the attribute.

ekohl avatar Aug 08 '24 12:08 ekohl

I've suggested on Slack that instead of changing the value, we might add a sentence after the URL example to tell the user that they are supposed to replace the value with their own hostname. The command will not provide the correct value if they run it on another machine than the Foreman server.

So I agree with Ewoud that we should avoid changing the attribute.

Lennonka avatar Aug 08 '24 13:08 Lennonka

Hello @ekohl , @Lennonka & @maximiliankolb : thank you for looking in to the issue.

Sorry for the typo (for not adding $ while creating the PR) @ekohl.

Before creating the PR , I knew this we need to come to an agreement what to do with this request. So the goal of this PR is to avoid the failure and we can do this by adding an another line as @Lennonka mentioned. I can totally agree with @ekohl avoid changing the attribute.

Imaanpreet avatar Aug 08 '24 13:08 Imaanpreet

docs triage: Closing this PR. We cannot make this change as proposed: Docs and esp. attribute usage are consistent: we always have "foreman.example.com" as single FQDN for your Foreman instance.

Regarding HA/load balancing: please see https://github.com/theforeman/foreman-documentation/pull/3187#pullrequestreview-2220814483

@Imaanpreet If you have further concerns, please reopen the PR or ping us on Matrix.

maximiliankolb avatar Aug 22 '24 12:08 maximiliankolb

Hello @maximiliankolb : can we just add a line by replace the satellite/foreman hostname with FQDN for example -

"Be aware that you will need to replace the value of {foreman-example-com} with the FQDN of your server"

here

This way we keep the hardcoded value and we don't need to change it. What are your thoughts about it?

Imaanpreet avatar Oct 24 '24 12:10 Imaanpreet

@Imaanpreet Maybe after line 63 similar to

# guides/common/modules/snip_replace-fqdn-projectserver.adoc
1:Replace _{foreman-example-com}_ with the FQDN of your {ProjectServer}.

maximiliankolb avatar Oct 24 '24 12:10 maximiliankolb

@Imaanpreet Maybe after line 63 similar to

# guides/common/modules/snip_replace-fqdn-projectserver.adoc
1:Replace _{foreman-example-com}_ with the FQDN of your {ProjectServer}.

looks perfect.

Imaanpreet avatar Oct 24 '24 13:10 Imaanpreet

@maximiliankolb, Hello ! Have you updated the change? can I update and give you the new PR ?

Imaanpreet avatar Oct 29 '24 02:10 Imaanpreet