[Ovirt-devel] [PATCH node] RSyslog configuration for standalone mode.
Jim Meyering
jim at meyering.net
Fri Nov 7 21:07:04 UTC 2008
Bryan Kearney <bkearney at redhat.com> wrote:
> Thank you for reviewing
> Jim Meyering wrote:
>> Bryan Kearney <bkearney at redhat.com> wrote:
>
>>> +# check if we were called to attempt to default
>>> +# to remote logging
>>> +if [[ "$1" = "default" ]] ; then
>>> + printf "\nAttempting to locate remote syslog server..."
>>> + DEFAULT_SERVER=$(host -N 3 -t srv _syslog._udp | rev | awk '/VRS/ {print $1}' | cut -d. -f2- | rev)
>>> + DEFAULT_PORT=$(host -N 3 -t srv _syslog._udp | rev | awk '/VRS/ {print $2}' | cut -d. -f2- | rev)
>>
>> What does the output of that host command look like
>> when there is such a record?
>
> Here is an example:
>
> [bkearney at faceoff ~]$ host -N 3 -t srv _ipp._tcp
> _ipp._tcp.rdu.redhat.com has SRV record 10 0 631 cups.rdu.redhat.com.
Thanks.
Then, you might want to replace the above with something like this:
# Sample input:
# $ host -N 3 -t srv _ipp._tcp
# _ipp._tcp.rdu.redhat.com has SRV record 10 0 631 cups.rdu.redhat.com.
server_port=$(host -N 3 -t srv _ipp._tcp \
| sed 's/.* \([0-9][0-9]*\) \([^ ][^ ]*\)\.$/\2 \1/')
case $server_port in
*' '*)
printf "found! Using server:port '$DEFAULT_SERVER:$DEFAULT_PORT'.\n"
eval ovirt_rsyslog $server_port udp
;;
*)
printf "not found!\n"
;;
esac
More information about the ovirt-devel
mailing list