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?
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?