# Separator Logic for Check Commands

**URL:** <https://community.icinga.com/t/separator-logic-for-check-commands/9133>\
**Category:** Icinga 2\
**Tags:** checkcommand, icinga2\
**Created:** [February 2, 2022, 1:46pm UTC](https://community.icinga.com/t/separator-logic-for-check-commands/9133 "2022-02-02T13:46:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![subgenius](https://community.icinga.com/user_avatar/community.icinga.com/subgenius/32/4673_2.png) [@subgenius](https://community.icinga.com/u/subgenius)\
**Post date:** [February 2, 2022, 1:46pm UTC](https://community.icinga.com/t/separator-logic-for-check-commands/9133/1 "2022-02-02T13:46:20Z")

</div>

Hi,

Can somebody advise what is the logic of CheckCommand merging file path on Windows and Linux with separators per OS?

I have the following CheckCommand definition:

```auto
object CheckCommand "check_http_windows-TEST" {
        import "plugin-check-command"
        command = [MyCompanyPluginDir, "..\\python3\\python.exe"]

```

On Windows Asset service that using this check command is generated as per below:

```auto
 * command = ["c:\mycompany\monitoring", "..\python3\python.exe"]

```

However, when looking at my debug log and Web2 interface output I’m getting my command like that:

```auto
Command c:\mycompany\monitoring ..\python3\python.exe c:\mycompany\monitoring\check_http.py failed to execute: 5, "Access is denied."

```

As you can see the problem is SPACE between MyCompanyPluginDir (that is set to C:\mycompany\monitoring on Windows). Can somebody tell me where th is space coming from?

Are logic of CheckCommand when specified as list [] would not be to use something like python os.sep (so / vs \ for Linux/Windows) to generate command string?

Hope my problem is clear - looking where my space coming from.

Icinga version 2.13.2  
Master: Centos 7  
Agent: Windows Server 2k19

---

<div class="post-metadata">

**Author:** ![subgenius](https://community.icinga.com/user_avatar/community.icinga.com/subgenius/32/4673_2.png) [@subgenius](https://community.icinga.com/u/subgenius)\
**Post date:** [February 2, 2022, 1:54pm UTC](https://community.icinga.com/t/separator-logic-for-check-commands/9133/2 "2022-02-02T13:54:12Z")

</div>

Hi

Please note issue has been fixed by using + instead of, (comma) in merging arguments for my CheckCommand

Can somebody however advise is there is a way to do OS Separator correctly ? So I can use same check commands on windows/linux - are + gonna solve this problem if I do ex:

```auto
        command = [MyCompanyPluginDir + "python3" + "python.exe""]

```

And this will generate correct path for both Windows/Linux?

Thanks
