# Creating a Command with Custom Variable

**URL:** <https://community.icinga.com/t/creating-a-command-with-custom-variable/11879>\
**Category:** Icinga Director\
**Tags:** director\
**Created:** [April 26, 2023, 2:03pm UTC](https://community.icinga.com/t/creating-a-command-with-custom-variable/11879 "2023-04-26T14:03:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scampbellkelly](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@scampbellkelly](https://community.icinga.com/u/scampbellkelly)\
**Post date:** [April 26, 2023, 2:03pm UTC](https://community.icinga.com/t/creating-a-command-with-custom-variable/11879/1 "2023-04-26T14:03:08Z")

</div>

Hello,

Bare with me, I’m still new to Icinga Director and I couldn’t find my answer in the documentation. I’ve created a custom command in Director and instead of having it ping the IP Address or Hostname, I want it to ping a custom variable, which is two different IP Addresses. I’ve already setup the field/custom variable and added it to my host and configure it to be an array so that I can define multiple IPs. What I’m trying to do is have the custom command ping whatever is the custom variable in that field without having to define it in the custom command. I’ve also added the variable to command, however I can’t seem to modify it so that it uses the custom variable and not the host’s IP or hostname.

thanks!  
Below are the details about my icinga environment  
 ![Screen Shot 2023-04-20 at 4.11.21 PM](https://community.icinga.com/uploads/default/original/2X/0/09a6cb8be48203601feda4336a52cd6d18cd5ca1.png)

 ![Screen Shot 2023-04-20 at 4.06.28 PM](https://community.icinga.com/uploads/default/original/2X/9/971896fa42b90403398040237601cce59aef3b14.png)  
 ![Screen Shot 2023-04-20 at 4.06.07 PM](https://community.icinga.com/uploads/default/original/2X/d/dc165b4597d7b1959e7ee3a22bc0de83d3e008ba.png)
