Preface
When issuing check_commands in OP5 Monitor they are run as the user monitor. However, they are not run in a full login session. As such, they have limited environment variables available to them. Sometimes it's necessary to make environment variables available to the check_commands. This can be done in the following ways.
EL6
It's possible to use the file /etc/sysconfig/naemon to define environment variables as such:
export VARIABLE=value
EL7
The above-mentioned method is not currently working on EL7. Instead, variables can be defined in /etc/systemd/system/monitor.service. In the section [Service], add the following line:
Environment="VARIABLE=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.
Related articles
-
Tags:
- Naemon
- check_commands
- environment variables
- export variable
- environment
- variables
Comments
0 comments
Please sign in to leave a comment.