Ad Widget

Collapse

UserParameter command with python script giving error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Divya
    Junior Member
    • Apr 2014
    • 6

    #1

    UserParameter command with python script giving error

    I have installed zabbix agent in my windows host and zabbix server runs in the guest(virtualbox) ubuntu machine.

    Updated zabbix agent configuration file with User Parameter key and command as below-
    UserParameter=timetaken,"python c:\zabbix\extractstring.py"
    and i have added the line "EnableRemoteCommands=1"
    When i execute this command in Windows cmd prompt it gives me the output.

    But in zabbix agent log file it throws the below error-
    11264:20140421:120223.032 Run remote command ["python c:\zabbix\extractstring.py"] Result [66] [The filename, direct]...
    11264:20140421:120223.033 Sending back [The filename, directory name, or volume label syntax is incorrect.]

    Please help me on what might be the problem.
    I have used print statement in the python script to print the output.
    Will this be a problem /do i need do any other configuration changes.
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    1) provide the full path to python. Don't use just a word "python"
    2) check if you have any default settings in your script and replace it to full path also.
    3) check permissions
    4) check if your script works when you call zabbix_agentd locally
    Code:
    zabbix_agentd -t timetaken
    Sincerely yours,
    Aleksey

    Comment

    • Divya
      Junior Member
      • Apr 2014
      • 6

      #3
      UserParameter command with python script giving error-Solved

      Thanks Aleksy.

      Giving the whole command within quotes was the problem. Solved it by providing as below-

      UserParameter=timetaken,C:\Python27\python.exe c:\zabbix\extractstring.py

      Comment

      Working...