I actually encountered this before Erik's code was pulled into 8.x-1.x-dev, but on each access of /nagios, I'm seeing a slough of log messages. On a quick look, this mostly seems to be watchlog-related. I've extracted the messages out of the log:

Warning: Invalid argument supplied for foreach() in nagios_check_requirements() (line 275 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_DEBUG - assumed 'WATCHDOG_DEBUG' in nagios_check_watchdog() (line 442 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_INFO - assumed 'WATCHDOG_INFO' in nagios_check_watchdog() (line 443 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_NOTICE - assumed 'WATCHDOG_NOTICE' in nagios_check_watchdog() (line 444 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_WARNING - assumed 'WATCHDOG_WARNING' in nagios_check_watchdog() (line 445 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_ERROR - assumed 'WATCHDOG_ERROR' in nagios_check_watchdog() (line 446 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_CRITICAL - assumed 'WATCHDOG_CRITICAL' in nagios_check_watchdog() (line 447 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_ALERT - assumed 'WATCHDOG_ALERT' in nagios_check_watchdog() (line 448 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Use of undefined constant WATCHDOG_EMERG - assumed 'WATCHDOG_EMERG' in nagios_check_watchdog() (line 449 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Undefined offset: 4 in nagios_check_watchdog() (line 465 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Undefined offset: 5 in nagios_check_watchdog() (line 465 of /home/drupal8/public_html/modules/custom/nagios/nagios.module).
Notice: Undefined variable: date in Drupal\nagios\Controller\StatuspageController->content() (line 154 of /home/drupal8/public_html/modules/custom/nagios/src/Controller/StatuspageController.php).

The undefined offsets occur multiple times.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ben Coleman created an issue. See original summary.

Ben Coleman’s picture

The 'Invalid argument supplied for foreach()' error is fixed by the patch in #2653786: /nagios returns 500 status after setting ignored modules. A null variable certainly would be an invalid argument for a foreach.

Ben Coleman’s picture

The undefined constant messages are because WATCHDOG_ constants are now RfcLoglevel:: constants. The attached patch corrects this. This also gets rid of the undefined offset messages.

Ben Coleman’s picture

Status: Active » Needs review
FileSize
775 bytes

The only thing left, the Undefined variable: date is, well, correct. That's the only place $date occurs in the whole module. If the idea is to pass null so there's no expire header (MaxAge overrides it in any case), you can just leave out the argument, as it defaults to null. Patch attached for that scenario.

greg.harvey’s picture

Status: Needs review » Fixed

Thanks again, Ben. Committed!

Status: Fixed » Closed (fixed)

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