You are here

Setting environment for local plugins

1 post / 0 new
Anonymous's picture
Setting environment for local plugins

Blog post for opsview patches in nagios 4 describes adding envirnoment varioables to the check command definitions with "deifne command". Does this apply to locally defined checks in etc/nrpe_local configured with the "command" line? I can't find any docs that use "define command" in nrpe_local config files. Haven't tried just testing yet.


" allow this definition at the command level. So you can now define variables like this:

define command{ command_name notify-by-push-notifications-for-ios-mobile command_line /usr/local/nagios/libexec/notifications/notify_by_ios_push env NAGIOS_HOSTADDRESS=$HOSTADDRESS$ env NAGIOS_CONTACTGROUPLIST=$CONTACTGROUPLIST$ }

Then the specified list of environment variables will get added at the time of the execution. Perfect for retaining backwards compatibility while still moving forward!"