# Execute Command Alarm Callback - Echo Command

**URL:** https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764
**Category:** Graylog Central (peer support)
**Created:** [November 5, 2020, 7:47pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764 "2020-11-05T19:47:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Tafsir\_Alam](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Tafsir\_Alam](https://community.graylog.org/u/Tafsir_Alam)
#### Post date: [November 5, 2020, 7:47pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/1 "2020-11-05T19:47:16Z")

</div>

Hello, everyone,

For sending the notification to the **Google-Chat** channel I am using **Execute Command Alarm Callback** Everything working fine, I am receiving alerts whenever any alert triggers. But in the same script, I added an echo command that will print the alert triggered time and date along with the variables data and append this into another directory CSV file. **The problem is echo command is not working/responding.** When I execute the same script directly on the server it’s working fine.

I tried everything but still, the echo command is not working. Don’t know is this a Graylog problem or something else. Could anyone help me with this? Sorry for the silly question.

I need to maintain a sheet that will contain Graylog triggered alerts.

Thanks  
Tafsir

 ![Screen Shot 2020-11-06 at 12.59.57 AM](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/c3af316b64f125624968c8813ae7a3580c620865.png)

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [November 5, 2020, 8:05pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/2 "2020-11-05T20:05:28Z")

</div>

he @Tafsir_Alam

when you call that script manually - is that echo working? Is that running if you do it as Graylog user?

---

<div class="post-metadata">

### Author: ![Tafsir\_Alam](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Tafsir\_Alam](https://community.graylog.org/u/Tafsir_Alam)
#### Post date: [November 5, 2020, 8:11pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/3 "2020-11-05T20:11:59Z")

</div>

Hi, @jan Thanks for the quick response.  
Yes, the echo is working when I call the script manually. I am running the script as a root user.

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [November 5, 2020, 8:16pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/4 "2020-11-05T20:16:48Z")

</div>

you should run the script as Graylog user - as this is the context Graylog is calling that.

---

<div class="post-metadata">

### Author: ![Tafsir\_Alam](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Tafsir\_Alam](https://community.graylog.org/u/Tafsir_Alam)
#### Post date: [November 5, 2020, 8:35pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/5 "2020-11-05T20:35:34Z")

</div>

Ran the script as Graylog user but still it’s not working.

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [November 5, 2020, 9:13pm UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/6 "2020-11-05T21:13:18Z")

</div>

so the work is now that you make that work as Graylog user.

Check the path, check that Graylog can run the command.

This is basic sys-admin work to figure out how to run the command within the script.

---

<div class="post-metadata">

### Author: ![Tafsir\_Alam](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Tafsir\_Alam](https://community.graylog.org/u/Tafsir_Alam)
#### Post date: [November 6, 2020, 7:31am UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/7 "2020-11-06T07:31:12Z")

</div>

Hi @jan  
I am able to run the same script manually on the server. I have already changed the ownership of the directory and file as Graylog user and group but still, it’s not working. The script is working fine till the curl command but after that not able to execute any Linux command.

Is there anything to do with the **Execute Command Alarm Callback** plugin?

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [November 6, 2020, 11:24am UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/8 "2020-11-06T11:24:14Z")

</div>

he @Tafsir_Alam

you wrote that the script does not give the desired output when you run this as Graylog user. If that isn’t the case you need to fix that first.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [November 20, 2020, 11:24am UTC](https://community.graylog.org/t/execute-command-alarm-callback-echo-command/17764/9 "2020-11-20T11:24:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
