diff --git a/evomaintenance.sh b/evomaintenance.sh index cc50f21..4db0a98 100755 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -199,7 +199,16 @@ fi SQL_TEXTE=`echo "${TEXTE}" | sed "s/'/''/g"` PG_QUERY="INSERT INTO evomaint(hostname,userid,ipaddress,begin_date,end_date,details) VALUES ('${HOSTNAME}','${USER}','${IP}','${BEGIN_DATE}',now(),'${SQL_TEXTE}')" -echo "${PG_QUERY}" | psql ${PGDB} ${PGTABLE} -h ${PGHOST} +#echo "${PG_QUERY}" | psql ${PGDB} ${PGTABLE} -h ${PGHOST} + +curl -H "Content-Type: application/json" -X POST http://172.28.128.3:8000 -d '{ + "hostname": '${HOSTNAME}', + "userid": '${USER}', + "ipaddress": '${IP}', + "begin_date": '${BEGIN_DATE}', + "end_date": '$(now())', + "details": '${SQL_TEXTE}' +}' # send mail MAIL_TEXTE=$(echo "${TEXTE}" | sed -e "s@/@\\\\\/@g ; s@&@\\\\&@")