Back to OP5 Monitor FAQ

How to add environment variables to naemon check_commands

Preface Copied

When issuing check_commands in OP5 Monitor they run as the user monitor. However, they do not run in a full login session. Because of this, they have limited environment variables available to them. Sometimes it’s necessary to make environment variables available to the check_commands.

You can define variables in /etc/systemd/system/monitor.service. In the section [Service], add the following line:

Environment="VARIABLE=value"

Note that you cannot expand variables such as PATH in the value field using this method. You must define a value without using existing environment variables as part of the value.

After this, reload and restart the monitor service:

systemctl daemon-reload && systemctl restart monitor.service

Note that the above is a workaround waiting for the resolution of bug MON-10843. It’s possible that the service file for monitor.service could be overwritten by a yum update. Please consult with Support for information about this.

["Geneos"] ["FAQ"]

Was this topic helpful?