Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By default module defines default nagios path at /nagios, but it obviously conflicts with Nagios it-self.
Usually Nagios 3 is located at /nagios3, however older versions or when installing different themes, they've still pointing to /nagios.
I'm aware it's possible to change it in the configuration and use -P
for the script, but I guess it would be better to change it to something less ambiguous like '/nagios_status' within the module it-self.
Please find the patch in the attachment.
Comment | File | Size | Author |
---|---|---|---|
#8 | Change-default-status-page-path-2496659-8.patch | 1.77 KB | greg.harvey |
Comments
Comment #1
greg.harveyHi,
What's the context here, is this an issue because you're running Nagios on the same site as Drupal? Not sure what we're fixing is all... :-)
Comment #2
kenorb CreditAttribution: kenorb commentedYes, I think that's correct, I wanted to configure Nagios and Drupal on the same machine.
Nagios has been installed and was available at /nagios (I've checked the possibility of renaming it, but it's not easy).
I've installed
check_drupal
script in drupal_nagios.cfg on the same box which points to /nagios as well.I wanted to configure Nagios to monitor my live, qa and dev environments, but the main app running on live. To make it simple, I wanted to access Nagios page from the same domain (e.g. site1.com/nagios/), but it conflicts with the path configured in
check_drupal
script.Comment #3
greg.harveyRight, so what you're asking for is entirely reasonable. BUT I'm scared of the change, because it will basically break everyone's existing Nagios config on release. Which would make me the most hated maintainer on the devops scene. ;-)
I wonder how we could do something like this without doing it destructively? I'm tempted to put it on the back burner and do a major version hop for Drupal 8 (8.x-2.x) and make the change then...
Comment #4
kenorb CreditAttribution: kenorb commentedWe can add hook_update() (which usually is not executed on fresh install), then:
- if nagios_page_path variable doesn't exist, set it back manually to: nagios (via variable_set)
- if nagios_page_path variable exists, it has the right value, so no need to change anything.
Comment #5
greg.harveyGood idea! Would you have time to re-roll the patch with a hook_update_N() implementation for this? If not, I can probably do it later... :-)
Comment #6
kenorb CreditAttribution: kenorb commentedI'll try in the first convenient time, but my schedule is too busy this week:)
Comment #7
greg.harveyNo worries, whoever gets there first! :-)
Comment #8
greg.harveyNew patch attached. I've added a hook_update_N and I've also changed the path to "nagios-status" (hyphen, not underscore) because technically underscores are not supported in URLs. Not normally an issue, but I've seen it trip people up in the past, especially when dealing with quite old command line tools like wget. Better safe than sorry!
Does this look OK to you?
Comment #9
kenorb CreditAttribution: kenorb commentedPatch looks great, thank you.
Comment #10
greg.harveyCool, will commit in a bit.
Comment #12
greg.harveyPushed. All done! :-)