---
title: "How to add environment variables to naemon check_commands"
description: "Environment variables for naemon check_commands in OP5 Monitor are limited due to non-login session execution. You can add variables by defining them in the monitor.service file and then reloading and restarting the service."
url: "https://docs.itrsgroup.com/docs/faq/op5/360003060757-op5-monitor-how-to-add-environment-variables-to-naemon-check-commands/index.html"
---
## Preface

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.

## Related articles

- [How to use check\_oracle with Oracle Instant Client](https://docs.itrsgroup.com/docs/faq/op5/360020054794-op5-monitor-how-to-use-check-oracle-with-oracle-instant-client/index.html)


