Ad Widget

Collapse

Variable into userparameter files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daniel.bonet
    Junior Member
    • Jul 2016
    • 1

    #1

    Variable into userparameter files

    I have a question: It's possible to define a variable into userparameter file?

    This is example of my userparameter_switch.conf file:

    #!/bin/sh
    data=""

    if [ "$data" == "" ];then
    data=`/usr/lib/check_mk_agent/local/check_http_code_counter.sh`
    fi

    UserParameter=Code206,echo $data | awk '{print $3}' | cut -d "|" -f2 | cut -d "=" -f2
    UserParameter=Code301,echo $data | awk '{print $3}' | cut -d "|" -f3 | cut -d "=" -f2
    UserParameter=Code304,echo $data | awk '{print $3}' | cut -d "|" -f4 | cut -d "=" -f2
    UserParameter=Code400,echo $data | awk '{print $3}' | cut -d "|" -f5 | cut -d "=" -f2
    UserParameter=Code401,echo $data | awk '{print $3}' | cut -d "|" -f6 | cut -d "=" -f2



    I want to achieve with this is to avoid having to run the same script as many times. It's possible?
Working...