2013-11-26 KIKUCHI koichiro <koichiro@rworks.jp>
* 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. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9128 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e0c47a6c3e
commit
afc74d06b9
|
@ -1,3 +1,9 @@
|
|||
2013-11-26 KIKUCHI koichiro <koichiro@rworks.jp>
|
||||
|
||||
* 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 <koichiro@rworks.jp>
|
||||
|
||||
* lib/PandoraFMS/DB.pm: Fixed get_agent_status to return warning status
|
||||
|
|
|
@ -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")
|
||||
|
@ -42,6 +43,9 @@ 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 "<?xml version=\"1.0\" encoding=\"$ENCODING\"?> " > $DATA
|
||||
|
|
Loading…
Reference in New Issue