Ad Widget

Collapse

Zabbix remote command execution help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbidwell
    Senior Member
    • Aug 2006
    • 127

    #1

    Zabbix remote command execution help

    Hi all, this part is very new to me.

    I've got a script set to run in the event that a trigger sets. I manually set this trigger and the script does not run.

    my syntax is:

    hostname:script.sh

    my script is located ON the zabbix server in /home/zabbix/bin with appropriate perms. Does anyone know what I'm doing wrong?
    within the script, I even have sudo running the command.

    Does the script need to reside on the host needing to run it? That would actually make sense to me, not sure why I even asked that.
    Last edited by cbidwell; 15-05-2007, 19:48.
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,
    Originally posted by cbidwell
    Does the script need to reside on the host needing to run it? That would actually make sense to me, not sure why I even asked that.
    Nope, this type of script has to be on the Zabbix server. Some things to check is that you have a shell spec listed in the file, ie. #!/bin/bash and that the Zabbix user has read / execute permissions on the server. To test this, I would recommend moving your script and use something like the following to see if the Syslog get's updated;
    Code:
    #!/bin/bash
    #
    # Simple script to send all Zabbix alerts to Syslog
    #
    /usr/bin/logger -p local6.info -t Zabbix "$@"
    I actually use this when I am doing various development work.
    Unofficial Zabbix Developer

    Comment

    • tronite
      Senior Member
      • Jun 2007
      • 147

      #3
      Originally posted by cbidwell
      Hi all, this part is very new to me.

      I've got a script set to run in the event that a trigger sets. I manually set this trigger and the script does not run.

      my syntax is:

      hostname:script.sh

      my script is located ON the zabbix server in /home/zabbix/bin with appropriate perms. Does anyone know what I'm doing wrong?
      within the script, I even have sudo running the command.

      Does the script need to reside on the host needing to run it? That would actually make sense to me, not sure why I even asked that.
      So did the above advice work?

      Comment

      Working...