Ad Widget

Collapse

Remote commands fail with special characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ptader
    Member
    • Sep 2007
    • 52

    #1

    Remote commands fail with special characters

    Our server (1.8.1) is configured to run remote commands whenever a Trigger with level "Disaster" occurs. The remote command is a shell script that takes Zabbix macros as arguments. The problem is that when one or more of the Macros contains a special character the agent responds "[ZBX_NOTSUPPORTED]". More specifically, the forward slash in my situation.

    The remote command:
    srv61:/zabbix/scripts/service_now/create_ticket-page.sh '{HOSTNAME}' '{TRIGGER.SEVERITY}' '{TRIGGER.KEY}' '{TRIGGER.NAME}' '{DATE}' '{EVENT.ID}' '{STATUS}' '{TRIGGER.ID}' '{TRIGGER.VALUE}'

    ...which translates to this when run:

    Requested [system.run[/zabbix/scripts/service_now/create_ticket-page.sh 'srv33' 'Disaster' 'vfs.fs.size[/,pfree]' 'TESTING Low free disk space on cmssrv33 volume /' '2012.02.21' '65000074' 'PROBLEM' '257899' '1',nowait]]
    15480:20120221:121133.228 Sending back [ZBX_NOTSUPPORTED]


    Other "Disasters" work fine:

    21413:20120221:133044.441 Requested [system.run[/zabbix/scripts/service_now/create_ticket-page.sh 'srv113' 'Disaster' 'status' 'Server srv113 is unreachable' '2012.02.21' '65000478' 'PROBLEM' '163904' '1',nowait]]
    21413:20120221:133044.441 Executing command '/zabbix/scripts/service_now/create_ticket-page.sh 'srv113' 'Disaster' 'status' 'Server srv113 is unreachable' '2012.02.21' '65000478' 'PROBLEM' '163904' '1''
    21413:20120221:133044.441 Sending back [1]

    I've read about special character functionality being removed from earlier clients so I update the client to 1.8.8 and also tried adding "UnsafeUserParameters=1" to the agent configuration. Nothing worked.

    Anyway to escape Zabbix Macros?
  • abonne01
    Junior Member
    • Dec 2011
    • 15

    #2
    Hello,

    I have the same kind of issue (using zabbix 2.0). I have macros assigned to a host which is containing a special character (in my case : $ )

    This macro is used for an item "external check" as command line parameters:
    Key : script.sh,'{$macro}'

    example value for {$macro}: TEST$2012

    when I perform a trace on external script, it has been replace by : TEST012.
    $2 has been replaced by : nothing.

    I tried to set as macro value : TEST\$2012 without any success.

    Thanks a lot for help.

    PS: I noticed that post is old. But it's same issue which was not resolved.

    Comment

    Working...