Problem/Motivation
The new API states that hook_nagios() accepts an $id variable that can be used in order to check for individual functions.
However, the default implementation of the hook (nagios_nagios()) doesn't make use of this variable.
Proposed resolution
Add support for the $id variable in the nagios_nagios() function so that individual functions can be checked.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nagios-id-support-2854854-5.patch | 1.64 KB | ieguskiza |
Comments
Comment #2
ieguskiza commentedI added the first temptative patch to provide the requested functionality.
Comment #3
ieguskiza commentedComment #4
ieguskiza commentedI'm adding a new version that adds a default value to $id to avoid unpleasant php warnings.
Comment #5
ieguskiza commentedReuploading with a small fix to avoid php errors if passing a module as argument but not an id
Comment #6
dxvargas commentedTested, it works and the code is good.
Indeed, this development fulfills the API definitions. It also adds more uses to the module. Hope it can be merged soon!
Comment #7
gogowitsch commentedThe patch looks good, I'll push it to the 7.x-1.x branch today.
Comment #8
gogowitsch commentedYou can use this new feature from the HTTP status page, e.g. for the Drupal 7 defaults, the following will only run the cron check independent of the checkboxes on the settings page:
URL: https://your-drupal-7-domain/nagios-status/nagios/cron
In the URL above, the path segments are
hook_nagios()(nagios), and$id = "cron")I will also push this feature to the Drupal 8 branch,
8.x-1.x.Comment #10
gogowitsch commented