mirror of git://bitreich.org/reed-alert
Separate desc from params in the output
This commit is contained in:
parent
fd80ed68f6
commit
5d2fda3df3
|
@ -4,9 +4,11 @@ awk -F'\t' \
|
|||
-v alert=1 \
|
||||
-v check=1 \
|
||||
-v params=1 \
|
||||
-v desc=1 \
|
||||
-v previousstate=1 \
|
||||
-v currentstate=1 \
|
||||
-v triggerstate=1 '
|
||||
-v triggerstate=1 \
|
||||
-v count=1 '
|
||||
|
||||
BEGIN {
|
||||
print "<html>"
|
||||
|
@ -16,9 +18,11 @@ BEGIN {
|
|||
if(alert) { print "<th>Alert</th>" }
|
||||
if(check) { print "<th>check</th>" }
|
||||
if(params) { print "<th>params</th>" }
|
||||
if(desc) { print "<th>description</th>" }
|
||||
if(previousstate) { print "<th>previous-state</th>" }
|
||||
if(currentstate) { print "<th>current-state</th>" }
|
||||
if(triggerstate) { print "<th>trigger-state</th>" }
|
||||
if(count) { print "<th>count</th>" }
|
||||
print "</tr></thead><tbody>"
|
||||
}
|
||||
|
||||
|
@ -27,9 +31,11 @@ BEGIN {
|
|||
if(alert) { print "<td>"$1"</td>" }
|
||||
if(check) { print "<td>"$2"</td>" }
|
||||
if(params) { print "<td>"$3"</td>" }
|
||||
if(previousstate) { print "<td>"$4"</td>" }
|
||||
if(currentstate) { print "<td>"$5"</td>" }
|
||||
if(triggerstate) { print "<td>"$6"</td>" }
|
||||
if(desc) { print "<td>"$4"</td>" }
|
||||
if(previousstate) { print "<td>"$5"</td>" }
|
||||
if(currentstate) { print "<td>"$6"</td>" }
|
||||
if(triggerstate) { print "<td>"$7"</td>" }
|
||||
if(count) { print "<td>"$8"</td>" }
|
||||
print "</tr>"
|
||||
|
||||
}
|
||||
|
|
|
@ -148,8 +148,20 @@
|
|||
(format stream-out "~a~%~a~%" (+ 1 tries) params))
|
||||
nil))
|
||||
|
||||
(format t "~a ~A ~A ~A ~A ~A ~A~%"
|
||||
level fonction (format nil "~{~A ~}" params)
|
||||
(format t "~a ~A ~A ~A ~A ~A ~A ~A~%"
|
||||
level fonction
|
||||
(let ((desc-pos (position :desc params)))
|
||||
(if desc-pos
|
||||
(remove nil
|
||||
(loop for i in params
|
||||
counting t into j
|
||||
collect
|
||||
(when (not (or
|
||||
(= j (+ 1 desc-pos))
|
||||
(= j (+ 2 desc-pos))))
|
||||
i)))
|
||||
params))
|
||||
(getf params :desc "")
|
||||
(if previous-state "SUCCESS" "ERROR")
|
||||
(if current-state "SUCCESS" "ERROR")
|
||||
trigger-state
|
||||
|
|
Loading…
Reference in New Issue