diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 2c4a6f285c..b47c727158 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2013-11-26 KIKUCHI koichiro + + * util/pandora_remote_agent.sh: Added "-e" option to be able to + specify character encoding of the output XML. Also added PID + number to the output file name to avoid race conditions. + 2013-11-26 KIKUCHI koichiro * lib/PandoraFMS/DB.pm: Fixed get_agent_status to return warning status diff --git a/pandora_server/util/pandora_remote_agent.sh b/pandora_server/util/pandora_remote_agent.sh index f76aa1a4bd..58e2b2ec13 100755 --- a/pandora_server/util/pandora_remote_agent.sh +++ b/pandora_server/util/pandora_remote_agent.sh @@ -17,6 +17,7 @@ function help { echo -e "Syntax:" echo -e "\t-a agent Agent name as will be presented in the output XML" echo -e "\t-f scriptfile Script file to execute. It must generate the XML for modules itself" + echo -e "\t-e encoding Character encoding of the agent name and scriptfile output (default: $ENCODING)" echo -e "\t-h This help" echo "" exit @@ -30,7 +31,7 @@ fi AGENT="" SCRIPTFILE="" -while getopts ":h:a:f:" optname +while getopts ":h:a:f:e:" optname do case "$optname" in "h") @@ -41,7 +42,10 @@ while getopts ":h:a:f:" optname ;; "f") SCRIPTFILE=$OPTARG - ;; + ;; + "e") + ENCODING=$OPTARG + ;; ?) help ;; @@ -70,7 +74,7 @@ TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` SERIAL=`date +"%s"` # File names -DATA=$TEMP/$AGENT.$SERIAL.data +DATA=$TEMP/$AGENT.$$.$SERIAL.data # Makes data packet echo " " > $DATA