Ad Widget

Collapse

SSH Agent passed parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • breakk
    Junior Member
    • Jan 2012
    • 3

    #1

    SSH Agent passed parameter

    Hi, i am trying to pass the {IPADDRESS} macro on a sshagent executed script and i can not get it to work. My item work if i specify my param. manually (it's a delta/sec lines count for a specific folder created by Rsyslog's %FROM-HOSTIP).

    {IPADDRESS} works in the "key" field so i tried to pass it to the executed script with $1 but still no success.

    ex:
    key: ssh.run[{IPADDRESS},10.1.1.1,22]
    script: bash /var/live_logs/count.sh {IPADDRESS} | tail -n 1
    or
    script: bash /var/live_logs/count.sh $1 | tail -n 1

    Like i said, the check works if i provide a valid parameter manually.

    EDIT:


    booo
    Last edited by breakk; 16-01-2012, 02:54.
  • breakk
    Junior Member
    • Jan 2012
    • 3

    #2
    i meant macros. Got it working with an external script this way:

    scriptname[{IPADDRESS}]

    Solved

    Comment

    • sirtech
      Junior Member
      • Aug 2012
      • 25

      #3
      Or as a solution to the original method...

      If you still want to use SSH, you can use the {HOST.CONN1} macro. There are a couple of others described in the official macro documentation which should expand in the key parameters, but HOST.CONN1 worked for me.

      Example key:

      ssh.run[sshitem1,{HOST.CONN1},22]

      Comment

      Working...