Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Hmm, there's a lot of change and a lot of regression here. You've basically ditched drush and NRPE support, so I can't merge this in right now. It feels like it needs breaking down, for example there's a fair bit of change to the check_drupal script which don't seem relevant to Drupal 8 and which should be reviewed in isolation. I fear if I use this "as is" then it will become hard to track the regressions it introduces, and we certainly can't use it as we're entirely NRPE reliant - we need the drush commands.
That said, those who need basic D8 functionality could probably use this version anyway and pull it from Github. :-)
Well, I just found the reason: the d.o repository's master branch is not the 7.x branch. So I used an old version (i.e. the master branch). Let me do it again on the 7.x branch. :-)
The dev branch on GitHub is now pretty much usable, i.e. can be tested on other machines.
There is currently one thing left: in 7.x a module can be ignored for updates on the modules list. Therefore a hook_theme and theme_nagios_modules_fieldset have been implemented.
Wouldn't it be more suitable to have that choice within the nagios configuration? I suggest to drop altering the system modules list. Instead, let's have a field group or a local task to select modules. What do you think?
I'll agree with dropping altering the system modules list. The current implementation for 7.x disappears when the popular Module Filter module is installed. Move the implementation of module ignoring internal keeps it from being necessary to coordinate with Module Filter-type modules to keep it working.
I've installed from Erik's github 8.x-dev code, and as far as the General Settings tab and Nagios being able to pull from the /nagios path, it seems to work OK, but on clicking on the "Ignored Modules" tab, I get an error 500, with this in my Apache error log:
[Wed Dec 30 04:58:22.729964 2015] [:error] [pid 22176] [client 2001:4978:312:1:a046:beac:2bed:477b:63524] Recoverable fatal error: Argument 1 passed to Drupal\\nagios\\Form\\IgnoredModulesForm::__construct() must be an instance of Drupal\\nagios\\Form\\ModuleHandlerInterface, instance of Drupal\\Core\\Extension\\ModuleHandler given, called in /home/drupal8/public_html/modules/custom/nagios/src/Form/IgnoredModulesForm.php on line 40 and defined in /home/drupal8/public_html/modules/custom/nagios/src/Form/IgnoredModulesForm.php on line 30, referer:http://drupal8.benshome.net/admin/config/system/nagios
PHP 5.6.11-1ubuntu3.1 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
I pulled down the new commit, and it seems to be returning a slightly different error:
[Tue Jan 05 17:25:00.260623 2016] [:error] [pid 3195] [client 76.17.108.117:3181] Recoverable fatal error: Argument 2 passed to Drupal\\nagios\\Form\\IgnoredModulesForm::buildRow() must be an instance of Drupal\\nagios\\Form\\Extension, instance of Drupal\\Core\\Extension\\Extension given, called in /home/drupal8/public_html/modules/custom/nagios/src/Form/IgnoredModulesForm.php on line 142 and defined in /home/drupal8/public_html/modules/custom/nagios/src/Form/IgnoredModulesForm.php on line 178, referer: http://drupal8.benshome.net/admin/config/system/nagios
I testd the actual code and it looks fine especially the status page I need mostly with cron check. And here I found a bug:
The nagios status page reports "CRON:OK" when "Last run" is more than the cron threshold setting.
There is only a small error in getting the cron duration setting so always default value "60" was used even when I was testing with "5 minutes" for example.
I created a PR on Github for this: https://github.com/ErikWegner/drupal_nagios/pull/1
When this change is committed we can move back to RTBC in my opinion.
Just found a second bug of getting settings: The function nagios_nagios() is returning every test even if they are disabled.
It's just a minor change and I have already fixed this. Here is my PR on github: https://github.com/ErikWegner/drupal_nagios/pull/2
I was out all last week so haven't really been tracking this, but Erik nudged me by email and I'll try to find the time this week to pull in his port so it's on the D8 branch of the Drupal repo. Unfortunately I can't add him as a maintainer, I do not have the necessary privileges.
Wouldn't it be more suitable to have that choice within the nagios configuration? I suggest to drop altering the system modules list. Instead, let's have a field group or a local task to select modules. What do you think?
I don't think we care, as long as it works! :-)
Using the modules page was just for UX, but at the end of the day it's not something "normal" site editors will ever care about. I'd be happy if it's just a YAML file. In fact, I'd *prefer* that, then you could keep your excluded modules list in Git. :-)
Erik, all, I'm really sorry that wasn't properly attributed to Erik - you can see from the commit history I usually *always* credit commits: https://www.drupal.org/node/368588/commits
I used the Git command at the bottom of this thread without looking at it properly, assuming it would automatically add Erik as author, but didn't realise the radio button was not set to him (only the checkbox) - massive UX fail (and me fail!) ... thanks to C_Logemann for pointing it out.
I'm going to contact the infrastructure team and see if there's any way to rectify this, *especially* now attributions affect rankings in various places and stuff like that.
Comments
Comment #2
jackalope commentedChiming in with interest about a Drupal 8 version of the Nagios module. Any plans?
Comment #3
c-logemannI also have an interest in a Drupal 8 version and offer my help with this.
Comment #4
erikwegner commentedThis repository contains a working draft of the port: https://github.com/ErikWegner/drupal_nagios/tree/Drupal8Port
Right now, a settings and an empty status page have been ported. The real checking functions are in the queue for the next commit.
Comment #5
erikwegner commentedThe checking functions have been ported now. Please test and report feedback.
Comment #6
greg.harveyThank you so much, Erik. I'll add your Github repo as a remote to my D.o repo and see if I can merge in your work to 8.x-1.x.
Comment #7
greg.harveyHmm, there's a lot of change and a lot of regression here. You've basically ditched drush and NRPE support, so I can't merge this in right now. It feels like it needs breaking down, for example there's a fair bit of change to the check_drupal script which don't seem relevant to Drupal 8 and which should be reviewed in isolation. I fear if I use this "as is" then it will become hard to track the regressions it introduces, and we certainly can't use it as we're entirely NRPE reliant - we need the drush commands.
That said, those who need basic D8 functionality could probably use this version anyway and pull it from Github. :-)
Comment #8
erikwegner commentedWell, I just found the reason: the d.o repository's master branch is not the 7.x branch. So I used an old version (i.e. the master branch). Let me do it again on the 7.x branch. :-)
Comment #9
erikwegner commentedThe dev branch on GitHub is now pretty much usable, i.e. can be tested on other machines.
There is currently one thing left: in 7.x a module can be ignored for updates on the modules list. Therefore a hook_theme and theme_nagios_modules_fieldset have been implemented.
Wouldn't it be more suitable to have that choice within the nagios configuration? I suggest to drop altering the system modules list. Instead, let's have a field group or a local task to select modules. What do you think?
Comment #10
ben coleman commentedI'll agree with dropping altering the system modules list. The current implementation for 7.x disappears when the popular Module Filter module is installed. Move the implementation of module ignoring internal keeps it from being necessary to coordinate with Module Filter-type modules to keep it working.
Comment #11
erikwegner commentedCommit pushed to GitHub. Please review.
Comment #12
erikwegner commentedComment #13
ben coleman commentedI've installed from Erik's github 8.x-dev code, and as far as the General Settings tab and Nagios being able to pull from the /nagios path, it seems to work OK, but on clicking on the "Ignored Modules" tab, I get an error 500, with this in my Apache error log:
Comment #14
erikwegner commentedComment #15
erikwegner commentedInteresting, I cannot reproduce the problem. Which PHP-Version do you use?
But here is a new commit that addresses the issue. Does it help?
Comment #16
ben coleman commentedphp --version returns:
I pulled down the new commit, and it seems to be returning a slightly different error:
Comment #17
erikwegner commentedAnother reference added. Please try again.
Comment #18
ben coleman commentedThat seems to do it. That gets rid of the fatal error, and also a bunch of php messages in the drupal log for each cron run.
Comment #19
c-logemannThanks @ErikWegner for your work on this.
I testd the actual code and it looks fine especially the status page I need mostly with cron check. And here I found a bug:
The nagios status page reports "CRON:OK" when "Last run" is more than the cron threshold setting.
Comment #20
c-logemannI already found the problem in the code. I already fixed it and will create a pull request on github soon.
Comment #21
c-logemannThere is only a small error in getting the cron duration setting so always default value "60" was used even when I was testing with "5 minutes" for example.
I created a PR on Github for this: https://github.com/ErikWegner/drupal_nagios/pull/1
When this change is committed we can move back to RTBC in my opinion.
Comment #22
erikwegner commentedC_Logemann's fix has been merged.
Comment #23
c-logemann@ErikWegner Thanx for merging.
Comment #24
c-logemannJust renaming this issue. Because I want to create an issue on Drupal 8 Contrib Porting Tracker
Also it's better for my dashboard where so many "Drupal 8 port" Issues are listed.
Comment #25
c-logemannNow we have an official link on the project page to the D8 Post issue I have created:
#2647984: [nagios] Nagios monitoring
Comment #26
c-logemannJust found a second bug of getting settings: The function nagios_nagios() is returning every test even if they are disabled.
It's just a minor change and I have already fixed this. Here is my PR on github: https://github.com/ErikWegner/drupal_nagios/pull/2
Comment #27
erikwegner commentedThank you for your report and the fix. It has been included.
Comment #28
greg.harveyHi all,
I was out all last week so haven't really been tracking this, but Erik nudged me by email and I'll try to find the time this week to pull in his port so it's on the D8 branch of the Drupal repo. Unfortunately I can't add him as a maintainer, I do not have the necessary privileges.
Thanks,
Greg
Comment #29
greg.harveyOh, and FWIW:
I don't think we care, as long as it works! :-)
Using the modules page was just for UX, but at the end of the day it's not something "normal" site editors will ever care about. I'd be happy if it's just a YAML file. In fact, I'd *prefer* that, then you could keep your excluded modules list in Git. :-)
Comment #30
greg.harveyI also got rid of the 'master' branch in Git, as per https://www.drupal.org/empty-git-master - to avoid any future confusion. :-)
Comment #32
greg.harveyWow, the packager's much faster than it used to be! All done, Erik's D8 port is available on the project page for download and testing. :-)
Comment #33
greg.harveyErik, all, I'm really sorry that wasn't properly attributed to Erik - you can see from the commit history I usually *always* credit commits: https://www.drupal.org/node/368588/commits
I used the Git command at the bottom of this thread without looking at it properly, assuming it would automatically add Erik as author, but didn't realise the radio button was not set to him (only the checkbox) - massive UX fail (and me fail!) ... thanks to C_Logemann for pointing it out.
I'm going to contact the infrastructure team and see if there's any way to rectify this, *especially* now attributions affect rankings in various places and stuff like that.
Sorry sorry sorry! :(
Comment #35
greg.harveyOK, I've *sort of* fixed this. I've also opened an issue with the webmasters to tidy up my original commit:
https://www.drupal.org/node/2653524
Hopefully this is fully resolvable. :)