Need help adding a Monitoring module tab via own module

Hello,

I am trying to add a tab to the monitoring module via my own module in Inciga Web 2. To do so, I have created and provided an ObjectDetailsTab hook but I cannot manage to get the tab to display at all.

My hook is in a file named ObjectDetailsTabGraph.php and looks like this

<?php
namespace Icinga\Module\Grapher\ProvidedHook;

use Icinga\Module\Monitoring\Hook;

class ObjectDetailsTabGraphHook extends ObjectDetailsTabHook
{
        public function getName()
        {
                return 'Test';
        }

        public function getLabel()
        {
                return 'Test';
        }

        public function getContent(MonitoredObject $monitoredObject, Request $request)
        {
                return '<div>Test</div>';
        }
}

And is exposed in run.php with

$this->provideHook(
        'monitoring/ObjectDetailsTabHook',
        '\\Icinga\\Module\\Grapher\\ProvidedHook\\ObjectDetailsTabGraph'
);

Am I missing anything obvious ?

Please forgive me if it’s a dumb question, I am quite new to anything web-dev related.

Alright, I resolved my issue.

It was very dumb, I just renamed my class to ObjectDetailsTabGraph.

1 Like