Problem/Motivation

I created a small custom nagios module with drush gen and for hook implementation it took example code from nagios.api.php but I got errors because of missing array keys. I figured out that the hook example fits to the internal functions in nagios.module which are called from own hook implementation nagios_nagios() but doesn't work for hook implementation in other modules.

Steps to reproduce

Use Example code as described in nagios.api.php:

return [
    'key' => 'IDENTIFIER',
    // This identifier will appear on Nagios' monitoring pages and alerts.
    'data' => $data,
];

Proposed resolution

Use this code and the data are processed properly:

return [
    'IDENTIFIER' => $data,
];

Remaining tasks

Change nagios.api.php acdording to how the hook data are currently processed. Maybe check documentation and update if needes.

User interface changes

No.

API changes

No.

Data model changes

No.

Issue fork nagios-3583931

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

c-logemann created an issue. See original summary.

c-logemann’s picture

Assigned: c-logemann » Unassigned
Status: Active » Needs review
gogowitsch’s picture

Status: Needs review » Fixed

Merged!

Thank you for your contributions, @c-logemann and @tunic!

I have created a new release, 8.x-1.26.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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