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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greg.harvey’s picture

Hi,

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... :-)

kenorb’s picture

Yes, 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.

greg.harvey’s picture

Right, 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...

kenorb’s picture

We 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.

greg.harvey’s picture

Good 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... :-)

kenorb’s picture

I'll try in the first convenient time, but my schedule is too busy this week:)

greg.harvey’s picture

No worries, whoever gets there first! :-)

greg.harvey’s picture

FileSize
1.77 KB

New 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?

kenorb’s picture

Patch looks great, thank you.

greg.harvey’s picture

Status: Needs review » Reviewed & tested by the community

Cool, will commit in a bit.

  • greg.harvey committed 40e0639 on 7.x-1.x authored by kenorb
    Issue #2496659 by greg.harvey, kenorb: Change default nagios status path
    
greg.harvey’s picture

Status: Reviewed & tested by the community » Fixed

Pushed. All done! :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.