]> git.proxmox.com Git - mirror_ovs.git/blame - xenserver/etc_profile.d_vswitch.sh
xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as approp...
[mirror_ovs.git] / xenserver / etc_profile.d_vswitch.sh
CommitLineData
3b12adda 1# Copyright (C) 2009, 2010 Nicira Networks, Inc.
064af421
BP
2#
3# Copying and distribution of this file, with or without modification,
4# are permitted in any medium without royalty provided the copyright
5# notice and this notice are preserved. This file is offered as-is,
6# without warranty of any kind.
7
064af421
BP
8alias vswitch='service vswitch'
9
064af421
BP
10function watchdp {
11 watch ovs-dpctl show "$@"
12}
13
14function watchdpflows {
15 local grep=""
16 local dp=$1
17 shift
18 if [ $# -gt 0 ]; then
19 grep="| grep $@"
20 fi
21 watch "ovs-dpctl dump-flows $dp $grep"
22}
23
24function watchflows {
25 local grep=""
26 local dp=$1
27 shift
28 bridge=$(ovs-dpctl show $dp | grep 'port 0:' | cut -d' ' -f 3)
29 if [ $# -gt 0 ]; then
30 grep="| grep $@"
31 fi
32 watch "ovs-ofctl dump-flows unix:/var/run/$bridge.mgmt $grep"
33}
34
35function monitorlogs {
36 local grep=""
37 if [ $# -gt 0 ]; then
38 grep="| grep --line-buffered '^==> .* <==$"
39 for i in "$@"; do
40 grep="$grep\|$i"
41 done
42 grep="$grep'"
43 fi
44 cmd="tail -F /var/log/messages /var/log/ovs-vswitchd.log /var/log/xensource.log $grep | tee /var/log/monitorlogs.out"
45 printf "cmd: $cmd\n"
46 eval "$cmd"
47}