3 Comments Already

mygif
sj7trunks Said,
October 17th, 2010 @11:58 pm  

The zabbix script gave me random blank lines, I fixed it with the following:

-# Getting alert time
-ALERTTIME=`echo “$ALERTID” | cut -d “.” -f 1`
-
-# Getting end of alert
-ALERTLAST=`echo “$ALERTID” | cut -d “.” -f 2`
-
-# Getting full alert
-ALERTTEXT=`grep -A 10 “$ALERTID” $PWD/../logs/alerts/alerts.log |awk “/$ALERTID/,/^$/” | grep -v “.$ALERTLAST: ” -A 10 `
+ALERTTEXT=`grep -A 10 “$ALERTID” $PWD/../logs/alerts/alerts.log | awk “/$ALERTID/,/^$/”| grep -v “$ALERTID”`

Cheers,
Benjamin

Pingback & Trackback

Related Post

Leave Your Comments Below

Please Note: All comments will be hand modified by our authors so any over offensive comments will be removed and your submitted comments will be appreared after approved