#!/bin/bash set -e usage="$0 [threshold]" if [ $# -eq 0 ] then echo $usage exit 1 fi time=$(date --rfc-3339=seconds) # files file=/usr/share/php/SysAl/AlarmInterface/RemoteInterface/request.tpl request_file=request.xml config_file=/usr/share/php/SysAl/AlarmInterface/RemoteInterface/CallPhp.config ls $file 1>/dev/null if [ $# -eq 2 ] then # threshold alarm grep -v AlarmSeverity $file |sed "s/_AMOI_/$(hostname)/" |sed "s/_VALUE_/$2/" |sed "s/_TIME_/$time/" |sed "s/_ALARM_/$1/" > request.xml else grep -v AlarmSeverity $file |grep -v ServiceInfluence |sed "s/_AMOI_/$(hostname)/" |sed "s/_TIME_/$time/" |sed "s/_ALARM_/$1/" > request.xml fi /usr/share/php/SysAl/util/CallPhp.php $request_file $config_file