How to make nagios scripts to work?


I’m trying the scripts for monitoring kaltura services, I’m executing this in the command line:

/usr/bin/php /opt/kaltura/app/plugins/monitor/nagios/exec.php --warning-threshold 1 --error-threshold 5 --script “/opt/kaltura/app/tests/monitoring/api_v3/ping.php --service-url myhostname”

but I get the following error:

PHP Notice: Undefined index: protocol in /opt/kaltura/app/tests/monitoring/api_v3/common.php on line 124
PHP Notice: Undefined index: port in /opt/kaltura/app/tests/monitoring/api_v3/common.php on line 124
PHP Catchable fatal error: Argument 1 passed to KalturaClientBase::setClientConfiguration() must be an instance of KalturaClientConfiguration, string given, called in /opt/kaltura/app/tests/monitoring/api_v3/common.php on line 137 and defined in /opt/kaltura/app/tests/lib/KalturaClientBase.php on line 704

I remember using it before, and it was working OK, but now that I’m trying it again, is not.

I wonder if somebody has any suggestions

thank you.

Hi @aquileasfx1,

These scripts haven’t been properly maintained for a while I’m afraid…
You didn’t specify what version you are using but I tested it with the latest and here is what you should do to make it work:
Edit /opt/kaltura/app/tests/monitoring/api_v3/common.php:124 to read:

$serviceUrl = $config['config']['protocol'] . '://' . $options['service-url'] . ':' . $config['config']['port'];

Comment out lines 135 and 136.

That should fix it.

1 Like

Thank you very much!!

that did the trick!

Welcome, @aquileasfx1 and thanks for reporting.
I made this pull which fixes it:

So the next release will not suffer from this issue.