Add a script to get Xymon's alerts variables

This commit is contained in:
Jeremy Gardais 2018-08-21 13:33:03 +02:00
parent a3832036b4
commit 25d460d928
1 changed files with 23 additions and 0 deletions

23
xymon/get.xymon.alert.vars.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
log_file="/tmp/xymon.alert.${BBHOSTSVC}.vars"
# Print variables for an alert on a specific host
rm -f -- "${log_file}"
touch "${log_file}"
printf '%b' "BBCOLORLEVEL=\"${BBCOLORLEVEL}\"\\n" >> "${log_file}"
printf '%b' "BBALPHAMSG=\"${BBALPHAMSG}\"\\n" >> "${log_file}"
printf '%b' "ACKCODE=\"${ACKCODE}\"\\n" >> "${log_file}"
printf '%b' "RCPT=\"${RCPT}\"\\n" >> "${log_file}"
printf '%b' "BBHOSTNAME=\"${BBHOSTNAME}\"\\n" >> "${log_file}"
printf '%b' "MACHIP=\"${MACHIP}\"\\n" >> "${log_file}"
printf '%b' "BBSVCNAME=\"${BBSVCNAME}\"\\n" >> "${log_file}"
printf '%b' "BBSVCNUM=\"${BBSVCNUM}\"\\n" >> "${log_file}"
printf '%b' "BBHOSTSVC=\"${BBHOSTSVC}\"\\n" >> "${log_file}"
printf '%b' "BBHOSTSVCCOMMAS=\"${BBHOSTSVCCOMMAS}\"\\n" >> "${log_file}"
printf '%b' "BBNUMERIC=\"${BBNUMERIC}\"\\n" >> "${log_file}"
printf '%b' "RECOVERED=\"${RECOVERED}\"\\n" >> "${log_file}"
printf '%b' "DOWNSECS=\"${DOWNSECS}\"\\n" >> "${log_file}"
printf '%b' "DOWNSECSMSG=\"${DOWNSECSMSG}\"\\n" >> "${log_file}"
exit 0