# Exec commands via usage of child\_process

**URL:** <https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280>\
**Category:** Kibana\
**Created:** [September 14, 2015, 9:04pm UTC](https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280 "2015-09-14T21:04:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vande](https://avatars.discourse-cdn.com/v4/letter/v/58f4c7/32.png) [@vande](https://discuss.elastic.co/u/vande)\
**Post date:** [September 14, 2015, 9:04pm UTC](https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280/1 "2015-09-14T21:04:15Z")

</div>

Hi,

this might be a kind of strange problem to be solved, but I'm trying to execute a shell-script on my kibana-host-server out of the kibana interface. To approach this for example and to make it simple, lets say every time the "about" page is opened (Kibana-\>Settings-\>About), a simple shell script should be started. (and add +1 to a counter or whatever within the script).  
I tried the "obvious" way and simply added  
`var child_process = require('child_process');`  
on top of the index.js from the directory /src/plugins/kibana/public/settings/sections/about, to be able to execute commands later on with `child_process.exec('sh counter.sh', function (err, stdout, stderr){}...`.  
As soon as the dev server is started, this error shows up: `Module not found: Error: Cannot resolve module 'child_process'` (with information about the path of the file above)  
Why is there a problem with including this module? - How to make it work?  
What other approaches could be possible to make the execution of a shell script out of the kibana interface work?

Thanks a lot for help/information/new input!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 14, 2015, 9:13pm UTC](https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280/2 "2015-09-14T21:13:25Z")

</div>

Let's take a step back here. What are you trying to accomplish, i.e. what problem are you trying to solve by running a program every time the About page is loaded?

---

<div class="post-metadata">

**Author:** ![vande](https://avatars.discourse-cdn.com/v4/letter/v/58f4c7/32.png) [@vande](https://discuss.elastic.co/u/vande)\
**Post date:** [September 14, 2015, 9:37pm UTC](https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280/3 "2015-09-14T21:37:28Z")

</div>

The general goal I'm trying to accomplish is to execute shell commands - on the host - out of the kibana interface. Not more, not less.

The approach/usecase with the About page was choosen by me only to get a grip on a solution with very simple circumstances and without the risk of damaging anything "important" at first.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:09pm UTC](https://discuss.elastic.co/t/exec-commands-via-usage-of-child-process/29280/5 "2017-07-06T14:09:08Z")

</div>


