Ad Widget

Collapse

Can't execute command in alert script.please help me,thank you

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • balkline
    Junior Member
    • Nov 2013
    • 2

    #1

    Can't execute command in alert script.please help me,thank you

    My Alarm script is normal,but it have a small code ,the code is the Func command,the Func is run by root.When zabbix server alarm happen,zabbix action to execute 'sudo func $subip call zabbix slavestatus $subport $password '.it have not return anything. But I execute it use zabbix user on the host is not problem. The code is in the script is:
    my $func = "sudo func '"."$subip"."' call zabbix slavestatus $subport $password ";
    my $restr = readpipe($func);

    the /etc/sudoers is:
    root ALL=(ALL) ALL
    zabbix ALL=(ALL) NOPASSWD:ALL

    Please help me.why when zabbix server call the alarm script,the sudo func have not to return.but I execute the scripts in the host the sudo return. the
    zabbix server env ?
    Last edited by balkline; 05-11-2013, 03:20.
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    What is "call"? I do not know a command called "call" in Unix/Linux.

    Comment

    • balkline
      Junior Member
      • Nov 2013
      • 2

      #3
      Originally posted by steveboyson
      What is "call"? I do not know a command called "call" in Unix/Linux.
      Sorry,My English is very bad. the call is the mean that execute.Linux have not the command.

      Comment

      Working...