Closed linbing1219 closed 7 years ago
metadatas(id: 2dc3c058-c50e-40e8-614c-ac79b5be9ef3)
Flags : 2 MAC : 33:33:ff:7b:50:09 State : 128 Type : 0 IPV6 :
Flags : 2 MAC : 33:33:ff:01:13:b0 State : 128 Type : 0 IPV6 :
analyzer's config:
# Skydive config file
# host_id is used to reference the agent by default set to hostname
# host_id:
# WebSocket Ping/Pong timeout in second
ws_pong_timeout: 5
# maximum number of topology aggregated messages before sending
# ws_bulk_maxmsgs: 100
# duration in seconds before flushing topology aggregated messages
# ws_bulk_maxdelay: 2
openstack:
# auth_url: http://xxx.xxx.xxx.xxx:5000/v2.0
# auth_url:http://10.251.47.155/dashboard/auth/login/
# username: admin
# password: 79da84d0ab01481f
# tenant_name: admin
# region_name: RegionOne
# The endpoint_type value must be 'public', 'internal' or 'admin'
# endpoint_type: public
# When using Keystone V3, domain_name needs to be specified
# domain_name: MyDomain
analyzer:
# address and port for the analyzer API, Format: addr:port.
# Default addr is 127.0.0.1
listen: 0.0.0.0:8082
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the agent
# X509_cert: /etc/ssl/certs/analyzer.domain.com.crt
# X509_key: /etc/ssl/certs/analyzer.domain.com.key
# Flow storage engine
storage:
# Available: elasticsearch, orientdb
backend: elasticsearch
# maximum number of flows aggregated between two data store inserts
bulk_insert: 100
# deadline of each bulk insert in second
bulk_insert_deadline: 5
topology:
# Define static interfaces and links updating Skydive topology
# Can be useful to define external resources like : TOR, Router, etc.
#
# A description language similar to the dot language is used to define
# interfaces and links. An arrow (->) is used to define a link between
# two interfaces (parent -> child).
# Square brackets after the arrow is used to define additional metadata
# of the link (->[key=value,..]). Each interface described will be
# created in the topology excepted interfaces with the local prefix.
# In that specific case the interface of the local host will be used.
# Attributes of interfaces are declared using square brackets ([]).
# The following example creates a TOR1 node linked to a TOR1_PORT1 which is
# linked to the local interface eth0.
fabric:
- TOR1[Name=tor1] -> [color=red] TOR1_PORT1[Name=port1, MTU=1500]
- TOR1_PORT1 -> *[Type=host]/eth0
# update rate of links in seconds
bandwidth_update_rate: 5
# interface metrics - 'netlink'
# captured flows TxBytes + RxByte - 'flows' (need to turn on capture)
bandwidth_source: netlink
# 'absolute' - thresholds in Kbit
# 'relative' - thresholds in % relative to link speed reported by netlink
bandwidth_threshold: absolute
bandwidth_absolute_active: 1
bandwidth_absolute_warning: 10
bandwidth_absolute_alert: 100
bandwidth_relative_active: 0.1
bandwidth_relative_warning: 0.4
bandwidth_relative_alert: 0.8
# list of analyzers used by analyzers and agents
analyzers:
- 0.0.0.0:8082
agent:
# address and port for the agent API, Format: addr:port.
# Default addr is 127.0.0.1
listen: :8081
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the analyzer and unique per agent (recommended)
# X509_cert: /etc/ssl/certs/agent.domain.com.crt
# X509_key: /etc/ssl/certs/agent.domain.com.key
# Server name field specified in TLS communications.
# Not required, but can be used to allow virtual hosting
# X509_servername: domain.com
#
topology:
# Probes used to capture topology informations like interfaces,
# bridges, namespaces, etc...
# Available: ovsdb, docker, neutron, opencontrail
probes:
- ovsdb
# - docker
# - neutron
# - opencontrail
netlink:
# delay in seconds between two metric updates
# metrics_update: 30
flow:
# Period in second to get capture stats from the probe. Note this
# currently only works for the pcap probe
# stats_update: 1
metadata:
info: This is compute node
sflow:
# Default listening address is 127.0.0.1
bind_address: 8.13.3.20
# Port min/max used when starting a sflow probe, a agent will be started
# with a port from this range
port_min: 6345
port_max: 6355
ovs:
# ovsdb connection, Format supported :
# * addr:port
# * tcp://addr:port
# * unix:///var/run/openvswitch/db.sock
# If you use the tcp connection you need to authorize connexion to ovsdb agent
# at least locally
# % sudo ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6400:127.0.0.1
# ovsdb: unix:///var/run/openvswitch/db.sock
oflow:
# Enable the parsing of openflow rules (disabled by default)
enable: false
# The probe can connect to remote bridge over TLS (ssl url).
# The default value is empty for those options.
# Path to the private key file (TLS connection)
# key: /etc/ssl/private/agent.key
# Path to the certificate associated to the key (TLS connection)
# cert: /etc/ssl/certs/agent.crt
# Path to certificate authority validating bridge connections (TLS connection)
# ca: /etc/ssl/certs/ca.crt
address:
# Map translating bridge names into URL for remote connection
# - bridge: ssl:xxx.yyy.zzz.ttt:port
docker:
# url: unix:///var/run/docker.sock
netns:
# allow to specify where the netns probe is watching network namespace
# run_path: /var/run/netns
opencontrail:
# Host address of the OpenContrail vrouter agent
# host: localhost
# TCP port of the OpenContrail vrouter agent
# port: 8086
# UDP dest port for MPLS traffic
# mpls_udp_port: 51234
storage:
elasticsearch:
host: 8.13.3.20:9200
maxconns: 10
retry: 60
bulk_maxdocs: 100
bulk_maxdelay: 5
# OrientDB connection informations
# orientdb:
# addr: http://127.0.0.1:2480
# database: Skydive
# username: root
# password: hello
graph:
# graph backend memory, elasticsearch, orientdb
backend: elasticsearch
logging:
level: INFO
backends:
- stderr
# - file
# - syslog
# - json
# configuration of the 'file' backend
# file:
# path: /var/log/skydive.log
# configuration encoder could be for all backends or for specific one
# encoder: json
auth:
# specify the type of authentication mechanism: noauth, basic, keystone (default: noauth)
# type: basic
# basic:
# file: /etc/skydive/htpasswd
# The 'analyzer_username' and 'analyzer_password' parameters are
# used by the agent to authenticate against the analyzer
analyzer_username: admin
analyzer_password: password
etcd:
# when 'embedded' is set to true, the analyzer will start an embedded etcd server
embedded: true
listen: 8.13.3.20:2379
# both the analyzers and the agents make use of etcd
servers:
- http://8.13.3.20:2379
client_timeout: 5
flow:
# Wihout any new packets, a flow expires after flow.expire
# seconds
expire: 600
# Seconds between flow updates (metrics, enhancements,...)
update: 60
# Protocol to use to send flows to the analyzer: websocket or udp
# protocol: udp
when i run skydive client inject-packet --type icmp6 --count 1 --dstIP fe80::fc16:3eff:fe01:13b0/64 --dstMAC fe:16:3e:01:13:b0 --srcIP fe80::3c48:79ff:fe7b:5009/64 --srcMAC f0:2f:a7:2d:17:98 it shows: 2017-08-17T15:45:05.459+0800 ERROR client/packet_injector.go:86 glob..func14 AECA1083-3CC4-E611-B614-F02FA741EF52: Post http://127.0.0.1:8082/api/injectpacket: EOF
1st/ you need to set the analyzer ip in the configuration file, like :
analyzers:
- 127.0.0.1:8082
2nd/ if you want to use an external etcd server, you should set embedded to false
etcd:
embedded: false
as you using the analyzer etcd server, you should
etcd:
embedded: true
listen: 0.0.0.0:2379
analyzer's config file:
# Skydive config file
# host_id is used to reference the agent by default set to hostname
# host_id:
# WebSocket Ping/Pong timeout in second
ws_pong_timeout: 5
# maximum number of topology aggregated messages before sending
# ws_bulk_maxmsgs: 100
# duration in seconds before flushing topology aggregated messages
# ws_bulk_maxdelay: 2
openstack:
# auth_url: http://xxx.xxx.xxx.xxx:5000/v2.0
# auth_url:http://10.251.47.155/dashboard/auth/login/
# username: admin
# password: 79da84d0ab01481f
# tenant_name: admin
# region_name: RegionOne
# The endpoint_type value must be 'public', 'internal' or 'admin'
# endpoint_type: public
# When using Keystone V3, domain_name needs to be specified
# domain_name: MyDomain
analyzer:
# address and port for the analyzer API, Format: addr:port.
# Default addr is 127.0.0.1
listen: 0.0.0.0:8082
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the agent
# X509_cert: /etc/ssl/certs/analyzer.domain.com.crt
# X509_key: /etc/ssl/certs/analyzer.domain.com.key
# Flow storage engine
# storage:
# Available: elasticsearch, orientdb
# backend: elasticsearch
# maximum number of flows aggregated between two data store inserts
# bulk_insert: 100
# deadline of each bulk insert in second
# bulk_insert_deadline: 5
topology:
# Define static interfaces and links updating Skydive topology
# Can be useful to define external resources like : TOR, Router, etc.
#
# A description language similar to the dot language is used to define
# interfaces and links. An arrow (->) is used to define a link between
# two interfaces (parent -> child).
# Square brackets after the arrow is used to define additional metadata
# of the link (->[key=value,..]). Each interface described will be
# created in the topology excepted interfaces with the local prefix.
# In that specific case the interface of the local host will be used.
# Attributes of interfaces are declared using square brackets ([]).
# The following example creates a TOR1 node linked to a TOR1_PORT1 which is
# linked to the local interface eth0.
fabric:
- TOR1[Name=tor1] -> [color=red] TOR1_PORT1[Name=port1, MTU=1500]
- TOR1_PORT1 -> *[Type=host]/eth0
# update rate of links in seconds
bandwidth_update_rate: 5
# interface metrics - 'netlink'
# captured flows TxBytes + RxByte - 'flows' (need to turn on capture)
bandwidth_source: netlink
# 'absolute' - thresholds in Kbit
# 'relative' - thresholds in % relative to link speed reported by netlink
bandwidth_threshold: absolute
bandwidth_absolute_active: 1
bandwidth_absolute_warning: 10
bandwidth_absolute_alert: 100
bandwidth_relative_active: 0.1
bandwidth_relative_warning: 0.4
bandwidth_relative_alert: 0.8
# list of analyzers used by analyzers and agents
analyzers:
- 8.13.3.20:8082
agent:
# address and port for the agent API, Format: addr:port.
# Default addr is 127.0.0.1
listen: :8081
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the analyzer and unique per agent (recommended)
# X509_cert: /etc/ssl/certs/agent.domain.com.crt
# X509_key: /etc/ssl/certs/agent.domain.com.key
# Server name field specified in TLS communications.
# Not required, but can be used to allow virtual hosting
# X509_servername: domain.com
#
topology:
# Probes used to capture topology informations like interfaces,
# bridges, namespaces, etc...
# Available: ovsdb, docker, neutron, opencontrail
probes:
- ovsdb
- netlink
- netns
# - docker
# - neutron
# - opencontrail
netlink:
# delay in seconds between two metric updates
# metrics_update: 30
flow:
# Period in second to get capture stats from the probe. Note this
# currently only works for the pcap probe
# stats_update: 1
- gopacket
- pcapsocket
metadata:
info: This is compute node
sflow:
# Default listening address is 127.0.0.1
bind_address: 8.13.3.20
# Port min/max used when starting a sflow probe, a agent will be started
# with a port from this range
port_min: 6345
port_max: 6355
ovs:
# ovsdb connection, Format supported :
# * addr:port
# * tcp://addr:port
# * unix:///var/run/openvswitch/db.sock
# If you use the tcp connection you need to authorize connexion to ovsdb agent
# at least locally
# % sudo ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6400:127.0.0.1
# ovsdb: unix:///var/run/openvswitch/db.sock
oflow:
# Enable the parsing of openflow rules (disabled by default)
enable: false
# The probe can connect to remote bridge over TLS (ssl url).
# The default value is empty for those options.
# Path to the private key file (TLS connection)
# key: /etc/ssl/private/agent.key
# Path to the certificate associated to the key (TLS connection)
# cert: /etc/ssl/certs/agent.crt
# Path to certificate authority validating bridge connections (TLS connection)
# ca: /etc/ssl/certs/ca.crt
address:
# Map translating bridge names into URL for remote connection
# - bridge: ssl:xxx.yyy.zzz.ttt:port
docker:
# url: unix:///var/run/docker.sock
netns:
# allow to specify where the netns probe is watching network namespace
# run_path: /var/run/netns
opencontrail:
# Host address of the OpenContrail vrouter agent
# host: localhost
# TCP port of the OpenContrail vrouter agent
# port: 8086
# UDP dest port for MPLS traffic
# mpls_udp_port: 51234
storage:
elasticsearch:
host: 8.13.3.20:9200
maxconns: 10
retry: 60
bulk_maxdocs: 100
bulk_maxdelay: 5
# OrientDB connection informations
# orientdb:
# addr: http://127.0.0.1:2480
# database: Skydive
# username: root
# password: hello
graph:
# graph backend memory, elasticsearch, orientdb
backend: elasticsearch
logging:
level: INFO
backends:
- stderr
# - file
# - syslog
# - json
# configuration of the 'file' backend
# file:
# path: /var/log/skydive.log
# configuration encoder could be for all backends or for specific one
# encoder: json
auth:
# specify the type of authentication mechanism: noauth, basic, keystone (default: noauth)
# type: basic
# basic:
# file: /etc/skydive/htpasswd
# The 'analyzer_username' and 'analyzer_password' parameters are
# used by the agent to authenticate against the analyzer
analyzer_username: admin
analyzer_password: password
etcd:
# when 'embedded' is set to true, the analyzer will start an embedded etcd server
embedded: true
listen: 0.0.0.0:2379
# both the analyzers and the agents make use of etcd
servers:
- http://8.3.3.20:2379
client_timeout: 10
flow:
# Wihout any new packets, a flow expires after flow.expire
# seconds
expire: 600
# Seconds between flow updates (metrics, enhancements,...)
update: 60
# Protocol to use to send flows to the analyzer: websocket or udp
# protocol: udp
agent' config file:
# Skydive config file
# host_id is used to reference the agent by default set to hostname
# host_id:
# WebSocket Ping/Pong timeout in second
ws_pong_timeout: 5
# maximum number of topology aggregated messages before sending
# ws_bulk_maxmsgs: 100
# duration in seconds before flushing topology aggregated messages
# ws_bulk_maxdelay: 2
openstack:
# auth_url: http://xxx.xxx.xxx.xxx:5000/v2.0
# auth_url : http://10.175.48.126/dashboard/auth/login/
# username: admin
# password: 79da84d0ab01481f
# tenant_name: admin
# region_name: RegionOne
# The endpoint_type value must be 'public', 'internal' or 'admin'
# endpoint_type: public
# When using Keystone V3, domain_name needs to be specified
# domain_name: MyDomain
analyzer:
# address and port for the analyzer API, Format: addr:port.
# Default addr is 127.0.0.1
listen: :8082
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the agent
# X509_cert: /etc/ssl/certs/analyzer.domain.com.crt
# X509_key: /etc/ssl/certs/analyzer.domain.com.key
# Flow storage engine
storage:
# Available: elasticsearch, orientdb
backend: elasticsearch
# maximum number of flows aggregated between two data store inserts
bulk_insert: 100
# deadline of each bulk insert in second
bulk_insert_deadline: 5
topology:
# Define static interfaces and links updating Skydive topology
# Can be useful to define external resources like : TOR, Router, etc.
#
# A description language similar to the dot language is used to define
# interfaces and links. An arrow (->) is used to define a link between
# two interfaces (parent -> child).
# Square brackets after the arrow is used to define additional metadata
# of the link (->[key=value,..]). Each interface described will be
# created in the topology excepted interfaces with the local prefix.
# In that specific case the interface of the local host will be used.
# Attributes of interfaces are declared using square brackets ([]).
# The following example creates a TOR1 node linked to a TOR1_PORT1 which is
# linked to the local interface eth0.
fabric:
- TOR1[Name=tor1] -> [color=red] TOR1_PORT1[Name=port1, MTU=1500]
- TOR1_PORT1 -> *[Type=host]/eth0
# update rate of links in seconds
bandwidth_update_rate: 5
# interface metrics - 'netlink'
# captured flows TxBytes + RxByte - 'flows' (need to turn on capture)
bandwidth_source: netlink
# 'absolute' - thresholds in Kbit
# 'relative' - thresholds in % relative to link speed reported by netlink
bandwidth_threshold: absolute
bandwidth_absolute_active: 1
bandwidth_absolute_warning: 10
bandwidth_absolute_alert: 100
bandwidth_relative_active: 0.1
bandwidth_relative_warning: 0.4
bandwidth_relative_alert: 0.8
# list of analyzers used by analyzers and agents
analyzers:
- 8.13.3.20:8082
agent:
# address and port for the agent API, Format: addr:port.
# Default addr is 127.0.0.1
listen: 0.0.0.0:8081
# File path to X509 Certificate and Private Key to enable TLS communication
# Must be different than the analyzer and unique per agent (recommended)
# X509_cert: /etc/ssl/certs/agent.domain.com.crt
# X509_key: /etc/ssl/certs/agent.domain.com.key
# Server name field specified in TLS communications.
# Not required, but can be used to allow virtual hosting
# X509_servername: domain.com
#
topology:
# Probes used to capture topology informations like interfaces,
# bridges, namespaces, etc...
# Available: ovsdb, docker, neutron, opencontrail
probes:
- ovsdb
# - docker
# - neutron
# - opencontrail
netlink:
# delay in seconds between two metric updates
# metrics_update: 30
flow:
# Period in second to get capture stats from the probe. Note this
# currently only works for the pcap probe
# stats_update: 1
metadata:
info: This is compute node
sflow:
# Default listening address is 127.0.0.1
bind_address: 8.13.3.37
# Port min/max used when starting a sflow probe, a agent will be started
# with a port from this range
port_min: 6345
port_max: 6355
ovs:
# ovsdb connection, Format supported :
# * addr:port
# * tcp://addr:port
# * unix:///var/run/openvswitch/db.sock
# If you use the tcp connection you need to authorize connexion to ovsdb agent
# at least locally
# % sudo ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6400:127.0.0.1
# ovsdb: unix:///var/run/openvswitch/db.sock
oflow:
# Enable the parsing of openflow rules (disabled by default)
enable: false
# The probe can connect to remote bridge over TLS (ssl url).
# The default value is empty for those options.
# Path to the private key file (TLS connection)
# key: /etc/ssl/private/agent.key
# Path to the certificate associated to the key (TLS connection)
# cert: /etc/ssl/certs/agent.crt
# Path to certificate authority validating bridge connections (TLS connection)
# ca: /etc/ssl/certs/ca.crt
address:
# Map translating bridge names into URL for remote connection
# - bridge: ssl:xxx.yyy.zzz.ttt:port
docker:
# url: unix:///var/run/docker.sock
netns:
# allow to specify where the netns probe is watching network namespace
# run_path: /var/run/netns
opencontrail:
# Host address of the OpenContrail vrouter agent
# host: localhost
# TCP port of the OpenContrail vrouter agent
# port: 8086
# UDP dest port for MPLS traffic
# mpls_udp_port: 51234
storage:
elasticsearch:
host: 8.13.3.20:9200
maxconns: 10
retry: 60
bulk_maxdocs: 100
bulk_maxdelay: 5
# OrientDB connection informations
# orientdb:
# addr: http://127.0.0.1:2480
# database: Skydive
# username: root
# password: hello
graph:
# graph backend memory, elasticsearch, orientdb
backend: memory
logging:
level: INFO
backends:
- stderr
# - file
# - syslog
# - json
# configuration of the 'file' backend
# file:
# path: /var/log/skydive.log
# configuration encoder could be for all backends or for specific one
# encoder: json
auth:
# specify the type of authentication mechanism: noauth, basic, keystone (default: noauth)
# type: basic
# basic:
# file: /etc/skydive/htpasswd
# The 'analyzer_username' and 'analyzer_password' parameters are
# used by the agent to authenticate against the analyzer
analyzer_username: admin
analyzer_password: password
etcd:
# when 'embedded' is set to true, the analyzer will start an embedded etcd server
embedded: true
listen: 8.13.3.20:2379
# both the analyzers and the agents make use of etcd
servers:
- http://8.13.3.20:2379
client_timeout: 5
flow:
# Wihout any new packets, a flow expires after flow.expire
# seconds
expire: 600
# Seconds between flow updates (metrics, enhancements,...)
update: 60
# Protocol to use to send flows to the analyzer: websocket or udp
# protocol: udp
source node is mandatory param. added a proper check and error message.
When I use the function of Generator, the problem appears:
2017-08-17 10:21:18.192770 I | http: panic serving 8.0.2.254:14376: runtime error: invalid memory address or nil pointer dereference goroutine 389 [running]: net/http.(conn).serve.func1(0xc42258e820) /usr/local/go/src/net/http/server.go:1721 +0xd0 panic(0x11f6420, 0x1dec710) /usr/local/go/src/runtime/panic.go:489 +0x2cf github.com/skydive-project/skydive/packet_injector.(PacketInjectorClient).InjectPacket(0xc420138350, 0xc422695f20, 0x24, 0xc42258ee60, 0xc42258ee60, 0x0, 0x0, 0xe4000000013237c0) /root/work/src/github.com/skydive-project/skydive/packet_injector/client.go:50 +0x130 github.com/skydive-project/skydive/api.(PacketInjectorAPI).injectPacket(0xc42095b6c0, 0x1e15e00, 0xc4218e5dc0, 0xc421e56d80) /root/work/src/github.com/skydive-project/skydive/api/packet_injector.go:174 +0x18d github.com/skydive-project/skydive/api.(PacketInjectorAPI).(github.com/skydive-project/skydive/api.injectPacket)-fm(0x1e15e00, 0xc4218e5dc0, 0xc421e56d80) /root/work/src/github.com/skydive-project/skydive/api/packet_injector.go:212 +0x48 github.com/skydive-project/skydive/http.(NoAuthenticationBackend).Wrap.func1(0x1e15e00, 0xc4218e5dc0, 0xc420081800) /root/work/src/github.com/skydive-project/skydive/http/noauth.go:44 +0xf8 net/http.HandlerFunc.ServeHTTP(0xc42095b800, 0x1e15e00, 0xc4218e5dc0, 0xc420081800) /usr/local/go/src/net/http/server.go:1942 +0x44 github.com/skydive-project/skydive/vendor/github.com/gorilla/mux.(Router).ServeHTTP(0xc4213cbe00, 0x1e15e00, 0xc4218e5dc0, 0xc420081800) /root/work/src/github.com/skydive-project/skydive/vendor/github.com/gorilla/mux/mux.go:100 +0x255 net/http.serverHandler.ServeHTTP(0xc421429540, 0x1e15e00, 0xc4218e5dc0, 0xc420081800) /usr/local/go/src/net/http/server.go:2568 +0x92 net/http.(conn).serve(0xc42258e820, 0x1e17180, 0xc4218fa0c0) /usr/local/go/src/net/http/server.go:1825 +0x612 created by net/http.(Server).Serve /usr/local/go/src/net/http/server.go:2668 +0x2ce