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.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | nagios-Fix_Undefined_Variable_date-2653694-4.patch | 775 bytes | Ben Coleman |
#3 | nagios-Fix_Watchdog_Constants-2653694-3.patch | 1.63 KB | Ben Coleman |
Comments
Comment #2
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedThe '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.
Comment #3
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedThe 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.
Comment #4
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedThe 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.
Comment #5
greg.harveyThanks again, Ben. Committed!